OSDN Git Service

* config/m32c/m32c.c (m32c_expand_insv): Check that the value
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 May 2006 22:53:48 +0000 (22:53 +0000)
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 May 2006 22:53:48 +0000 (22:53 +0000)
we're inserting is a singlt-bit constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114250 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m32c/m32c.c

index ed782e1..04a8373 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-30  Naveen.H.S  <naveenh@kpitcummins.com>
+           DJ Delorie  <dj@redhat.com>
+
+       * config/m32c/m32c.c (m32c_expand_insv): Check that the value
+       we're inserting is a singlt-bit constant.
+
 2006-05-30  Roger Sayle  <roger@eyesopen.com>
 
        * simplify-rtx.c (simplify_binary_operation_1) <LSHIFTRT>: Cast
index 186f666..6fddc4b 100644 (file)
@@ -3435,6 +3435,14 @@ m32c_expand_insv (rtx *operands)
   if (INTVAL (operands[1]) != 1)
     return 1;
 
+  /* Our insv opcode (bset, bclr) can only insert a one-bit constant.  */
+  if (GET_CODE (operands[3]) != CONST_INT)
+    return 1;
+  if (INTVAL (operands[3]) != 0
+      && INTVAL (operands[3]) != 1
+      && INTVAL (operands[3]) != -1)
+    return 1;
+
   mask = 1 << INTVAL (operands[2]);
 
   op0 = operands[0];