aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2005-08-09 03:28:38 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-08-09 03:28:38 +0000
commit2ef571e2c282999a7c3f46e6a0b85a1a46500135 (patch)
treee06f14d183b255d4bb3d257328e666b13eec089a /gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
parent3d092c45bf57b3f9df0892e8d95a6284106a86c2 (diff)
downloadgcc-2ef571e2c282999a7c3f46e6a0b85a1a46500135.zip
gcc-2ef571e2c282999a7c3f46e6a0b85a1a46500135.tar.gz
gcc-2ef571e2c282999a7c3f46e6a0b85a1a46500135.tar.bz2
re PR tree-optimization/23234 (ICE in verify_flow_info())
gcc/ PR tree-optimization/23234 * tree-ssa-math-opts.c (place_reciprocal): New enum. (execute_cse_reciprocals_1): Replace the 'phi' argument with an argument of the new enum. (execute_cse_reciprocals): Add reciprocals for function arguments on the unique successor edge of the entry block. Update other calls to execute_cse_reciprocals_1. testsuite/ PR tree-optimization/23234 * gcc.dg/tree-ssa/pr23234.c: New test. From-SVN: r102895
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr23234.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr23234.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
new file mode 100644
index 0000000..bd0b62b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
@@ -0,0 +1,52 @@
+/* The problem in this PR was mostly finding a suitable place to insert
+ the reciprocals of the function arguments. This test case tries to
+ test three possible ways of how this may go wrong. */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-do compile } */
+
+/* The original test case. */
+double
+f1 (double a, double b, double c)
+{
+ double y0;
+
+ if (a == 0.0)
+ {
+ y0 = -c / b;
+ return y0;
+ }
+ y0 = c / b;
+ return y0;
+}
+
+/* Labels may end up in the middle of a block. Also bad. */
+double
+f2 (double a, double b, double c)
+{
+ double y0;
+
+a_label:
+another_label:
+ if (a == 0.0)
+ {
+ y0 = -c / b;
+ return y0;
+ }
+ y0 = c / b;
+ return y0;
+}
+
+/* Uses must still be dominated by their defs. */
+double
+f3 (double a, double b, double c)
+{
+ double y0;
+
+ y0 = -c / b;
+ if (a == 0.0)
+ {
+ return y0;
+ }
+ y0 = c / b;
+ return y0;
+}