]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Fix restore_stack_nonlocal expander [PR96536].
authorUros Bizjak <ubizjak@gmail.com>
Tue, 18 Aug 2020 15:34:37 +0000 (17:34 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Tue, 18 Aug 2020 15:36:20 +0000 (17:36 +0200)
-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  <ubizjak@gmail.com>

gcc/ChangeLog:

PR target/96536
* config/i386/i386.md (restore_stack_nonlocal):
Add missing compare RTX.

gcc/config/i386/i386.md

index 292de142e903ed9c91e31c3213d6eabf7d803f31..44dbb79d008f71f6f0eb705d4cf41271ef886452 100644 (file)
       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),