@rearnsha wrote in https://forge.sourceware.org/gcc/gcc/pulls/198#issuecomment-6816:
> commit [`62082d278d`](/gcc/gcc/commit/62082d278d) suggests that this is > expected to work as is for any target that has movw/movt. So has this > regressed at some point? Or are there some CPU/arch options that are still > causing this to fail. I wonder if this is a costing issue somewhere, but I'm > missing the details of which targets are causing problems. I don't think it ever worked across all targets. When you did that change, I think it only worked for Cortex-A. Below are the different target flags that I use and the resulting RTL. I copied the content from https://gcc.gnu.org/pipermail/gcc-patches/2026-April/711963.html, so the RTL might be different with HEAD compared to r16-8253-geb50d28a9353e9 that was used to produce these. thumb/arch=armv7ve+nofp/tune=cortex-a7/float-abi=soft/fpu=auto ``` ;; Function x (x, funcdef_no=0, decl_uid=4706, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 3 NOTE_INSN_DELETED) (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG) (insn 5 2 6 2 (set (reg/v:SI 94 [ d ]) (const_int 19294 [0x4b5e])) -1 (nil)) (insn 6 5 0 2 (set (zero_extract:SI (reg/v:SI 94 [ d ]) (const_int 16 [0x10]) (const_int 16 [0x10])) (const_int 51154 [0xc7d2])) -1 (expr_list:REG_EQUAL (const_int -942519458 [0xffffffffc7d24b5e]) (nil))) ``` --- thumb/arch=armv7ve+neon/tune=cortex-a7/float-abi=hard/fpu=auto ``` ;; Function x (x, funcdef_no=0, decl_uid=7770, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 3 NOTE_INSN_DELETED) (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG) (insn 5 2 6 2 (set (reg/v:SI 94 [ d ]) (const_int 19294 [0x4b5e])) -1 (nil)) (insn 6 5 0 2 (set (zero_extract:SI (reg/v:SI 94 [ d ]) (const_int 16 [0x10]) (const_int 16 [0x10])) (const_int 51154 [0xc7d2])) -1 (expr_list:REG_EQUAL (const_int -942519458 [0xffffffffc7d24b5e]) (nil))) ``` --- thumb/arch=armv7e-m+fp/tune=cortex-m4/float-abi=hard/fpu=auto thumb/arch=armv7e-m+fp.dp/tune=cortex-m7/float-abi=hard/fpu=auto thumb/arch=armv8-m.main+dsp+fp/tune=cortex-m33/float-abi=hard/fpu=auto ``` ;; Function x (x, funcdef_no=0, decl_uid=7770, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 3 NOTE_INSN_DELETED) (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG) (insn 5 2 0 2 (set (reg/v:SI 94 [ d ]) (const_int -942519458 [0xffffffffc7d24b5e])) -1 (nil)) ``` --- thumb/arch=armv6s-m/tune=cortex-m0/float-abi=soft/fpu=auto (unsupported by { ! { arm_thumb2_ok || arm_thumb1_movt_ok } }, but included anyway for completeness) ``` thumb/arch=armv7-m/tune=cortex-m3/float-abi=soft/fpu=auto thumb/arch=armv7e-m+nofp/tune=cortex-m4/float-abi=soft/fpu=auto thumb/arch=armv7e-m+nofp/tune=cortex-m7/float-abi=soft/fpu=auto thumb/arch=armv8-m.main+dsp+nofp/tune=cortex-m33/float-abi=soft/fpu=auto thumb/arch=armv8.1-m.main+mve+nofp/tune=cortex-m55/float-abi=soft/fpu=auto thumb/arch=armv8.1-m.main+mve+pacbti+nofp/tune=cortex-m85/float-abi=soft/fpu=auto ;; Function x (x, funcdef_no=0, decl_uid=4706, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 3 NOTE_INSN_DELETED) (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG) (insn 5 2 0 2 (set (reg/v:SI 94 [ d ]) (const_int -942519458 [0xffffffffc7d24b5e])) -1 (nil)) ``` --- thumb/arch=armv8.1-m.main+mve.fp+fp.dp/tune=cortex-m55/float-abi=hard/fpu=auto thumb/arch=armv8.1-m.main+mve.fp+pacbti+fp.dp/tune=cortex-m85/float-abi=hard/fpu=auto ``` ;; Function x (x, funcdef_no=0, decl_uid=7944, cgraph_uid=1, symbol_order=0) ;; Generating RTL for gimple basic block 2 try_optimize_cfg iteration 1 Merging block 3 into block 2... Merged blocks 2 and 3. Merged 2 and 3 without moving. Merging block 4 into block 2... Merged blocks 2 and 4. Merged 2 and 4 without moving. try_optimize_cfg iteration 2 ;; ;; Full RTL generated for this function: ;; (note 1 0 3 NOTE_INSN_DELETED) (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG) (insn 5 2 0 2 (set (reg/v:SI 94 [ d ]) (const_int -942519458 [0xffffffffc7d24b5e])) -1 (nil)) ``` -- https://forge.sourceware.org/gcc/gcc/pulls/198#issuecomment-6830
