summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-28 15:27:09 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-28 15:27:09 +0000
commit1e5de3bdcdb0c50f3f2cdba26b78c20529c775a3 (patch)
treefa262efe84407fece3d549d15fd03850cbe16f8b /gcc/fold-const.c
parent43cb92228e7a237bda6eb5585d291af6efc54b79 (diff)
downloadgcc-1e5de3bdcdb0c50f3f2cdba26b78c20529c775a3.tar.gz
2009-04-28 Richard Guenther <rguenther@suse.de>
PR middle-end/39937 * fold-const.c (fold_binary): Use distribute_real_division only on float types. * gfortran.fortran-torture/compile/pr39937.f: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146901 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 2b8f7333182..14b9f100b51 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10102,7 +10102,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
}
- if (flag_unsafe_math_optimizations
+ if (flag_unsafe_math_optimizations
&& (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR)
&& (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR)
&& (tem = distribute_real_division (code, type, arg0, arg1)))
@@ -10542,7 +10542,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
}
- if (flag_unsafe_math_optimizations
+ if (FLOAT_TYPE_P (type)
+ && flag_unsafe_math_optimizations
&& (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR)
&& (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR)
&& (tem = distribute_real_division (code, type, arg0, arg1)))