@@ -2985,10 +2985,23 @@ override_options (bool main_args_p)
{
if (flag_zee == 2)
flag_zee = 0;
+ /* Unwind info is not correct around the CFG unless either a
+ frame pointer is present or -maccumulate-outgoing-args is
+ set. When both -fasynchronous-unwind-tables and
+ -fomit-frame-pointer are turned on by default, turn off
+ both if -mno-accumulate-outgoing-args is used. */
if (flag_omit_frame_pointer == 2)
- flag_omit_frame_pointer = 0;
+ flag_omit_frame_pointer
+ = (TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT
+ && (!TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT
+ || !(target_flags_explicit
+ & MASK_ACCUMULATE_OUTGOING_ARGS)));
if (flag_asynchronous_unwind_tables == 2)
- flag_asynchronous_unwind_tables = 0;
+ flag_asynchronous_unwind_tables
+ = (TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT
+ && (!TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT
+ || !(target_flags_explicit
+ & MASK_ACCUMULATE_OUTGOING_ARGS)));
if (flag_pcc_struct_return == 2)
flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
@@ -467,6 +467,8 @@ extern tree x86_mfence;
/* Extra bits to force on w/ 32-bit mode. */
#define TARGET_SUBTARGET32_DEFAULT 0
#define TARGET_SUBTARGET32_ISA_DEFAULT 0
+#define TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT 0
+#define TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT 0
/* Extra bits to force on w/ 64-bit mode. */
#define TARGET_SUBTARGET64_DEFAULT 0
@@ -219,3 +219,10 @@ along with GCC; see the file COPYING3. If not see
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
#endif
+
+/* Turn on -fomit-frame-pointer and -fasynchronous-unwind-tables by
+ default. */
+#undef TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT
+#define TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT 1
+#undef TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT
+#define TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT 1
@@ -123,3 +123,10 @@ see the files COPYING3 and COPYING.RUNTIME
respectively. If not, see
x86_64 glibc provides it in %fs:0x28. */
#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
#endif
+
+/* Turn on -fomit-frame-pointer and -fasynchronous-unwind-tables by
+ default. */
+#undef TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT
+#define TARGET_SUBTARGET32_OMIT_FRAME_POINTER_DEFAULT 1
+#undef TARGET_SUBTARGET32_ASYNCHRONOUS_UNWIND_TABLES_DEFAULT