[Bug rtl-optimization/25654] [4.0/4.1/4.2 Regression] RTL alias analysis unprepared to handle stack slot sharing
hubicka at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Jan 19 00:14:00 GMT 2006
------- Comment #10 from hubicka at gcc dot gnu dot org 2006-01-19 00:14 -------
My understanding of C type based aliasing rules always was that char, as an
exception, might alias with everything. Perhaps I lived in false belief for a
while, but at least -Wstrict-aliasing seems to think so:
ibm:~ # more t.c
char a[10];
short b[10];
main()
{
*(int *)a=5;
*(int *)b=5;
}
ibm:~ # gcc -O2 -Wstrict-aliasing t.c
t.c: In function main:
t.c:6: warning: dereferencing type-punned pointer will break strict-aliasing
rules
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25654
More information about the Gcc-bugs
mailing list