[PATCH, committed] combine gen_int_mode PR 27282

David Edelsohn dje@watson.ibm.com
Wed Apr 26 14:36:00 GMT 2006

	This patch performs a little cleanup and fixes PR 27282 by
changing a GEN_INT to gen_int_mode so that a correctly sign-extended
CONST_INT is created.

Bootstrapped and regrssion tested on powerpc-ibm-aix5.2.0.0.

Approved on IRC by Roger Sayle.


2006-04-26  David Edelsohn  <edelsohn@gnu.org>
	    Paolo Bonzini  <bonzini@gnu.org>

	PR middle-end/27282
	* combine.c (simplify_and_const_int_1): Use gen_int_mode.
	(simplify_and_const_int): Same.

Index: combine.c
--- combine.c	(revision 113239)
+++ combine.c	(working copy)
@@ -8190,8 +8190,7 @@ 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));
@@ -8210,7 +8209,8 @@ simplify_and_const_int (rtx x, enum mach
     return tem;
   if (!x)
-    x = simplify_gen_binary (AND, GET_MODE (varop), varop, GEN_INT (constop));
+    x = simplify_gen_binary (AND, GET_MODE (varop), varop,
+			     gen_int_mode (constop, mode));
   if (GET_MODE (x) != mode)
     x = gen_lowpart (mode, x);
   return x;

More information about the Gcc-patches mailing list