vsk added a comment.

In https://reviews.llvm.org/D32456#737273, @efriedma wrote:

> Err, that's not what I meant...
>
> If the alignment of a global in LLVM IR is "zero", it doesn't really mean 
> zero.  It means "guess the alignment I want based on the specified type of 
> the global".  And that's not a game we ever want to play when generating IR 
> from clang.


The alternative mentioned in PR32630 is to decrease the alignment of the global 
when -fsanitize=alignment is enabled. Is this less risky than not specifying 
the alignment at all? I assumed that it was not.

Hm, giving this more thought I'm not happy with how fragile this patch seems. 
Changing the way we set alignment to hack around constant folding doesn't seem 
great. And this patch does not interact properly with extern definitions which 
have '__attribute__((aligned(N)))' set.


https://reviews.llvm.org/D32456



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to