From 35ee7f54686d7cba0feb5c1750ae4071db252000 Mon Sep 17 00:00:00 2001 From: Jun Ma Date: Fri, 17 May 2019 10:13:29 +0000 Subject: [PATCH] re PR tree-optimization/90106 (builtin sqrt() ignoring libm's sqrt call result) PR tree-optimization/90106 * gcc.dg/cdce3.c: New test. From-SVN: r271319 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/cdce3.c | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cdce3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6dd06d961e..053a9492168 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-17 Jun Ma + + PR tree-optimization/90106 + * gcc.dg/cdce3.c: New test. + 2019-05-17 Andreas Krebbel * gcc.target/s390/zvector/vec-sldw.c: New test. diff --git a/gcc/testsuite/gcc.dg/cdce3.c b/gcc/testsuite/gcc.dg/cdce3.c new file mode 100644 index 00000000000..8a7437969f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cdce3.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump "cdce3.c:9: \[^\n\r]* function call is shrink-wrapped into error conditions\." "cdce" } } */ +/* { dg-final { scan-tree-dump "sqrtf \\(\[^\n\r]*\\); \\\[tail call\\\]" "optimized" } } */ + +float sqrtf (float); +float foo (float x) +{ + return sqrtf (x); +} + -- 2.30.2