From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c (limited to 'gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c') diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c new file mode 100644 index 000000000..7a930dd45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -ffinite-math-only -fdump-tree-phiopt1" } */ + +float repl1 (float varx) +{ + if (varx < 0.0) + return 0.0; + else if (varx > 1.0) + return 1.0; + else + return varx; +} + +/* Should be turned to + + varx_4 = MIN_EXPR <1.0e+0, varx_2>; + varx_5 = MAX_EXPR ; */ + +/* { dg-final { scan-tree-dump "varx.*MIN_EXPR.*1\\.0" "phiopt1"} } */ +/* { dg-final { scan-tree-dump "varx.*MAX_EXPR.*0\\.0" "phiopt1"} } */ + +float repl2 (float vary) +{ + if (vary > 1.0) + return 1.0; + else if (vary < 0.0) + return 0.0; + else + return vary; +} + +/* Should be turned to + + vary_4 = MAX_EXPR <0.0, vary_2>; + vary_5 = MIN_EXPR ; */ + +/* { dg-final { scan-tree-dump "vary.*MAX_EXPR.*0\\.0" "phiopt1"} } */ +/* { dg-final { scan-tree-dump "vary.*MIN_EXPR.*1\\.0" "phiopt1"} } */ + +float repl3 (float varz, float vara, float varb) +{ + if (varz > vara) + return vara; + else if (varz < varb) + return varb; + else + return varz; +} + +/* Should be turned to + + if (varz_2 > vara_3) goto ; else goto ; + +:; + vara_6 = MAX_EXPR ; */ + +/* { dg-final { scan-tree-dump "if .*varz" "phiopt1"} } */ +/* { dg-final { scan-tree-dump "vara.*MAX_EXPR" "phiopt1"} } */ +/* { dg-final { cleanup-tree-dump "phiopt1" } } */ -- cgit v1.2.3