This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/18806] generate wrong code with hi optimization


------- Additional Comments From dberlin at gcc dot gnu dot org  2004-12-03 13:47 -------
Actually, this is related to the aliasing stuff described in the non-bugs.

If you look, in the first instance,  you are casting a structure to an unsigned
short *, and treating it like an array.

In fact, i get
structa.c: In function `main':
structa.c:46: warning: passing arg 1 of `in_chksum_tcp' from incompatible
pointer type

This is not legal code.

The second invocation, where you pass p.a, is correct, and we give you correct
code as a result.

If you compile the file with -fno-strict-aliasing, you also get the result you
want, since we ignore the fact that you are violating the aliasing rules.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18806


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]