The attached test program uses 5 local variables and this fits into i386 available registers. gcc 3.4.3 manages to do it with -O3.
gcc-4.1.1 -O2 and -O3 are identical and both are worse than gcc-3.4.3 -O3: # wc -l *.s 1498 serpent343-O2.s 1252 serpent343-O3.s <- gcc 3.4.3 is smaller! 1313 serpent411-O2.s 1313 serpent411-O3.s gcc-4.1.1 -Os is better than -O3, but still a tiny bit worse than gcc-3.4.3: # wc -l serpent343-O3.s serpent411-Os.s 1252 serpent343-O3.s 1275 serpent411-Os.s # size serpent343-O3.o serpent411-Os.o 3262 0 0 3262 cbe serpent343-O3.o 3347 0 0 3347 d13 serpent411-Os.o Additional ingo is in the testcase itself. (btw does it make sense to include this into testsuite?) -- Summary: regression from 3.x: 4.1.1 uses memory where it can use registers Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: vda dot linux at googlemail dot com GCC build triplet: i386-pc-linux-gnu GCC host triplet: i386-pc-linux-gnu GCC target triplet: i386-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28481