From: Thomas Schwinge Date: Tue, 25 Jun 2024 08:55:41 +0000 (+0200) Subject: rs6000: Properly default-disable late-combine passes [PR106594, PR115622, PR115633] X-Git-Tag: basepoints/gcc-16~7946 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70480055636c2ca79761cb4440e930daa16bb7aa;p=thirdparty%2Fgcc.git rs6000: Properly default-disable late-combine passes [PR106594, PR115622, PR115633] ..., so that it also works for '__attribute__ ((optimize("[...]")))' etc. PR target/106594 PR target/115622 PR target/115633 gcc/ * config/rs6000/rs6000.cc (rs6000_option_override_internal): Move default-disable of late-combine passes from here... (rs6000_override_options_after_change): ... to here. --- diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index cd14e5a34ed..71fe31297cf 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -3434,6 +3434,14 @@ rs6000_override_options_after_change (void) /* If we are inserting ROP-protect instructions, disable shrink wrap. */ if (rs6000_rop_protect) flag_shrink_wrap = 0; + + /* One of the late-combine passes runs after register allocation + and can match define_insn_and_splits that were previously used + only before register allocation. Some of those define_insn_and_splits + use gen_reg_rtx unconditionally. Disable late-combine by default + until the define_insn_and_splits are fixed. */ + if (!OPTION_SET_P (flag_late_combine_instructions)) + flag_late_combine_instructions = 0; } #ifdef TARGET_USES_LINUX64_OPT @@ -4771,14 +4779,6 @@ rs6000_option_override_internal (bool global_init_p) targetm.expand_builtin_va_start = NULL; } - /* One of the late-combine passes runs after register allocation - and can match define_insn_and_splits that were previously used - only before register allocation. Some of those define_insn_and_splits - use gen_reg_rtx unconditionally. Disable late-combine by default - until the define_insn_and_splits are fixed. */ - if (!OPTION_SET_P (flag_late_combine_instructions)) - flag_late_combine_instructions = 0; - rs6000_override_options_after_change (); /* If not explicitly specified via option, decide whether to generate indexed