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]

fix rtl-opt/21102


Below this test, we use add_double and immed_const_double.  Obviously
this only works on scalars, and not vectors or complex modes.

Applied 4.0 and mainline.


r~


        PR rtl-opt/21102
        * simplify-rtx.c (simplify_binary_operation): Fix mode check before
        performing some integral scalar simplifications.

Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.230.2.3
diff -u -p -d -r1.230.2.3 simplify-rtx.c
--- simplify-rtx.c	7 Apr 2005 08:25:36 -0000	1.230.2.3
+++ simplify-rtx.c	23 Apr 2005 19:07:14 -0000
@@ -1549,7 +1549,7 @@ simplify_binary_operation (enum rtx_code
 	     have X (if C is 2 in the example above).  But don't make
 	     something more expensive than we had before.  */
 
-	  if (! FLOAT_MODE_P (mode))
+	  if (SCALAR_INT_MODE_P (mode))
 	    {
 	      HOST_WIDE_INT coeff0h = 0, coeff1h = 0;
 	      unsigned HOST_WIDE_INT coeff0l = 1, coeff1l = 1;
@@ -1720,7 +1720,7 @@ simplify_binary_operation (enum rtx_code
 	     have X (if C is 2 in the example above).  But don't make
 	     something more expensive than we had before.  */
 
-	  if (! FLOAT_MODE_P (mode))
+	  if (SCALAR_INT_MODE_P (mode))
 	    {
 	      HOST_WIDE_INT coeff0h = 0, negcoeff1h = -1;
 	      unsigned HOST_WIDE_INT coeff0l = 1, negcoeff1l = -1;


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