We were running bench++ looking for cases that perform worse with g++-4.x than they do with g++-2.95 . We posted a related mail to the gcc list http://gcc.gnu.org/ml/gcc/2005-08/msg00197.html
There seems to be an interesting regression, exhibited by more than one test, that is related to the inliner. For example, the test s000005a, when compiled with g++-4.0.1 runs faster when compiled with -O2 than it does when compiled with -O2 -finline-functions, or with -O3 . Specifically, the slowdown is in the order of x2.5 If g++-2.95.3 is used with the same flags, the slowdown does not occur. Interestingly, if a *dead* function is commented out, or a *dead* call to cerr, the regression goes away. If g++-410_0723 is used, the regression appears as with g++-4.0.1 (when -O2 -finline, or -O3 is used), but it does *not* go away when then dead function is commented out. It only goes away when the dead cerr is commented out. -- Summary: Inlining related regression for gcc-4.x Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: danalis at cis dot udel dot edu CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: i686-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23305