On Thu, Sep 14, 2017 at 11:39:54AM -0500, Segher Boessenkool wrote:
> [ pressed send too early ]
> 
> On Thu, Sep 14, 2017 at 10:18:55AM -0500, Pat Haugen wrote:
> > --- gcc/config/rs6000/rs6000.c      (revision 252029)
> > +++ gcc/config/rs6000/rs6000.c      (working copy)
> > @@ -37807,6 +37807,11 @@ rs6000_set_up_by_prologue (struct hard_r
> >      add_to_hard_reg_set (&set->set, Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
> >    if (cfun->machine->split_stack_argp_used)
> >      add_to_hard_reg_set (&set->set, Pmode, 12);
> > +
> > +  /* Make sure the hard reg set doesn't include r2, which was possibly 
> > added
> > +     via PIC_OFFSET_TABLE_REGNUM.  */
> > +  if (TARGET_TOC)
> > +    remove_from_hard_reg_set (&set->set, Pmode, TOC_REGNUM);
> >  }
> 
> And why is the problem in PR51872 no longer there?  Or is it?

This code in rs6000_set_up_by_prologue:

  if (!TARGET_SINGLE_PIC_BASE
      && TARGET_TOC
      && TARGET_MINIMAL_TOC
      && !constant_pool_empty_p ())
    add_to_hard_reg_set (&set->set, Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);

adds r30, the -mminimal-toc toc pointer register set up by the
prologue.  Pat's change removes r2.  Which looks correct to me.

-- 
Alan Modra
Australia Development Lab, IBM

Reply via email to