Seen on 4.0 "Thu Mar 17 06:05:21 UTC 2005" and trunk of "Thu Mar 17 15:06:06 UTC 2005" at -O2. The test-case in the first attachment has this code snippet: vec += (base[i+1] - base[i]);
The expression at the right hand of that line is compiled at -O2 into: move.d [$r11+],$r9 sub.d [$r11-4],$r9 Tsk tsk. Some part of GCC doesn't adjust expressions when postincrements are involved. I don't see this bug with 3.2.1, so I call it a regression, though local changes might affect the actual regressionness. It is unknown whether it's also a regression for 3.4 and 3.3. -- Summary: [4.1, 4.0 regression] Mishandling of postincrement causes bzip2 miscompilation. Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hp at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: cris-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20527