GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
+Free Software Foundation; either version 3, or (at your option) any
later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
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, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
STRIP_SIGN_NOPS (c0);
STRIP_SIGN_NOPS (c1);
ctype = TREE_TYPE (c0);
- if (!tree_ssa_useless_type_conversion_1 (ctype, type))
+ if (!useless_type_conversion_p (ctype, type))
return;
break;
/* And then we can compute iv0->base - diff, and compare it with
iv1->base. */
- mbzl = fold_build2 (MINUS_EXPR, type1, iv0->base, diff);
- mbzr = iv1->base;
+ mbzl = fold_build2 (MINUS_EXPR, type1,
+ fold_convert (type1, iv0->base), diff);
+ mbzr = fold_convert (type1, iv1->base);
}
else
{
iv1->base, bound);
}
- mbzl = iv0->base;
- mbzr = fold_build2 (MINUS_EXPR, type1, iv1->base, diff);
+ mbzl = fold_convert (type1, iv0->base);
+ mbzr = fold_build2 (MINUS_EXPR, type1,
+ fold_convert (type1, iv1->base), diff);
}
if (!integer_nonzerop (assumption))
e = GIMPLE_STMT_OPERAND (stmt, 1);
if (/* Casts are simple. */
- TREE_CODE (e) != NOP_EXPR
- && TREE_CODE (e) != CONVERT_EXPR
+ !CONVERT_EXPR_P (e)
/* Copies are simple. */
&& TREE_CODE (e) != SSA_NAME
/* Assignments of invariants are simple. */
/* Returns true if EXIT is the only possible exit from LOOP. */
static bool
-loop_only_exit_p (struct loop *loop, edge exit)
+loop_only_exit_p (const struct loop *loop, const_edge exit)
{
basic_block *body;
block_stmt_iterator bsi;
be nonnegative. */
static double_int
-derive_constant_upper_bound (tree val)
+derive_constant_upper_bound (const_tree val)
{
tree type = TREE_TYPE (val);
tree op0, op1, subtype, maxt;
case INTEGER_CST:
return tree_to_double_int (val);
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
op0 = TREE_OPERAND (val, 0);
subtype = TREE_TYPE (op0);
if (!TYPE_UNSIGNED (subtype)
2032, 2040, 0, 8, ..., but the code is still legal. */
if (chrec_contains_undetermined (base)
- || chrec_contains_undetermined (step)
- || TREE_CODE (step) != INTEGER_CST)
+ || chrec_contains_undetermined (step))
return true;
if (integer_zerop (step))
if (use_overflow_semantics && nowrap_type_p (type))
return false;
+ /* To be able to use estimates on number of iterations of the loop,
+ we must have an upper bound on the absolute value of the step. */
+ if (TREE_CODE (step) != INTEGER_CST)
+ return true;
+
/* Don't issue signed overflow warnings. */
fold_defer_overflow_warnings ();