aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-11-04 21:45:54 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-11-04 21:45:54 +0000
commit35a07c37da4317f4ca76816aea5b50c8a6342a34 (patch)
treed76b8acb8ed45a235ac63af18230066a7c748471
parent3e901069e7501dad4d7de5500d90835e7f6c217d (diff)
downloadgcc-35a07c37da4317f4ca76816aea5b50c8a6342a34.zip
gcc-35a07c37da4317f4ca76816aea5b50c8a6342a34.tar.gz
gcc-35a07c37da4317f4ca76816aea5b50c8a6342a34.tar.bz2
re PR target/10127 (-fstack-check let's program crash)
PR target/10127 PR ada/20548 * config/i386/i386.md (probe_stack_range): New expander. (logical operation peepholes): Do not split stack checking probes. From-SVN: r153918
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.md20
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/ada/acats/norun.lst8
-rwxr-xr-xgcc/testsuite/ada/acats/run_acats3
5 files changed, 34 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0ec0c60..0aed70c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/10127
+ PR ada/20548
+ * config/i386/i386.md (probe_stack_range): New expander.
+ (logical operation peepholes): Do not split stack checking probes.
+
2009-11-04 Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index c011d9b..82f5352 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -20023,6 +20023,18 @@
DONE;
})
+;; Use IOR for stack probes, this is shorter.
+(define_expand "probe_stack"
+ [(match_operand 0 "memory_operand" "")]
+ ""
+{
+ if (GET_MODE (operands[0]) == DImode)
+ emit_insn (gen_iordi3 (operands[0], operands[0], const0_rtx));
+ else
+ emit_insn (gen_iorsi3 (operands[0], operands[0], const0_rtx));
+ DONE;
+})
+
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]
"!TARGET_64BIT && flag_pic"
@@ -20526,7 +20538,9 @@
[(match_dup 0)
(match_operand:SI 1 "nonmemory_operand" "")]))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE
+ /* Do not split stack checking probes. */
+ && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 2) (match_dup 1)]))
@@ -20541,7 +20555,9 @@
[(match_operand:SI 1 "nonmemory_operand" "")
(match_dup 0)]))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE
+ /* Do not split stack checking probes. */
+ && GET_CODE (operands[3]) != IOR && operands[1] != const0_rtx"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3066e3d..5f63688f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/20548
+ * ada/acats/norun.lst: Remove the stack checking tests.
+ * ada/acats/run_acats: Limit the stack to 8MB.
+
2009-11-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/41556
diff --git a/gcc/testsuite/ada/acats/norun.lst b/gcc/testsuite/ada/acats/norun.lst
index 8441024..c0b08e4 100644
--- a/gcc/testsuite/ada/acats/norun.lst
+++ b/gcc/testsuite/ada/acats/norun.lst
@@ -1,10 +1,2 @@
-c52103x
-c52104x
-c52104y
-cb1010a
-cb1010c
-cb1010d
templat
# Tests must be sorted in alphabetical order
-# c52103x, c52104x, c52104y: -fstack-check doesn't work, PR middle-end/20548
-# cb1010a, cb1010c, cb1010d: likewise
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats
index 05f3ff5..acb6ab5 100755
--- a/gcc/testsuite/ada/acats/run_acats
+++ b/gcc/testsuite/ada/acats/run_acats
@@ -52,4 +52,7 @@ echo exec gnatmake '"$@"' >> host_gnatmake
chmod +x host_gnatmake
+# Limit the stack to 8MB for stack checking
+ulimit -s 8192
+
exec $testdir/run_all.sh ${1+"$@"}