[patch] rs6000.c: Replace gen_rtx_CONST_INT with GEN_INT.

Kazu Hirata kazu@cs.umass.edu
Mon Nov 15 14:54:00 GMT 2004


Hi,

Attached is a patch to replace gen_rtx_CONST_INT with GEN_INT
throughout rs6000.c.

gen_rtx_CONST_INT ignores the first argument.  It "appears" to
truncate the given integer to the specified mode, but it does not.
For that, we have gen_int_mode.

For those uses that are in the patch, the author, Stan, didn't seem to
mean truncation as integers passed to gen_rtx_CONST_INT appear to be
small.  For that, we should use GEN_INT, which is more widely used.
In fact, rs6000.c is the only file that directly uses
gen_rtx_CONST_INT.

Unfortunately, I don't have a testing environment.  If somebody could
test this, that would be greatly appreciated.  OK to apply?

Kazu Hirata

2004-11-15  Kazu Hirata  <kazu@cs.umass.edu>

	* config/rs6000/rs6000.c: Use GEN_INT instead of
	gen_rtx_CONST_INT throughout the file.

Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.742
diff -u -d -p -r1.742 rs6000.c
--- config/rs6000/rs6000.c	14 Nov 2004 20:28:57 -0000	1.742
+++ config/rs6000/rs6000.c	15 Nov 2004 13:42:36 -0000
@@ -5129,14 +5129,14 @@ rs6000_darwin64_function_arg (CUMULATIVE
 		    suboff = XEXP (subsub, 1);
 		    subbytepos = INTVAL (suboff);
 		    subbytepos += bytepos;
-		    roffset = gen_rtx_CONST_INT (SImode, subbytepos);
+		    roffset = GEN_INT (subbytepos);
 		    subsub = XEXP (subsub, 0);
 		    rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
 		  }
 	      }
 	    else
 	      {
-		roffset = gen_rtx_CONST_INT (SImode, bytepos);
+		roffset = GEN_INT (bytepos);
 		rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
 	      }
 	    /* Now do an arg advance to get all the cumulative arg
@@ -5175,14 +5175,14 @@ rs6000_darwin64_function_arg (CUMULATIVE
 		  suboff = XEXP (subsub, 1);
 		  subbytepos = INTVAL (suboff);
 		  subbytepos += bytepos;
-		  roffset = gen_rtx_CONST_INT (SImode, subbytepos);
+		  roffset = GEN_INT (subbytepos);
 		  subsub = XEXP (subsub, 0);
 		  rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
 		}
 	    }
 	  else
 	    {
-	      roffset = gen_rtx_CONST_INT (SImode, bytepos);
+	      roffset = GEN_INT (bytepos);
 	      rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
 	    }
 	    /* Now do an arg advance to get all the cumulative arg
@@ -18383,14 +18383,14 @@ rs6000_darwin64_function_value (CUMULATI
 		    suboff = XEXP (subsub, 1);
 		    subbytepos = INTVAL (suboff);
 		    subbytepos += bytepos;
-		    roffset = gen_rtx_CONST_INT (SImode, subbytepos);
+		    roffset = GEN_INT (subbytepos);
 		    subsub = XEXP (subsub, 0);
 		    rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
 		  }
 	      }
 	    else
 	      {
-		roffset = gen_rtx_CONST_INT (SImode, bytepos);
+		roffset = GEN_INT (bytepos);
 		rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
 	      }
 	  }
@@ -18436,14 +18436,14 @@ rs6000_darwin64_function_value (CUMULATI
 		  suboff = XEXP (subsub, 1);
 		  subbytepos = INTVAL (suboff);
 		  subbytepos += bytepos;
-		  roffset = gen_rtx_CONST_INT (SImode, subbytepos);
+		  roffset = GEN_INT (subbytepos);
 		  subsub = XEXP (subsub, 0);
 		  rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
 		}
 	      }
 	    else
 	      {
-		roffset = gen_rtx_CONST_INT (SImode, bytepos);
+		roffset = GEN_INT (bytepos);
 		rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
 	      }
 	  bytepos += int_size_in_bytes (ftype);



More information about the Gcc-patches mailing list