On Fri, Aug 04, 2017 at 01:41:22PM +0100, Wilco Dijkstra wrote: > To implement -fomit-leaf-frame-pointer, there are 2 places where we need > to check whether we have to use a frame chain (since register allocation > may allocate LR in a leaf function that omits the frame pointer, but if > LR is spilled we must emit a frame chain). To simplify this do not force > frame_pointer_needed via aarch64_frame_pointer_required, but enable the > frame chain in aarch64_layout_frame. Now aarch64_frame_pointer_required > can be removed and aarch64_can_eliminate is simplified. > > OK for commit?
I've thought about this for a while, I'm still not completely comfortable with the idea that we "lie" to the mid-end about the frame-pointer, and patch it up in the frame layout code, but I can see how we're moving from one lie which adds a ton of complexity, to a different lie which reduces complexity. It all still seems tenuous, but I think I understand the reasoning, and we've got a solid 6 months to figure out what breaks. OK (assuming this has been tested *recently* against aarch64-none-linux-gnu). Reviewed-By: James Greenhalgh <james.greenha...@arm.com> Thanks, James > > ChangeLog: > 2017-08-03 Wilco Dijkstra <wdijk...@arm.com> > > gcc/ > * config/aarch64/aarch64.c (aarch64_frame_pointer_required) > Remove. > (aarch64_layout_frame): Initialise emit_frame_chain. > (aarch64_can_eliminate): Remove omit leaf frame pointer code. > (TARGET_FRAME_POINTER_REQUIRED): Remove define.