aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr54921.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-11-20 09:34:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-11-20 09:34:43 +0100
commit40155239d684ae96712d34f3f4dcc88eef4fc99d (patch)
treeb8e399f48378d1d27ec4ce799592476990e6187c /gcc/testsuite/gcc.dg/pr54921.c
parent4ced1d6de8b7ad914c4ea6fdb3121487d298c9e0 (diff)
downloadgcc-40155239d684ae96712d34f3f4dcc88eef4fc99d.zip
gcc-40155239d684ae96712d34f3f4dcc88eef4fc99d.tar.gz
gcc-40155239d684ae96712d34f3f4dcc88eef4fc99d.tar.bz2
re PR middle-end/54921 (wrong code with -Os -fno-omit-frame-pointer -fsched2-use-superblocks -fstack-protector -ftree-slp-vectorize)
PR rtl-optimization/54921 * cselib.h (fp_setter_insn): New prototype. * cselib.c (fp_setter_insn): New function. (cselib_process_insn): If frame_pointer_needed, call cselib_invalidate_rtx (stack_pointer_rtx) after processing a frame pointer setter. * var-tracking.c (fp_setter): Removed. (vt_initialize): Use fp_setter_insn instead of fp_setter. * gcc.dg/pr54921.c: New test. From-SVN: r193647
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr54921.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr54921.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr54921.c b/gcc/testsuite/gcc.dg/pr54921.c
new file mode 100644
index 0000000..897877a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr54921.c
@@ -0,0 +1,32 @@
+/* PR rtl-optimization/54921 */
+/* { dg-do run } */
+/* { dg-options "-Os -fno-omit-frame-pointer -fsched2-use-superblocks -ftree-slp-vectorize" } */
+/* { dg-additional-options "-fstack-protector" { target fstack_protector } } */
+
+struct A
+{
+ int a;
+ char b[32];
+} a, b;
+
+__attribute__((noinline, noclone))
+struct A
+bar (int x)
+{
+ struct A r;
+ static int n;
+ r.a = ++n;
+ __builtin_memset (r.b, 0, sizeof (r.b));
+ r.b[0] = x;
+ return r;
+}
+
+int
+main ()
+{
+ a = bar (3);
+ b = bar (4);
+ if (a.a != 1 || a.b[0] != 3 || b.a != 2 || b.b[0] != 4)
+ __builtin_abort ();
+ return 0;
+}