Skip to content

Commit c1729df

Browse files
committed
final: Fix get_attr_length for asm goto [PR118411]
The problem is for inline-asm goto, the outer rtl insn type is a jump_insn and get_attr_length does not handle ASM specially unlike if the outer rtl insn type was just insn. This fixes the issue by adding support for both CALL_INSN and JUMP_INSN with asm. OK? Bootstrapped and tested on x86_64-linux-gnu. PR middle-end/118411 gcc/ChangeLog: * final.cc (get_attr_length_1): Handle asm for CALL_INSN and JUMP_INSNs. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
1 parent 550f1a4 commit c1729df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gcc/final.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ get_attr_length_1 (rtx_insn *insn, int (*fallback_fn) (rtx_insn *))
363363

364364
case CALL_INSN:
365365
case JUMP_INSN:
366-
length = fallback_fn (insn);
366+
body = PATTERN (insn);
367+
if (GET_CODE (body) == ASM_INPUT || asm_noperands (body) >= 0)
368+
length = asm_insn_count (body) * fallback_fn (insn);
369+
else
370+
length = fallback_fn (insn);
367371
break;
368372

369373
case INSN:

0 commit comments

Comments
 (0)