------- Comment #5 from bonzini at gnu dot org  2006-04-25 06:37 -------
Sure.  The code meant to do so using trunc_int_for_mode, but it does not work
because constop is unsigned.  The trunc_int_for_mode was introduced in
http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01397.html to cure a similar ICE;
and the bug is latent on all branches since it dates back (through various
changes, notably r49112 by amodra) to the dawn of the original old-gcc
repository.

Bootstrapping this patch on i686-pc-linux-gnu, ok if it passes?  What about
4.1?

Index: gcc-fwprop/gcc/combine.c
===================================================================
--- gcc-fwprop/gcc/combine.c    (revision 113024)
+++ gcc-fwprop/gcc/combine.c    (working copy)
@@ -8190,6 +8190,5 @@ simplify_and_const_int_1 (enum machine_m
     return NULL_RTX;

   /* Otherwise, return an AND.  */
-  constop = trunc_int_for_mode (constop, mode);
-  return simplify_gen_binary (AND, mode, varop, GEN_INT (constop));
+  return simplify_gen_binary (AND, mode, varop, gen_int_mode (constop, mode));
 }

Paolo


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bonzini at gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-04-25 00:53:57         |2006-04-25 06:37:18
               date|                            |


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

Reply via email to