summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr14888.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr14888.C')
-rw-r--r--gcc/testsuite/g++.dg/opt/pr14888.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr14888.C b/gcc/testsuite/g++.dg/opt/pr14888.C
new file mode 100644
index 000000000..e5c56aaab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr14888.C
@@ -0,0 +1,22 @@
+// PR target/14888
+// This used to ICE because the truncdfsf2 isn't completely eliminated
+
+// { dg-do compile }
+// { dg-options "-O2 -ffast-math" }
+
+class xcomplex
+{
+public:
+ float re, im;
+
+ xcomplex &operator*= (const float &fact)
+ { re*=fact; im*=fact; return *this; }
+};
+
+void foo (xcomplex &almT, xcomplex &almG)
+{
+ double gb;
+ almT*=gb;
+ almG*=gb*42;
+}
+