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


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.


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif


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