https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121269
Bug ID: 121269
Summary: [16 Regression] gcc.target/i386/asm-hard-reg-{1,2}.c
ICEs with RTL checking
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
In --enable-checking=yes,rtl,extra x86_64-linux as well as i686-linux builds I
see
FAIL: gcc.target/i386/asm-hard-reg-1.c (internal compiler error: RTL check:
expected elt 3 type 'e' or 'u', have '0' (rtx note) in PATTERN, at rtl.h:1523)
FAIL: gcc.target/i386/asm-hard-reg-2.c (internal compiler error: RTL check:
expected elt 3 type 'e' or 'u', have '0' (rtx note) in PATTERN, at rtl.h:1523)
(plus FAILs for messages the test expect).
The ICE is
0x2de0aff internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:534
0x8e5ba7 rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
../../gcc/rtl.cc:761
0x7e44e5 PATTERN(rtx_def*)
../../gcc/rtl.h:1523
0x1072632 PATTERN(rtx_def*)
../../gcc/recog.h:322
0x1072632 recog_memoized(rtx_insn*)
../../gcc/recog.h:323
0x1484ebc lra_set_insn_recog_data(rtx_insn*)
../../gcc/lra.cc:993
0x1487ea7 lra_get_insn_recog_data(rtx_insn*)
../../gcc/lra-int.h:519
0x1487ea7 lra_process_new_insns(rtx_insn*, rtx_insn*, rtx_insn*, char const*)
../../gcc/lra.cc:1937
0x149d379 curr_insn_transform
../../gcc/lra-constraints.cc:4956
0x149f106 lra_constraints(bool)
../../gcc/lra-constraints.cc:5584
0x1486964 lra(_IO_FILE*, int)
../../gcc/lra.cc:2455
0x142f0af do_reload
../../gcc/ira.cc:6068
0x142f0af execute
../../gcc/ira.cc:6256
lra_set_insn_recog_data is called on
(insn 92 91 95 2 (parallel [
(asm_operands/v ("") ("") 0 [
(reg:SI 217 [ x ])
(reg:SI 215 [ y ])
]
[
(asm_input:SI ("{rdx}") asm-hard-reg-1.c:55)
(asm_input:SI ("d") asm-hard-reg-1.c:55)
]
[] asm-hard-reg-1.c:55)
(clobber (reg:CC 17 flags))
]) "asm-hard-reg-1.c":55:3 -1
(expr_list:REG_DEAD (reg:SI 217 [ x ])
(expr_list:REG_DEAD (reg:SI 215 [ y ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))))
Then
#0 set_insn_deleted (insn=0x7fffe9f35500) at ../../gcc/emit-rtl.cc:4421
#1 0x0000000000ba99bb in lra_set_insn_deleted (insn=0x7fffe9f35500) at
../../gcc/lra.cc:264
#2 0x0000000000baa431 in lra_asm_insn_error (insn=0x7fffe9f35500) at
../../gcc/lra.cc:557
#3 0x0000000000bc4ac1 in curr_insn_transform (check_only_p=false) at
../../gcc/lra-constraints.cc:4932
#4 0x0000000000bc6814 in lra_constraints (first_p=false) at
../../gcc/lra-constraints.cc:5584
#5 0x0000000000baefef in lra (f=0x0, verbose=5) at ../../gcc/lra.cc:2455
#6 0x0000000000b571fa in do_reload () at ../../gcc/ira.cc:6068
turns it into
(note 92 2164 95 2 NOTE_INSN_DELETED)
and then lra_set_insn_recog_data is called on it again and ICEs due to
990 icode = INSN_CODE (insn);
991 if (icode < 0)
992 /* It might be a new simple insn which is not recognized yet.
*/
993 INSN_CODE (insn) = icode = recog_memoized (insn);
...
322 if (INSN_CODE (insn) < 0)
323 INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
While INSN_CODE on a NOTE doesn't ICE, PATTERN on NOTE ICEs.