re PR target/52129 (wrong code to pass parameters to tail call function)
PR target/52129 * calls.c (mem_overlaps_already_clobbered_arg_p): If val is CONST_INT_P, subtract resp. add crtl->args.pretend_args_size to it. * gcc.c-torture/execute/pr52129.c: New test. From-SVN: r183933
This commit is contained in:
parent
93286335bb
commit
2c8b5d61bc
@ -1,3 +1,9 @@
|
||||
2012-02-06 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/52129
|
||||
* calls.c (mem_overlaps_already_clobbered_arg_p): If val is
|
||||
CONST_INT_P, subtract resp. add crtl->args.pretend_args_size to it.
|
||||
|
||||
2012-02-06 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR c++/48680
|
||||
|
@ -1808,6 +1808,11 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size)
|
||||
return true;
|
||||
else
|
||||
i = INTVAL (val);
|
||||
#ifdef STACK_GROWS_DOWNWARD
|
||||
i -= crtl->args.pretend_args_size;
|
||||
#else
|
||||
i += crtl->args.pretend_args_size;
|
||||
#endif
|
||||
|
||||
#ifdef ARGS_GROW_DOWNWARD
|
||||
i = -i - size;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2012-02-06 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/52129
|
||||
* gcc.c-torture/execute/pr52129.c: New test.
|
||||
|
||||
2012-02-06 Andrey Belevantsev <abel@ispras.ru>
|
||||
|
||||
* gcc.dg/pr48374.c: Actually add the test I forgot
|
||||
|
28
gcc/testsuite/gcc.c-torture/execute/pr52129.c
Normal file
28
gcc/testsuite/gcc.c-torture/execute/pr52129.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* PR target/52129 */
|
||||
|
||||
extern void abort (void);
|
||||
struct S { void *p; unsigned int q; };
|
||||
struct T { char a[64]; char b[64]; } t;
|
||||
|
||||
__attribute__((noinline, noclone)) int
|
||||
foo (void *x, struct S s, void *y, void *z)
|
||||
{
|
||||
if (x != &t.a[2] || s.p != &t.b[5] || s.q != 27 || y != &t.a[17] || z != &t.b[17])
|
||||
abort ();
|
||||
return 29;
|
||||
}
|
||||
|
||||
__attribute__((noinline, noclone)) int
|
||||
bar (void *x, void *y, void *z, struct S s, int t, struct T *u)
|
||||
{
|
||||
return foo (x, s, &u->a[t], &u->b[t]);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct S s = { &t.b[5], 27 };
|
||||
if (bar (&t.a[2], (void *) 0, (void *) 0, s, 17, &t) != 29)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user