This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34027] [4.3 regression] -Os code size nearly doubled
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Nov 2007 12:15:39 -0000
- Subject: [Bug tree-optimization/34027] [4.3 regression] -Os code size nearly doubled
- References: <bug-34027-9876@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from jakub at gcc dot gnu dot org 2007-11-09 12:15 -------
I think whether the modulus will be bigger or smaller is terribly hard to
estimate. Really, if you file -Os regressions, you should at least compile the
whole kernel and compare whether the resulting sizes, rather than cherry
picking one example. E.g. on ppc64 computing modulus rather than doing the
loop
is definitely much shorter.
IMHO if the kernel wants to avoid using modulus, it should just say so
unsigned long long foobar(unsigned long long ns)
{
while(ns >= 1000000000L) {
ns -= 1000000000L;
asm ("" : "=r" (ns) : "0" (ns));
}
return ns;
}
will do that just fine.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34027