spu.md ("insv"): Fail if bitoffset+bitsize lies outside the target mode.
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 2 Apr 2014 18:53:06 +0000 (18:53 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Wed, 2 Apr 2014 18:53:06 +0000 (18:53 +0000)
* config/spu/spu.md ("insv"): Fail if bitoffset+bitsize
lies outside the target mode.

From-SVN: r209028

gcc/ChangeLog
gcc/config/spu/spu.md

index 31ff90d..d6d4072 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-02  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/spu/spu.md ("insv"): Fail if bitoffset+bitsize
+       lies outside the target mode.
+
 2014-04-02  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/60735
index 228b228..3ac4bfc 100644 (file)
                      (match_operand:SI 2 "const_int_operand" ""))
        (match_operand 3 "nonmemory_operand" ""))]
   ""
-  { spu_expand_insv(operands); DONE; })
+  {
+    if (INTVAL (operands[1]) + INTVAL (operands[2])
+        > GET_MODE_BITSIZE (GET_MODE (operands[0])))
+      FAIL;
+    spu_expand_insv(operands);
+    DONE;
+  })
 
 ;; Simplify a number of patterns that get generated by extv, extzv,
 ;; insv, and loads.