re PR target/48213 (ICE in simplify_subreg called from s390_delegitimize_address)
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Mar 2011 09:25:47 +0000 (10:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Mar 2011 09:25:47 +0000 (10:25 +0100)
PR target/48213
* config/s390/s390.c (s390_delegitimize_address): Don't call
lowpart_subreg if orig_x has BLKmode.

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

From-SVN: r171211

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

index 14f4cad74ef933c4c4a0b45cf2e548c9e863d8e3..c5f059aca4bf854a2e8388f6bad5f09f61795ea9 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/48213
+       * config/s390/s390.c (s390_delegitimize_address): Don't call
+       lowpart_subreg if orig_x has BLKmode.
+
 2011-03-21  Kai Tietz  <ktietz@redhat.com>
 
        PR target/12171
index 53083ae173042935656a98dd1efeec12015ffc30..532a42fa3c046917ddbaef10964ed5aa1f7c1d3a 100644 (file)
@@ -5062,6 +5062,8 @@ s390_delegitimize_address (rtx orig_x)
 
   if (GET_MODE (orig_x) != Pmode)
     {
+      if (GET_MODE (orig_x) == BLKmode)
+       return orig_x;
       y = lowpart_subreg (GET_MODE (orig_x), y, Pmode);
       if (y == NULL_RTX)
        return orig_x;
index acb8524d9ad05aef7e81e78152dc8903ac5bc9ba..570ab6f7d8daedbb70463f59836e10a9ce47ec27 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/48213
+       * gcc.dg/pr48213.c: New test.
+
 2011-03-21  Kai Tietz  <ktietz@redhat.com>
 
        PR target/12171
diff --git a/gcc/testsuite/gcc.dg/pr48213.c b/gcc/testsuite/gcc.dg/pr48213.c
new file mode 100644 (file)
index 0000000..cf7d76f
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/48213 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+/* { dg-options "-g -O2 -fpic" { target fpic } } */
+
+struct S { int (*s) (void); };
+int bar (void);
+
+void
+foo (struct S *x)
+{
+  if (x->s != bar)
+    bar ();
+}