http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57425
Bug ID: 57425 Summary: RTL alias analysis unprepared to handle stack slot sharing Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: wrong-code Severity: major Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amylaar at gcc dot gnu.org Created attachment 30198 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30198&action=edit testcase variant using a int / long union I see a failures for gcc.dg/torture/pr25654.c for avr for -Os, -O2 and higher optimization levels. The .172r.cse1 debugging dump still looks OK, but the .173r.fwprop1 dump shows that the second memory read to compute sum has been eliminated by reusing the value of the first one, despite the store that happened in the mean time. AFAICT, this patch: http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=188667 has removed the infrastructure that was put in place to fix PR 25654, without putting any in any replacement. Now, what makes the avr different from the majority of tier1 targets is that short and int are the same size. If I change the testcase a bit to use int/long instead of short/int, it starts failing on i686-pc-linux-gnu. This is a 4.8 regression relative to 4.7 . A variant of the testcase without unions also fails. This is again at -Os / -O2 and higher optimization levels.