Message ID | 20110320194834.GS30899@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
On 03/20/2011 08:48 PM, Jakub Jelinek wrote: > Ok for trunk/4.6? > > 2011-03-20 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. > > * gcc.dg/pr48213.c: New test. Ok. Thanks! -Andreas-
--- gcc/config/s390/s390.c.jj 2011-03-14 14:11:52.000000000 +0100 +++ gcc/config/s390/s390.c 2011-03-20 20:08:28.000000000 +0100 @@ -5045,6 +5045,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; --- gcc/testsuite/gcc.dg/pr48213.c.jj 2011-03-20 20:31:14.000000000 +0100 +++ gcc/testsuite/gcc.dg/pr48213.c 2011-03-20 20:30:34.000000000 +0100 @@ -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 (); +}