This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: middle-end/9725: Invalid dependency determination
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
- Date: Mon, 17 Feb 2003 10:49:29 -0600 (CST)
- Subject: Re: middle-end/9725: Invalid dependency determination
> 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/