diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 3ea2439526b..ea3cfcce82e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -20415,11 +20415,19 @@ (define_expand "sibcall" DONE; }) -(define_insn "*call" +(define_subst_attr "kcfi" "kcfi_subst" "" "_kcfi") + +(define_subst "kcfi_subst" + [(match_operand 0)] + "" + [(kcfi (match_dup 0) + (match_operand 2 "const_int_operand"))]) + +(define_insn "*call" [(call (mem:QI (match_operand:W 0 "call_insn_operand" "BwBz")) (match_operand 1))] "!SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[0]);" + "* return ix86_output_call_insn (insn, operands);" [(set_attr "type" "call")]) ;; This covers both call and sibcall since only GOT slot is allowed. @@ -20613,12 +20621,22 @@ (define_expand "sibcall_value" DONE; }) -(define_insn "*call_value" +(define_subst_attr "kcfiv" "kcfiv_subst" "" "_kcfiv") + +(define_subst "kcfiv_subst" + [(set (match_operand 0) + (match_operand 1))] + "" + [(set (match_dup 0) + (kcfi (match_dup 1) + (match_operand 3 "const_int_operand")))]) + +(define_insn "*call_value" [(set (match_operand 0) (call (mem:QI (match_operand:W 1 "call_insn_operand" "BwBz")) (match_operand 2)))] "!SIBLING_CALL_P (insn)" - "* return ix86_output_call_insn (insn, operands[1]);" + "* return ix86_output_call_insn (insn, &operands[1]);" [(set_attr "type" "callv")]) ;; This covers both call and sibcall since only GOT slot is allowed.