From bf7b9330982165e051de0962c5bc231e2d1242d9 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 18 Aug 2020 19:48:51 +0200 Subject: [PATCH] i386: Fix restore_stack_nonlocal expander [PR96536]. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit -fcf-protection code in restore_stack_nonlocal uses a branch based on a clobber result. The patch adds missing compare. 2020-08-18 Uroš Bizjak gcc/ChangeLog: PR target/96536 * config/i386/i386.md (restore_stack_nonlocal): Add missing compare RTX. --- gcc/config/i386/i386.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2bb58236d88d..11d69e997bbd 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -18596,8 +18596,11 @@ emit_insn (tmp); /* Compare and jump over adjustment code. */ - noadj_label = gen_label_rtx (); + tmp = gen_rtx_COMPARE (CCZmode, reg_ssp, const0_rtx); flags = gen_rtx_REG (CCZmode, FLAGS_REG); + emit_insn (gen_rtx_SET (flags, tmp)); + + noadj_label = gen_label_rtx (); tmp = gen_rtx_EQ (VOIDmode, flags, const0_rtx); tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, gen_rtx_LABEL_REF (VOIDmode, noadj_label), -- 2.43.5