i386.md (allocate_stack_worker_64): Make sure argument operand in rax isn't removed.
authorKai Tietz <kai.tietz@onevision.com>
Mon, 26 May 2008 13:17:43 +0000 (13:17 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Mon, 26 May 2008 13:17:43 +0000 (15:17 +0200)
2008-05-26  Kai Tietz  <kai.tietz@onevision.com>

PR/36321
* config/i386/i386.md (allocate_stack_worker_64): Make sure argument operand in
rax isn't removed.

2008-05-26  Kai Tietz  <kai.tietz@onevision.com>

* gcc-c.torture/execute/pr36321.c: New.

From-SVN: r135921

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr36321.c [new file with mode: 0644]

index 25f86bcd988a8c834f27f155ee1659e1d09bef61..f12440f1afe82d6ad73d898666a7696538d62c69 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-26  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR/36321
+       * config/i386/i386.md (allocate_stack_worker_64): Make sure
+       argument operand in rax isn't removed.
+
 2008-05-26  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/36300
index fa1bff74de152719ed5bf4a80047f69bb42a17bf..885077d02b2eabc56ccb65a25b7196f7d9523915 100644 (file)
    (set_attr "length" "5")])
 
 (define_insn "allocate_stack_worker_64"
-  [(set (match_operand:DI 0 "register_operand" "=a")
+  [(set (match_operand:DI 0 "register_operand" "+a")
        (unspec_volatile:DI [(match_dup 0)] UNSPECV_STACK_PROBE))
    (set (reg:DI SP_REG) (minus:DI (reg:DI SP_REG) (match_dup 0)))
    (clobber (reg:DI R10_REG))
index 867b297b49a45abb05e1d9817136bf76ac21a89d..156ea63a396a8c541c5419c5b9335b86fc433fb0 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-26  Kai Tietz  <kai.tietz@onevision.com>
+
+       * gcc-c.torture/execute/pr36321.c: New.
+
 2008-05-26  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/36300
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36321.c b/gcc/testsuite/gcc.c-torture/execute/pr36321.c
new file mode 100644 (file)
index 0000000..37d64f3
--- /dev/null
@@ -0,0 +1,24 @@
+extern void abort (void);
+
+extern __SIZE_TYPE__ strlen (const char *);
+void foo(char *str)
+{
+  int len2 = strlen (str);
+  char *a = (char *) __builtin_alloca (0);
+  char *b = (char *) __builtin_alloca (len2*3);
+
+  if ((int) (a-b) < (len2*3))
+    {
+#ifdef _WIN32
+      abort ();
+#endif
+      return;
+    }
+}
+
+int main(int argc, char **argv)
+{
+  foo (argv[0]);
+  return 0;
+}
+