This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
>Just to add a bit of extra spice, I don't believe users do have the
>-fno-strict-aliasing option as a panacea. User code can fail if it casts
>between struct/union types and scalar types, but not because of the alias
>analysis (so -fno-strict-aliasing doesn't help).
>
>Instead the scheduler performs some optimizations based on MEM_IN_STRUCT
>vs. MEM_SCALAR_P tests. If the user code casts between structs and scalars,
>the instructions can be reordered the wrong way round.
>
>So, even with -fno-strict-aliasing this class of problem can't necessarily
>be worked around.
If that's the case, we should be working on fixing *that*, rather
than discussing niceties of default code-generation.
tq vm, (burley)