diff options
author | Segher Boessenkool <segher@gcc.gnu.org> | 2017-10-31 10:49:40 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-10-31 10:49:40 +0100 |
commit | c705e5a3f446c1885f402514a2944cbd5e2e2ea6 (patch) | |
tree | e9ba463fa2ae590d8febf99cc0f04f5caffacaf0 /gcc | |
parent | 4db58158cc5df72324299dd5ef0ac09f6497ccb6 (diff) | |
download | gcc-c705e5a3f446c1885f402514a2944cbd5e2e2ea6.zip gcc-c705e5a3f446c1885f402514a2944cbd5e2e2ea6.tar.gz gcc-c705e5a3f446c1885f402514a2944cbd5e2e2ea6.tar.bz2 |
Subject: [PATCH] rs6000: Fix crash with big stack clash interval (PR82674)
If the user asks for a stack clash probe interval of 64kB, we currently
generate a "stdu rX,-65536(r1)" instruction. That instruction does not
exist (the offset is a 16-bit signed number). If the offset is too big
we should force it into a register and generate a "stdux rX,rY,r1"
instruction, instead.
PR target/82674
* config/rs6000/rs6000.md (allocate_stack): Force update interval
into a register if it does not fit into an immediate offset field.
From-SVN: r254252
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 363922b..4216b94 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,14 @@ +2017-10-31 Segher Boessenkool <segher@kernel.crsahing.org> + + PR target/82674 + * config/rs6000/rs6000.md (allocate_stack): Force update interval + into a register if it does not fit into an immediate offset field. + 2017-10-31 Olivier Hainque <hainque@adacore.com> * gcc/Makefile.in (FLAGS_TO_PASS): Pass libsubdir as well. -2017-11-01 Julia Koval <julia.koval@intel.com> +2017-10-31 Julia Koval <julia.koval@intel.com> * config.gcc: Add gfniintrin.h. * config/i386/gfniintrin.h: New. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 62bd19b..18ebe8f 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10333,6 +10333,9 @@ { rtx loop_lab, end_loop; bool rotated = CONST_INT_P (rounded_size); + rtx update = GEN_INT (-probe_interval); + if (probe_interval > 32768) + update = force_reg (Pmode, update); emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, last_addr, rotated); @@ -10340,13 +10343,11 @@ if (Pmode == SImode) emit_insn (gen_movsi_update_stack (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-probe_interval), - chain)); + update, chain)); else emit_insn (gen_movdi_di_update_stack (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-probe_interval), - chain)); + update, chain)); emit_stack_clash_protection_probe_loop_end (loop_lab, end_loop, last_addr, rotated); } |