From: Jakub Jelinek Date: Mon, 21 Mar 2011 09:25:47 +0000 (+0100) Subject: re PR target/48213 (ICE in simplify_subreg called from s390_delegitimize_address) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f36e14bfd4b32e121757e8bd430b4dffb4dc73f;p=gcc.git re PR target/48213 (ICE in simplify_subreg called from s390_delegitimize_address) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14f4cad74ef..c5f059aca4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-21 Jakub Jelinek + + 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 PR target/12171 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 53083ae1730..532a42fa3c0 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index acb8524d9ad..570ab6f7d8d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-21 Jakub Jelinek + + PR target/48213 + * gcc.dg/pr48213.c: New test. + 2011-03-21 Kai Tietz PR target/12171 diff --git a/gcc/testsuite/gcc.dg/pr48213.c b/gcc/testsuite/gcc.dg/pr48213.c new file mode 100644 index 00000000000..cf7d76fa0ea --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48213.c @@ -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 (); +}