Hi, On Mon, 3 Sep 2018, H.J. Lu wrote:
> > % ./gcc/cc1plus -quiet -O -g -fno-omit-frame-pointer -fno-var-tracking x.cc > > % ./gcc/cc1plus -quiet -O -g -fno-omit-frame-pointer -fvar-tracking x.cc > > It is because of > > gcc_assert ((SUPPORTS_STACK_ALIGNMENT > && (elim == hard_frame_pointer_rtx <<<<<<<<<<<< So, what's the testcase testing then? Before the patch it doesn't ICE, after the patch it doesn't ICE. What should I look out for so I can see that what the testcase is producing without the patch is wrong? > > I get the feeling this needs to be fixed somewhere else, namely > > eliminate_regs. Basically if the frame pointer isn't needed, then why is > > hard_frame_pointer_rtx even somewhere in the final RTL? The elimination > > you do explicitely in your new routines should have been done as part of > > general register elimination. Why isn't it? > > hard frame pointer isn't referenced directly in the final RTL. It is arg > pointer in debug info, which is eliminated by hard frame pointer in > based_loc_desc. You talking about this, right: /* We only use "frame base" when we're sure we're talking about the post-prologue local stack frame. We do this by *not* running register elimination until this point, and recognizing the special argument pointer and soft frame pointer rtx's. */ if (reg == arg_pointer_rtx || reg == frame_pointer_rtx) { rtx elim = (ira_use_lra_p ? lra_eliminate_regs (reg, VOIDmode, NULL_RTX) : eliminate_regs (reg, VOIDmode, NULL_RTX)); if (elim != reg) { ... So, why would eliminate_regs return hard_frame_pointer_rtx if no frame pointer is desired? Ciao, Michael.