After upgrading to 4.4.1 one of my unit tests started failing reproducibly.
I tried to find the part of -O3 (compared to -O2) that caused the failure and I was able to "fix" the error by changing "optimize >= 3" to "optimize >= 4" in tree-ssa-loop.c lines 509 and 550. That's the minimal change to make it work again. Next I tried to reduce my code to a simple testcase but that is really hard. I will attach the smallest file I was able to reduce. But in that case it also fails at -O3 (with my change above -O4 was necessary to make it fail), -O2 and -O1. -O0 still doesn't fail. Any further simplification of the code made the bug go away. The code creates an array of floats which an index vector (starting from {0, 1}) gathers values from into a float vector class. Then the code verifies that the correct values were read. The error I was able to identify in the assembly is that the multiplication at line 93 ({0, 1} * uint_v(1)) is carried out as {0, 1} * {2, 3} instead of {0, 1} * {1, 1}. -- Summary: 4.4.1 regression: miscompiles with -03 (seemingly related to attribute may_alias) Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kretz at kde dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40924