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]

Re: [PATCH] Fix PR34027, SCEV const-prop pessimizes -Os


On Nov 13, 2007 1:29 AM, Bernd Schmidt <bernds_cb1@t-online.de> wrote:
> Richard Guenther wrote:
> > With the now famous enough testcase
> >
> > unsigned long long foobar(unsigned long long ns)
> > {
> >   while(ns >= 1000000000L)
> >     ns -= 1000000000L;
> >   return ns;
> > }
> >
> > SCEV const-prop creates the expression
> >
> >   ns + (ns /[fl] 1000000000L) / -1000000000L
> >
> > for the final value of ns
>
> Am I the only one here who thinks this is a spectacularly bad idea?
> Divisions are expensive, especially on targets without hardware divide.

No you are not ;)  In fact the kernel people complained about this
already.

Richard.


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