]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/47201 (ICE: SIGSEGV in adjust_mems (var-tracking.c:814) with...
authorJakub Jelinek <jakub@redhat.com>
Sun, 16 Jan 2011 20:27:54 +0000 (21:27 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 16 Jan 2011 20:27:54 +0000 (21:27 +0100)
Backport from mainline
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.

* gcc.dg/pr47201.c: New test.

From-SVN: r168870

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr47201.c [new file with mode: 0644]

index 5caac14b75f97f777dcb3fb801ed4f7634c9f499..86e15db5cd91000f7271756502f3ab586aebabfc 100644 (file)
@@ -1,6 +1,12 @@
 2011-01-16  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       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.
+
        2011-01-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/47150
index e60a4c3bf83bb1c30b3f5f2eb767f839d8c6be33..cfb3e22a578c1e5d5ba527c0dfc297ae19eb1e96 100644 (file)
@@ -11038,7 +11038,11 @@ ix86_delegitimize_address (rtx x)
        return 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;
     }
 
@@ -11107,7 +11111,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;
 }
 
index 648fa5d0f626b088ad78165d283e3a35d5c64d10..3e9e0a06b81fea107e65737b1b299218d33ca7fa 100644 (file)
@@ -1,6 +1,11 @@
 2011-01-16  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       2011-01-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/47201
+       * gcc.dg/pr47201.c: New test.
+
        2011-01-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/47150
diff --git a/gcc/testsuite/gcc.dg/pr47201.c b/gcc/testsuite/gcc.dg/pr47201.c
new file mode 100644 (file)
index 0000000..11e1f2a
--- /dev/null
@@ -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;
+}