summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-15 22:58:21 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-15 22:58:21 +0000
commit392a7dd5052ad49c74fad8cb393adf6b743a708e (patch)
treeb35bb3a85e5aec4da27a655e309cea9f2dfabc15 /gcc
parent8aaf42236e396c5e927b071bc5647dd9c06e33aa (diff)
downloadgcc-392a7dd5052ad49c74fad8cb393adf6b743a708e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/pr55940.c54
4 files changed, 69 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 02b41f76194..e9220f5f8c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
diff --git a/gcc/function.c b/gcc/function.c
index 37ac7d2c0d6..bb6a9ae9979 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5ad1cef4679..6c6f0b40c74 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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>
diff --git a/gcc/testsuite/gcc.dg/pr55940.c b/gcc/testsuite/gcc.dg/pr55940.c
new file mode 100644
index 00000000000..d046d0b6912
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55940.c
@@ -0,0 +1,54 @@
+/* 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;
+}