From: Uros Bizjak Date: Tue, 18 Aug 2020 15:34:37 +0000 (+0200) Subject: i386: Fix restore_stack_nonlocal expander [PR96536]. X-Git-Tag: releases/gcc-10.3.0~1026 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6342cee8801f191466b71116d004e8ccb812caaa;p=thirdparty%2Fgcc.git i386: Fix restore_stack_nonlocal expander [PR96536]. -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. --- diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 292de142e903..44dbb79d008f 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -18696,8 +18696,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),