re PR tree-optimization/90106 (builtin sqrt() ignoring libm's sqrt call result)
authorJun Ma <JunMa@linux.alibaba.com>
Fri, 17 May 2019 10:13:29 +0000 (10:13 +0000)
committerJun Ma <junma@gcc.gnu.org>
Fri, 17 May 2019 10:13:29 +0000 (10:13 +0000)
PR tree-optimization/90106
* gcc.dg/cdce3.c: New test.

From-SVN: r271319

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cdce3.c [new file with mode: 0644]

index f6dd06d961e8fa06348b4a2d89e6b4f48520a1ff..053a9492168e7d806e16a5a4db74375ceb98912d 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-17  Jun Ma  <JunMa@linux.alibaba.com>
+
+       PR tree-optimization/90106
+       * gcc.dg/cdce3.c: New test.
+
 2019-05-17  Andreas Krebbel  <krebbel@linux.ibm.com>
 
        * 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 (file)
index 0000000..8a74379
--- /dev/null
@@ -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);
+}
+