Commit 305e3ac1 by Jakub Jelinek

re PR target/55940 (Incorrect code for accessing parameters with 32-bit Intel hosts)

	PR target/55940
	* function.c (thread_prologue_and_epilogue_insns): Always
	add crtl->drap_reg to set_up_by_prologue.set, even if
	stack_realign_drap is false.

	* gcc.dg/pr55940.c: New test.

From-SVN: r195220
parent f78ac4f2
2013-01-15 Jakub Jelinek <jakub@redhat.com>
PR target/55940
* function.c (thread_prologue_and_epilogue_insns): Always
add crtl->drap_reg to set_up_by_prologue.set, even if
stack_realign_drap is false.
2013-01-15 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* config/vax/vax.md (add<mode>3, sub<mode>3, mul<mode>3, div<mode>3,
......@@ -12,7 +19,7 @@
2013-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/pr55153
PR rtl-optimization/55153
* sched-deps.c (sched_analyze_2): Add pending reads for prefetch.
2013-01-15 Martin Jambor <mjambor@suse.cz>
......
......@@ -6029,7 +6029,7 @@ thread_prologue_and_epilogue_insns (void)
if (pic_offset_table_rtx)
add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
PIC_OFFSET_TABLE_REGNUM);
if (stack_realign_drap && crtl->drap_reg)
if (crtl->drap_reg)
add_to_hard_reg_set (&set_up_by_prologue.set,
GET_MODE (crtl->drap_reg),
REGNO (crtl->drap_reg));
......
2013-01-15 Jakub Jelinek <jakub@redhat.com>
PR target/55940
* gcc.dg/pr55940.c: New test.
2013-01-15 Manfred Schwarb <manfred99@gmx.ch>
Harald Anlauf <anlauf@gmx.de>
......@@ -18,7 +23,7 @@
2013-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/pr55153
PR rtl-optimization/55153
* gcc.dg/pr55153.c: New.
2013-01-15 Jakub Jelinek <jakub@redhat.com>
......
/* PR target/55940 */
/* { dg-do run } */
/* { dg-options "-Os" } */
/* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
struct S { int s; unsigned long t; };
__attribute__ ((noinline, noclone)) unsigned long long
bar (struct S *x, unsigned long y)
{
asm volatile ("" : : "r" (x), "r" (y) : "memory");
return x->s + y;
}
__attribute__ ((noinline, noclone)) unsigned long long
foo (struct S *x, unsigned long y)
{
unsigned long a;
if (__builtin_expect (((__UINTPTR_TYPE__) (x) + 0x1000U < 0x2000U), 0))
return ~0ULL;
if (__builtin_expect (x->s <= 0 || x->s > 9, 0))
return ~0ULL;
a = x->t >> 12;
if (y == a)
return ~0ULL;
if (x->s == 3)
return x->t + y * 4096;
return bar (x, y);
}
int va, vb, vc, vd;
int
main ()
{
struct S s;
asm volatile ("" : : : "memory");
int a = va, b = vb, c = vc, d = vd;
asm volatile ("" : : : "memory");
int i;
for (i = 0; i < 64; i++)
if (foo ((struct S *) 0, 0) != ~0ULL)
__builtin_abort ();
s.s = 3;
s.t = 2 << 12;
if (foo (&s, 2) != ~0ULL)
__builtin_abort ();
if (foo (&s, 3) != (2 << 12) + 3 * 4096)
__builtin_abort ();
asm volatile ("" : : : "memory");
va = a; vb = b; vc = c; vd = d;
asm volatile ("" : : : "memory");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment