]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/32163 (Compiling with stack protector causes reigster spill failure)
authorKaz Kojima <kkojima@gcc.gnu.org>
Fri, 8 Jun 2007 05:56:28 +0000 (05:56 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Fri, 8 Jun 2007 05:56:28 +0000 (05:56 +0000)
PR target/32163
Backport from mainline.
* config/sh/sh.md (symGOT_load): Don't schedule insns when
the symbol is generated with the stack protector.

From-SVN: r125559

gcc/ChangeLog
gcc/config/sh/sh.md

index 7abb4246f5cea68dff789c8680ace153941788b1..b8a9a69c5d3fcfbf1589bf4c3788f46ba940c481 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-08  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/32163
+       Backport from mainline.
+       * config/sh/sh.md (symGOT_load): Don't schedule insns when
+       the symbol is generated with the stack protector.
+
 2007-05-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        Backport from mainline:
index 13ed3845cbe07717a0497f92341f5a64e8e0bd6b..e136761ae89a8e2cca65fa71de051057eb1e8fb1 100644 (file)
@@ -8287,6 +8287,20 @@ label:
                                             operands[2],
                                             gen_rtx_REG (Pmode, PIC_REG)));
 
+  /* When stack protector inserts codes after the result is set to
+     R0, @(rX, r12) will cause a spill failure for R0.  Don't schedule
+     insns to avoid combining (set A (plus rX r12)) and (set op0 (mem A))
+     when rX is a GOT address for the guard symbol.  Ugly but doesn't
+     matter because this is a rare situation.  */
+  if (!TARGET_SHMEDIA
+      && flag_stack_protect
+      && GET_CODE (operands[1]) == CONST
+      && GET_CODE (XEXP (operands[1], 0)) == UNSPEC
+      && GET_CODE (XVECEXP (XEXP (operands[1], 0), 0, 0)) == SYMBOL_REF
+      && strcmp (XSTR (XVECEXP (XEXP (operands[1], 0), 0, 0), 0),
+                \"__stack_chk_guard\") == 0)
+    emit_insn (gen_blockage ());
+
   /* N.B. This is not constant for a GOTPLT relocation.  */
   mem = gen_rtx_MEM (Pmode, operands[3]);
   MEM_NOTRAP_P (mem) = 1;