middle-end/9725: Invalid dependency determination
Wolfgang Bangerth
bangerth@ticam.utexas.edu
Mon Feb 17 16:49:00 GMT 2003
> I was fearing you would say this. But I can in no way agree - the code
> presented is valid C, and hence should work at any optimization level.
What makes you think so? gcc's info pages show
`-fstrict-aliasing'
Allows the compiler to assume the strictest aliasing rules
applicable to the language being compiled. For C (and C++), this
activates optimizations based on the type of expressions. In
particular, an object of one type is assumed never to reside at
the same address as an object of a different type, unless the
types are almost the same. For example, an `unsigned int' can
alias an `int', but not a `void*' or a `double'. A character type
may alias any other type.
In your code you try to pretend that a variable of type "struct S" resides
at the place of a long long. That's exactly the case that's covered above,
which in turn exactly parallels what the standard says.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth/
More information about the Gcc-bugs
mailing list