diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-25 20:23:50 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-25 20:23:50 +0000 |
commit | 79572849a4c774bc74e18a5c43069493c130b54a (patch) | |
tree | 84e5a56aec9d4dbd3e5bb74ed964647e3c00138e /gcc/tree-ssa-reassoc.c | |
parent | a99be1654a402f14905861a44191ec273f38902a (diff) | |
download | gcc-79572849a4c774bc74e18a5c43069493c130b54a.tar.gz |
2005-07-25 Andrew Pinski <pinskia@physics.uc.edu>
* tree-ssa-reassoc.c (reassociate_expr): Allow scaler floating point
types when flag_unsafe_math_optimizations is true.
2005-07-25 Andrew Pinski <pinskia@physics.uc.edu>
* gcc.dg/tree-ssa/reassoc-3.c: New test.
* gcc.dg/tree-ssa/reassoc-4.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 395c5495455..e0d45612b01 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 |