From c72f711f8aa995eef830a3189fd0ca65c663544e Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Mon, 25 Jul 2005 20:23:50 +0000 Subject: tree-ssa-reassoc.c (reassociate_expr): Allow scaler floating point types when flag_unsafe_math_optimizations is true. 2005-07-25 Andrew Pinski * tree-ssa-reassoc.c (reassociate_expr): Allow scaler floating point types when flag_unsafe_math_optimizations is true. 2005-07-25 Andrew Pinski * gcc.dg/tree-ssa/reassoc-3.c: New test. * gcc.dg/tree-ssa/reassoc-4.c: New test. From-SVN: r102368 --- gcc/tree-ssa-reassoc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/tree-ssa-reassoc.c') diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 395c549..e0d4561 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -435,10 +435,13 @@ reassociate_expr (tree bexpr, block_stmt_iterator *currbsi) unsigned int lhsrank = get_rank (lhs); unsigned int rhsrank = get_rank (rhs); - /* I don't want to get into the business of floating point - reassociation. */ - if (!INTEGRAL_TYPE_P (TREE_TYPE (lhs)) - || !INTEGRAL_TYPE_P (TREE_TYPE (rhs))) + /* If unsafe math optimizations we can do reassociation for non integal + types. */ + if ((!INTEGRAL_TYPE_P (TREE_TYPE (lhs)) + || !INTEGRAL_TYPE_P (TREE_TYPE (rhs))) + && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs)) + || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(lhs)) + || !flag_unsafe_math_optimizations)) return false; /* We want the greater ranked operand to be our "LHS" for simplicity -- cgit v1.1