[Bug middle-end/84300] ICE in dwarf2cfi on ppc64le with -fsplit-stack -fno-omit-frame-pointer

2018-02-08 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84300

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |amodra at gmail dot com

--- Comment #2 from Alan Modra  ---
Testing what should be an obvious fix.

[Bug middle-end/84300] ICE in dwarf2cfi on ppc64le with -fsplit-stack -fno-omit-frame-pointer

2018-02-08 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84300

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-09
 Ever confirmed|0   |1

--- Comment #1 from Alan Modra  ---
The problem occurs in 296r.rtl_dce, where the insn restoring lr after the
__morestack call is deleted.  That leads to the mismatch in cfi state.

Well, OK, lr can be trashed in a function that won't return so deleting the lr
restore in itself isn't wrong.  But if we want a consistent cfi state that
can't happen without also deleting the instructions saving lr.  Which won't
occur due to hacks to stop regrename breaking things.

I think the easiest solution is to make split_stack_return depend on lr (which
of course it does!).