On Tue, Jul 26, 2011 at 10:05:06PM +0200, Uros Bizjak wrote:
> > 2011-07-26  H.J. Lu  <hongjiu...@intel.com>
> >
> >        PR target/47372
> >        * config/i386/i386.c (ix86_delegitimize_address): Call
> >        simplify_gen_subreg for PIC with ptr_mode only if modes of
> >        x and orig_x are different.
> >
> > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> > index 429cd62..9c52aa3 100644
> > --- a/gcc/config/i386/i386.c
> > +++ b/gcc/config/i386/i386.c
> > @@ -12967,9 +12982,10 @@ ix86_delegitimize_address (rtx x)
> >          || !MEM_P (orig_x))
> >        return ix86_delegitimize_tls_address (orig_x);
> >       x = XVECEXP (XEXP (x, 0), 0, 0);

When x is no longer known to be Pmode

> > -      if (GET_MODE (orig_x) != Pmode)
> > +      if (GET_MODE (orig_x) != GET_MODE (x)
> > +         && GET_MODE (orig_x) != ptr_mode)

why not simply just
        if (GET_MODE (orig_x) != GET_MODE (x))

> >        {
> > -         x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
> > +         x = simplify_gen_subreg (GET_MODE (orig_x), x, ptr_mode, 0);

and using GET_MODE (x) instead of Pmode/ptr_mode here?  I mean,
x is certainly not VOIDmode here, should be either SImode or DImode
and thus simplify_gen_subreg ought to work for it.

> >          if (x == NULL_RTX)
> >            return orig_x;
> >        }
> >

        Jakub

Reply via email to