------- Comment #8 from hjl dot tools at gmail dot com  2008-10-04 01:33 -------
(In reply to comment #7)
> This regression was introduced between 2005-03-11 and 2005-03-13.
> This patch:
> 
> http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01296.html
> 
> may be the cause.
> 

It is the cause. This patch seems to work:

Index: expmed.c
===================================================================
--- expmed.c    (revision 140780)
+++ expmed.c    (working copy)
@@ -3092,7 +3092,7 @@
         produce a smaller program when -O is not used.  But this causes
         such a terrible slowdown sometimes that it seems better to always
         use synth_mult.  */
-      if (coeff != 0)
+      if (coeff > 0 || (coeff != 0 && !unsignedp))
        {
          /* Special case powers of two.  */
          if (EXACT_POWER_OF_2_OR_ZERO_P (coeff))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37731

Reply via email to