aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-07 19:41:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-07 19:41:40 +0100
commitc21bbd7a5e90834d14fd097412ff5be6c71c7b3e (patch)
treea16b5b64bb7252c38656ef0e5c74bf283a9ea43c /gcc
parentc6a8f6de089b86578cd788b6ef168842fc9bd3c8 (diff)
downloadgcc-c21bbd7a5e90834d14fd097412ff5be6c71c7b3e.zip
gcc-c21bbd7a5e90834d14fd097412ff5be6c71c7b3e.tar.gz
gcc-c21bbd7a5e90834d14fd097412ff5be6c71c7b3e.tar.bz2
re PR target/47201 (ICE: SIGSEGV in adjust_mems (var-tracking.c:814) with -O -fPIC -g)
PR target/47201 * config/i386/i386.c (ix86_delegitimize_address): If simplify_gen_subreg fails, return orig_x. * gcc.dg/pr47201.c: New test. From-SVN: r168582
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/i386/i386.c14
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr47201.c18
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1306743..503be3c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2011-01-07 Jakub Jelinek <jakub@redhat.com>
+ PR target/47201
+ * config/i386/i386.c (ix86_delegitimize_address): If
+ simplify_gen_subreg fails, return orig_x.
+
PR bootstrap/47187
* value-prof.c (gimple_stringop_fixed_value): Handle
lhs of the call properly.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index cf12881..a26314b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on IA-32.
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -13254,7 +13254,11 @@ ix86_delegitimize_address (rtx x)
return ix86_delegitimize_tls_address (orig_x);
x = XVECEXP (XEXP (x, 0), 0, 0);
if (GET_MODE (orig_x) != Pmode)
- return simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
+ {
+ x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
+ if (x == NULL_RTX)
+ return orig_x;
+ }
return x;
}
@@ -13323,7 +13327,11 @@ ix86_delegitimize_address (rtx x)
return orig_x;
}
if (GET_MODE (orig_x) != Pmode && MEM_P (orig_x))
- return simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
+ {
+ result = simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
+ if (result == NULL_RTX)
+ return orig_x;
+ }
return result;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index af10b24..286bbcf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2011-01-07 Jakub Jelinek <jakub@redhat.com>
+ PR target/47201
+ * gcc.dg/pr47201.c: New test.
+
PR bootstrap/47187
* gcc.dg/tree-prof/pr47187.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr47201.c b/gcc/testsuite/gcc.dg/pr47201.c
new file mode 100644
index 0000000..11e1f2a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47201.c
@@ -0,0 +1,18 @@
+/* PR target/47201 */
+/* { dg-do compile } */
+/* { dg-options "-O -fpic -g" { target fpic } } */
+
+union U
+{
+ __UINTPTR_TYPE__ m;
+ float d;
+} u;
+
+int
+foo (void)
+{
+ union U v = {
+ (__UINTPTR_TYPE__)&u
+ };
+ return u.d == v.d;
+}