OSDN Git Service

Backport from mainline
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2013 17:27:30 +0000 (17:27 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2013 17:27:30 +0000 (17:27 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@195946 138bc75d-0d04-0410-961f-82ee72b054a4

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

index bc85158..818678a 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-09  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index ed1dddc..550759a 100644 (file)
@@ -244,7 +244,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 a600230..a2501c4 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-08  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        Backport from mainline
diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c
new file mode 100644 (file)
index 0000000..b901bb2
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-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;
+}