From patchwork Tue Jul 24 09:18:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Stop gengtype from emitting empty loops Date: Mon, 23 Jul 2012 23:18:00 -0000 From: Steven Bosscher X-Patchwork-Id: 172809 Message-Id: To: GCC Patches 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: 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 --- 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; } } }