summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr29921.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-22 23:11:15 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-22 23:11:15 +0000
commit90b56f40c147d5eff51e79d8d673d539c845a4d1 (patch)
tree466302702261d13e0284a991a22c4b62dc8aa24f /gcc/testsuite/gcc.dg/pr29921.c
parent1c5afb804e03f0a2a071cdf5b2a5c25ab6fa094b (diff)
downloadgcc-90b56f40c147d5eff51e79d8d673d539c845a4d1.tar.gz
PR tree-optimization/29921
* fold-const.c (operand_equal_p): Without HONOR_SIGNED_ZEROS, consider signed and unsigned zero equal. * gcc.dg/pr29921.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr29921.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr29921.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr29921.c b/gcc/testsuite/gcc.dg/pr29921.c
new file mode 100644
index 00000000000..7689f54ce25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr29921.c
@@ -0,0 +1,20 @@
+/* With -ffast-math, the latice value for t changes from -0.0 to 0.0 in this
+ testcase. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double test (int param)
+{
+ double a = 0.0, b = -1.0, t;
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ t = a * b;
+ if (param)
+ b = 2.0;
+ }
+
+ return t;
+}