aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2013-02-11 17:05:44 +0100
committerUros Bizjak <uros@gcc.gnu.org>2013-02-11 17:05:44 +0100
commitb63fe0076d20fa0ddd660e53d882792e54d1bef7 (patch)
tree75844929969655f7bf9fe5bbc236484d6ff418c5 /gcc
parentba9146c16bc6a7f3539e4cef5f5a9a8207de66ad (diff)
downloadgcc-b63fe0076d20fa0ddd660e53d882792e54d1bef7.zip
gcc-b63fe0076d20fa0ddd660e53d882792e54d1bef7.tar.gz
gcc-b63fe0076d20fa0ddd660e53d882792e54d1bef7.tar.bz2
re PR rtl-optimization/56275 (ICE in simplify_subreg, at simplify-rtx.c:5261 with vector code.)
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: PR rtl-optimization/56275 * gcc.dg/pr56275.c: New test. From-SVN: r195944
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/simplify-rtx.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr56275.c12
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0cdcc3c..00d0784 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/56264
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index d728bbc..3f04b8b 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -242,7 +242,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))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c007809..dce413d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-11 Uros Bizjak <ubizjak@gmail.com>
+
+ PR rtl-optimization/56275
+ * gcc.dg/pr56275.c: New test.
+
2013-02-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/56273
diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c
new file mode 100644
index 0000000..b901bb2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56275.c
@@ -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;
+}