]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/56275 (ICE in simplify_subreg, at simplify-rtx.c...
authorUros Bizjak <ubizjak@gmail.com>
Mon, 11 Feb 2013 17:29:53 +0000 (18:29 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 11 Feb 2013 17:29:53 +0000 (18:29 +0100)
Backport from mainline
2013-02-11  Uros Bizjak  <ubizjak@gmail.com>

PR rtl-optimization/56275
* simplify-rtx.c (avoid_constant_pool_reference): Check that
offset is non-negative and less than cmode size before
calling simplify_subreg.

testsuite/ChangeLog

Backport from mainline
2013-02-11  Uros Bizjak  <ubizjak@gmail.com>

PR rtl-optimization/56275
* gcc.dg/pr56275.c: New test.

From-SVN: r195947

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr56275.c [new file with mode: 0644]

index 49c39456a357125e1153307684c1a0e459aa0f65..1f2bf229950241184ef8a04d8264f51465801c26 100644 (file)
@@ -1,3 +1,13 @@
+2013-02-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2013-02-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/56275
+       * simplify-rtx.c (avoid_constant_pool_reference): Check that
+       offset is non-negative and less than cmode size before
+       calling simplify_subreg.
+
 2013-02-08  David Edelsohn  <dje.gcc@gmail.com>
            Michael Meissner  <meissner@linux.vnet.ibm.com>
 
index 42b1be60b153617bd20fdfb44b57bfa0fff89b94..743f72c7c65dbdacfe35673747726848ed99fb27 100644 (file)
@@ -188,7 +188,8 @@ avoid_constant_pool_reference (rtx x)
       /* If we're accessing the constant in a different mode than it was
          originally stored, attempt to fix that up via subreg simplifications.
          If that fails we have no choice but to return the original memory.  */
-      if (offset != 0 || cmode != GET_MODE (x))
+      if ((offset != 0 || cmode != GET_MODE (x))
+         && offset >= 0 && offset < GET_MODE_SIZE (cmode))
         {
           rtx tem = simplify_subreg (GET_MODE (x), c, cmode, offset);
           if (tem && CONSTANT_P (tem))
index c36dae80f440bcac80ee72df42551f874a3a31b1..bc5036222335722362801b09689f5abfc8f9525e 100644 (file)
@@ -1,3 +1,11 @@
+2013-02-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2013-02-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/56275
+       * gcc.dg/pr56275.c: New test.
+
 2013-02-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        Backport from trunk
diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c
new file mode 100644 (file)
index 0000000..fc9c331
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef long long v2tw __attribute__ ((vector_size (2 * sizeof (long long))));
+
+void tiger_block_v2 (long long in1, v2tw *res)
+{
+  v2tw i1 = { in1, in1 };
+
+  *res = i1 << 1;
+}