+2017-11-08 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * 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.
+
2017-11-08 Martin Liska <mliska@suse.cz>
* gimplify.c (expand_FALLTHROUGH_r): Simplify usage
return "";
}
-static bool
-aarch64_frame_pointer_required (void)
-{
- /* Use the frame pointer if enabled and it is not a leaf function, unless
- leaf frame pointer omission is disabled. If the frame pointer is enabled,
- force the frame pointer in leaf functions which use LR. */
- if (flag_omit_frame_pointer == 2
- && !(flag_omit_leaf_frame_pointer
- && crtl->is_leaf
- && !df_regs_ever_live_p (LR_REGNUM)))
- return true;
-
- return false;
-}
-
/* Mark the registers that need to be saved by the callee and calculate
the size of the callee-saved registers area and frame record (both FP
and LR may be omitted). */
cfun->machine->frame.emit_frame_chain
= frame_pointer_needed || crtl->calls_eh_return;
+ /* Emit a frame chain if the frame pointer is enabled.
+ If -momit-leaf-frame-pointer is used, do not use a frame chain
+ in leaf functions which do not use LR. */
+ if (flag_omit_frame_pointer == 2
+ && !(flag_omit_leaf_frame_pointer && crtl->is_leaf
+ && !df_regs_ever_live_p (LR_REGNUM)))
+ cfun->machine->frame.emit_frame_chain = true;
+
#define SLOT_NOT_REQUIRED (-2)
#define SLOT_REQUIRED (-1)
return false;
}
- else
- {
- /* If we decided that we didn't need a leaf frame pointer but then used
- LR in the function, then we'll want a frame pointer after all, so
- prevent this elimination to ensure a frame pointer is used. */
- if (to == STACK_POINTER_REGNUM
- && flag_omit_frame_pointer == 2
- && flag_omit_leaf_frame_pointer
- && df_regs_ever_live_p (LR_REGNUM))
- return false;
- }
return true;
}
#undef TARGET_FUNCTION_VALUE_REGNO_P
#define TARGET_FUNCTION_VALUE_REGNO_P aarch64_function_value_regno_p
-#undef TARGET_FRAME_POINTER_REQUIRED
-#define TARGET_FRAME_POINTER_REQUIRED aarch64_frame_pointer_required
-
#undef TARGET_GIMPLE_FOLD_BUILTIN
#define TARGET_GIMPLE_FOLD_BUILTIN aarch64_gimple_fold_builtin