OSDN Git Service

* config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_BSS): Undef before
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-reassoc.c
index 395c549..5514c3d 100644 (file)
@@ -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-integral
+     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