This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Stop gengtype from emitting empty loops


Hello,

For scalar fields or skipped fields, gengtype produces empty loops.
This patch checks for that case and breaks out if an empty loop body
is detected:

--- gtype-desc.c.orig   2012-07-24 01:57:42.830007515 -0700
+++ gtype-desc.c        2012-07-24 02:10:14.530007515 -0700
@@ -89,6 +89,7 @@
         {
           size_t i0;
           for (i0 = 0; i0 != l0; i0++) {
+            break;
           }
         }
       }

This probably helps only for -O0 builds, but I do a lot of those.
Compile time for powerpc64-unknown-linux-gnu/bits/extc++.h.gch/O2g.gch
drops from "user 2m29.112s" to "user 0m30.208s" for a -O0 built
cc1plus.

Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK?

Ciao!
Steven

Attachment: gengtype_O0_speedup.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]