i386.md (allocate_stack_worker_64): Make sure argument operand in rax isn't removed.

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
This commit is contained in:
Kai Tietz 2008-05-26 13:17:43 +00:00 committed by Kai Tietz
parent c878b2efd6
commit e5f005e18c
4 changed files with 35 additions and 1 deletions

View 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

View File

@ -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))

View 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

View File

@ -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;
}