diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
commit | 82711f6567ef069eebb942e382e2c3fa61fbf538 (patch) | |
tree | 22200b7326b32ca672ffb6e4ce6d19a09dc476e5 /gcc48-rh1469697-20.patch | |
parent | 5d624aa0d36abe76a344f0593eae5cf36d083b15 (diff) |
automatic import of compat-libgfortran-48openeuler24.03_LTSopeneuler23.09
Diffstat (limited to 'gcc48-rh1469697-20.patch')
-rw-r--r-- | gcc48-rh1469697-20.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc48-rh1469697-20.patch b/gcc48-rh1469697-20.patch new file mode 100644 index 0000000..ad82c9b --- /dev/null +++ b/gcc48-rh1469697-20.patch @@ -0,0 +1,37 @@ + + * explow.c (anti_adjust_stack_and_probe_stack_clash): Avoid probing + the red zone for stack_clash_protection_final_dynamic_probe targets + when the total dynamic stack size is zero bytes. + +diff -Nrup a/gcc/explow.c b/gcc/explow.c +--- a/gcc/explow.c 2017-11-14 23:33:15.403557607 -0700 ++++ b/gcc/explow.c 2017-11-14 23:33:56.243239120 -0700 +@@ -1934,6 +1934,13 @@ anti_adjust_stack_and_probe_stack_clash + if (size != CONST0_RTX (Pmode) + && targetm.stack_clash_protection_final_dynamic_probe (residual)) + { ++ /* SIZE could be zero at runtime and in that case *sp could hold ++ live data. Furthermore, we don't want to probe into the red ++ zone. ++ ++ Go ahead and just guard a probe at *sp on SIZE != 0 at runtime ++ if SIZE is not a compile time constant. */ ++ + /* Ideally we would just probe at *sp. However, if SIZE is not + a compile-time constant, but is zero at runtime, then *sp + might hold live data. So probe at *sp if we know that +@@ -1946,9 +1953,12 @@ anti_adjust_stack_and_probe_stack_clash + } + else + { +- emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, +- -GET_MODE_SIZE (word_mode))); ++ rtx label = gen_label_rtx (); ++ emit_cmp_and_jump_insns (size, CONST0_RTX (GET_MODE (size)), ++ EQ, NULL_RTX, Pmode, 1, label); ++ emit_stack_probe (stack_pointer_rtx); + emit_insn (gen_blockage ()); ++ emit_label (label); + } + } + } |