aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2012-07-06 11:07:37 +0000
committerTom de Vries <vries@gcc.gnu.org>2012-07-06 11:07:37 +0000
commit6cf5e1d0514b6bba0e3b5d59b440dd7a451e6d1f (patch)
tree571bd385bc5c3ac317ef32f8e5eef196b24a6856
parent4ec0a1988872cd6c9912ca941733f4df49cb2020 (diff)
downloadgcc-6cf5e1d0514b6bba0e3b5d59b440dd7a451e6d1f.zip
gcc-6cf5e1d0514b6bba0e3b5d59b440dd7a451e6d1f.tar.gz
gcc-6cf5e1d0514b6bba0e3b5d59b440dd7a451e6d1f.tar.bz2
re PR tree-optimization/52009 (Another missed tail merging opportunity)
2012-07-06 Tom de Vries <tom@codesourcery.com> PR tree-optimization/52009 * gcc.dg/pr51879-7.c: New test. * gcc.dg/pr51879-18.c: New test. From-SVN: r189322
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr51879-18.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr51879-7.c18
3 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a3c9f61..ab552be 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-06 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/52009
+ * gcc.dg/pr51879-7.c: New test.
+ * gcc.dg/pr51879-18.c: New test.
+
2012-07-05 Jason Merrill <jason@redhat.com>
PR c++/50852
diff --git a/gcc/testsuite/gcc.dg/pr51879-18.c b/gcc/testsuite/gcc.dg/pr51879-18.c
new file mode 100644
index 0000000..95629f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr51879-18.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre -fno-tree-copy-prop -fno-tree-dominator-opts -fno-tree-copyrename" } */
+
+extern int foo (void);
+
+void bar (int c, int *p)
+{
+ int *q = p;
+
+ if (c)
+ *p = foo ();
+ else
+ *q = foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr51879-7.c b/gcc/testsuite/gcc.dg/pr51879-7.c
new file mode 100644
index 0000000..6c1d320
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr51879-7.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+
+int z;
+
+void
+foo (int y)
+{
+ if (y == 6)
+ z = 5;
+ else
+ z = 5;
+}
+
+/* { dg-final { scan-tree-dump-times "z = 5" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */