From: Kai Tietz Date: Mon, 26 May 2008 13:17:43 +0000 (+0000) Subject: i386.md (allocate_stack_worker_64): Make sure argument operand in rax isn't removed. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5f005e18cf7763078e93e3da1747cb3c964b0b3;p=gcc.git i386.md (allocate_stack_worker_64): Make sure argument operand in rax isn't removed. 2008-05-26 Kai Tietz PR/36321 * config/i386/i386.md (allocate_stack_worker_64): Make sure argument operand in rax isn't removed. 2008-05-26 Kai Tietz * gcc-c.torture/execute/pr36321.c: New. From-SVN: r135921 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25f86bcd988..f12440f1afe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-26 Kai Tietz + + PR/36321 + * config/i386/i386.md (allocate_stack_worker_64): Make sure + argument operand in rax isn't removed. + 2008-05-26 Richard Guenther PR middle-end/36300 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index fa1bff74de1..885077d02b2 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -19707,7 +19707,7 @@ (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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 867b297b49a..156ea63a396 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-05-26 Kai Tietz + + * gcc-c.torture/execute/pr36321.c: New. + 2008-05-26 Richard Guenther 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 index 00000000000..37d64f3d8be --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr36321.c @@ -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; +} +