diff options
author | Richard Guenther <rguenther@suse.de> | 2009-04-28 15:27:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-04-28 15:27:09 +0000 |
commit | e0dd989a1b6c9bd473ea875a2daad0af050279a3 (patch) | |
tree | fa262efe84407fece3d549d15fd03850cbe16f8b /gcc/fold-const.c | |
parent | 9a17c91defe42bdd966dd30b33b171dd07f8cd00 (diff) | |
download | gcc-e0dd989a1b6c9bd473ea875a2daad0af050279a3.tar.gz |
re PR middle-end/39937 (Revision 146831 failed SPEC CPU 2006)
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.
From-SVN: r146901
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
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))) |