[Bug target/120250] [13/14 Regression] ICE during RTL pass: dwarf2, in create_trace_edges, at dwarf2cfi.cc:2686 since r12-4475
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 15 06:05:46 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120250
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:5ac1f9e891f8164f19caee35213e6573096c9ec2
commit r14-12389-g5ac1f9e891f8164f19caee35213e6573096c9ec2
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Jan 14 15:53:44 2026 +0100
combine: Partially revert the r12-4475 changes [PR120250]
The r12-4475 change added extra code to recog_for_combine to attempt to
force some constants into the constant pool.
Unfortunately, as this (UB at runtime) testcase shows, such changes are
harmful for computed_jump_p jumps. The computed_jump_p returns false
for loads from constant pool MEMs:
case MEM:
return ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)));
and so if we try to optimize a computed jump that way, it becomes
a non-computed jump which doesn't match any other jump category
(simplejump_p, tablejump_p, condjump_p, returnjump_p, eh_returnjump_p,
asm goto) and doesn't have any label recorded in JUMP_LABEL (because,
it doesn't really jump to any LABEL), so some passes like dwarf2cfi
can get confused about it and ICE.
The following patch just prevents that, by only doing the r12-4475
changes if it is not a jump.
2026-01-14 Jakub Jelinek <jakub@redhat.com>
PR target/120250
* combine.cc (recog_for_combine): Don't try to put SET_SRC
into a constant pool if SET_DEST is pc_rtx.
* gcc.c-torture/compile/pr120250.c: New test.
(cherry picked from commit fc2ee2f20c7f0b4439094435966a12eeead7197b)
More information about the Gcc-bugs
mailing list