[PATCH] Propagate alignment for _Complex
JF Bastien
jfb at google.com
Mon Jul 15 12:50:55 PDT 2013
> "align 0" means there's code which hasn't been updated to correctly
> set an alignment. Unfortunately, the initial IRGen implementation
> wasn't properly alignment-aware, and we're been paying the price ever
> since.
I see, I'll fix others I run into.
> Our rule is generally that we propagate alignment for lvalue, but not
> pointers. This allows some convenient constructs like packed structs
> to work as expected without requiring the impossible of the compiler.
I guess I conflated two issues: atomics actually have to be aligned
properly, whereas complex needs to be aligned like an array of the
base type would be. A packed complex won't cause runtime failures, but
a packed atomic is in UB territory, yet Clang accepts them just fine.
I guess this issue isn't really pertinent to my patch, so I'll address
it separately.
More information about the cfe-commits
mailing list