From 932bc229c13a852160df830e77bb2bf56eb612d9 Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 22 Sep 2025 19:04:00 +0000 Subject: [PATCH] Revert 1.14 and disable delayed branch optimization while reenabling basic block reordering. Basic block span computation has been fixed, hopefully for good, in m88k.md rev 1.16. The delayed branch optimization is unfortunately still corrupting register values by moving instructions which shouldn't, in complex enough code. Even though the gcc testsuite passes, including the few tests which exercize this, in gcc's own tree-cfg.c, the combination of the inlining of update_modified_stmts() and delayed branching creates a code path where the argument of one update_stmt_operands() call (via update_stmt_is_modified()) is overwritten with a load of the (declared noreturn, and it matters) fancy_abort() message in the stmt_ann() diagnostic. This can be reduced to a 127 line testcase, which will hopefully let me cut my teeth further on this. In the meantime, disabling this optimization allows gcc 4 to be self-hosting again on m88k. --- gnu/gcc/gcc/config/m88k/m88k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/gcc/gcc/config/m88k/m88k.c b/gnu/gcc/gcc/config/m88k/m88k.c index 2e6406bab3d..e62de267f6d 100644 --- a/gnu/gcc/gcc/config/m88k/m88k.c +++ b/gnu/gcc/gcc/config/m88k/m88k.c @@ -2583,8 +2583,8 @@ m88k_override_options (void) if (align_functions == 0) align_functions = TARGET_88100 ? 16 : 8; - /* XXX -freorder-blocks (enabled at -O2) does not work reliably yet. */ - flag_reorder_blocks = flag_reorder_blocks_and_partition = 0; + /* XXX -fdelayed-branch (enabled at -O2) does not work reliably yet. */ + flag_delayed_branch = 0; init_machine_status = m88k_init_machine_status; }