2009-03-05 Richard Guenther <rguenther@suse.de>
* expr.c (expand_expr_real_1): Handle POINTER_PLUSNV_EXPR,
PLUSNV_EXPR, MINUSNV_EXPR, MULTNV_EXPR and NEGATENV_EXPR.
* flags.h (TYPE_OVERFLOW_WRAPS): Define to always true.
(TYPE_OVERFLOW_UNDEFINED): Define to always false.
(POINTER_TYPE_OVERFLOW_UNDEFINED): Define to always false.
* optabs.c (optab_for_tree_code): Handle *NV_EXPR.
* tree-cfg.c (verify_gimple_assign_unary): Likewise.
(verify_gimple_assign_binary): Likewise.
* tree-inline.c (estimate_operator_cost): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_code_prio): Likewise.
(op_symbol_code): Likewise.
* tree-ssa-structalias.c (find_func_aliases): Handle
POINTER_PLUSNV_EXPR.
* tree.c (build2_stat): Adjust checks.
(associative_tree_code): Add PLUSNV_EXPR and MULTNV_EXPR.
(commutative_tree_code): Add PLUSNV_EXPR and MULTNV_EXPR.
(undefined_overflow_used_p_1): New function.
* tree.def (PLUSNV_EXPR, MINUSNV_EXPR, MULTNV_EXPR,
POINTER_PLUSNV_EXPR, NEGATENV_EXPR): New tree codes for
operations that are known to not overflow.
* tree.h (NEGATE_EXPR_CODE_P, PLUS_EXPR_CODE_P,
POINTER_PLUS_EXPR_CODE_P, MINUS_EXPR_CODE_P, MULT_EXPR_CODE_P): New.
(NEGATE_EXPR_P, PLUS_EXPR_P, POINTER_PLUS_EXPR_P, MINUS_EXPR_P,
MULT_EXPR_P): Likewise.
(strip_nv): New inline function.
(undefined_overflow_used_p_1): Declare.
(undefined_overflow_used_p): New inline function.
* varasm.c (narrowing_initializer_constant_valid_p): Handle
MINUSNV_EXPR.
(initializer_constant_valid_p): Handle *NV_EXPR.
* omp-low.c (omp_reduction_init): Likewise.
* gimple-pretty-print.c (dump_unary_rhs): Handle NEGATENV_EXPR.
* fold-const.c (fold_negate_expr): Likewise.
(int_const_binop): Handle *NV_EXPR.
(fold_unary): Handle NEGATENV_EXPR.
(tree_binary_nonzero_warnv_p): The type argument is unused.
(fold_binary): Handle simple cases for POINTER_PLUSNV_EXPR,
PLUSNV_EXPR, MINUSNV_EXPR and MULTNV_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/no-undefined-overflow@144646 138bc75d-0d04-0410-961f-82ee72b054a4
15 files changed: