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"
/* 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)
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