2009-03-05 Richard Guenther <rguenther@suse.de>
commitec86970668e7d90e5aaafc671face64d631ee843
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Mar 2009 15:12:50 +0000 (5 15:12 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Mar 2009 15:12:50 +0000 (5 15:12 +0000)
treedc205d6b803a3bda03ce40fdca99fcac0adce7db
parent356662617bc60ac8a7857dc6bf786e7e2bec5fe1
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:
gcc/ChangeLog.overflow [new file with mode: 0644]
gcc/expr.c
gcc/flags.h
gcc/fold-const.c
gcc/gimple-pretty-print.c
gcc/omp-low.c
gcc/optabs.c
gcc/tree-cfg.c
gcc/tree-inline.c
gcc/tree-pretty-print.c
gcc/tree-ssa-structalias.c
gcc/tree.c
gcc/tree.def
gcc/tree.h
gcc/varasm.c