Cohomology of compactifications of algebraic groups