OSDN Git Service

* config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_BSS): Undef before
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-reassoc.c
index 68a2910..5514c3d 100644 (file)
@@ -16,8 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -406,7 +406,7 @@ should_transpose (tree rhs ATTRIBUTE_UNUSED,
 
   /* Also, see if the LHS's high ranked op should be switched with our
      RHS simply because it is greater in rank than our current RHS.  */
-  if (TREE_CODE (TREE_OPERAND (lhsdefop, 0)) == SSA_NAME)
+  if (TREE_CODE (TREE_OPERAND (lhsdefop, highrankop)) == SSA_NAME)
     {
       tree iop = SSA_NAME_DEF_STMT (TREE_OPERAND (lhsdefop, highrankop));
       if (TREE_CODE (iop) == MODIFY_EXPR)
@@ -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