[tuples][patch] Convert pass_object_sizes to tuples
Diego Novillo
dnovillo@google.com
Tue Mar 18 13:07:00 GMT 2008
[ Jakub, I CCd you because there is a question about seemingly dead code
in compute_builtin_object_size. See below. ]
On 3/18/08 1:34 AM, Bill Maddox wrote:
> This patch enables pass_object_sizes, and corrects mishandling of
> unary NOPs in get_maxval_strlen.
>
> * builtins.c (fold_builtin_object_size):
> Enable call to compute_builtin_object_size, previously
> stubbed out awaiting tuplification.
> * tree-ssa-ccp.c (valid_gimple_rhs_p, valid_gimple_call_p,
> move_ssa_defining_stmt_for_defs, update_call_from_tree):
> Deleted, moved to tree-ssa-propagate.c.
> (get_maxval_strlen): Use gimple_assign_single_p.
> Handle assignment with unary NOP correctly.
> * tree-ssa-propagate.c (valid_gimple_rhs_p, valid_gimple_call_p,
> move_ssa_defining_stmt_for_defs, update_call_from_tree):
> Moved here from tree-ssa-ccp.c.
> * tree-ssa-propagate.h (valid_gimple_rhs_p, valid_gimple_call_p,
> move_ssa_defining_stmt_for_defs, update_call_from_tree): Declared.
> * gimple-dummy.c (compute_builtin_object_size): Removed dummy.
> * tree_object_size.c (addr_object_size, alloc_object_size)
> Tuplified.
> (pass_through_call, compute_builtin_object_size): Tuplified.
> (expr_object_size): Tuplified. Some cases broken out.
> (plus_expr_object_size): Deleted.
> (call_object_size, unknown_object_size, plus_stmt_object_size):
> New functions. Handle cases broken out from expr_object_size.
> (cond_expr_object_size): Fix comment.
> (collect_object_sizes_for): Tuplify.
> (check_for_plus_in_loops_1, check_for_plus_in_loops): Tuplify.
> (compute_object_sizes): Tuplify.
> * gimple.c (gimple_assign_single_p, gimple_assign_unary_nop_p):
> New functions.
> * gimple.h (gimple_assign_single_p, gimple_assign_unary_nop_p):
> Declare.
> * passes.c (init_optimization_passes): Enable pass_object_sizes.
OK with a couple of changes below:
> @@ -330,21 +328,16 @@ compute_builtin_object_size (tree ptr, i
> {
> gcc_assert (object_size_type >= 0 && object_size_type <= 3);
>
> + /* FIXME tuples. Paranoia. */
> + gcc_assert (TREE_CODE (ptr) != CALL_EXPR);
> +
No need to have a 'FIXME tuples' here. I agree that PTR should never be
a CALL_EXPR. I wonder why Jakub added it to begin with.
Jakub, why are we handling CALL_EXPRs in compute_builtin_object_size?
It looks dead.
> @@ -490,10 +481,72 @@ expr_object_size (struct object_size_inf
>
> if (TREE_CODE (value) == ADDR_EXPR)
> bytes = addr_object_size (value, object_size_type);
> - else if (TREE_CODE (value) == CALL_EXPR)
> - bytes = alloc_object_size (value, object_size_type);
> else
> - bytes = unknown[object_size_type];
> + {
> + /* FIXME tuples. Paranoia. */
> + gcc_assert (TREE_CODE (value) != CALL_EXPR
> + && TREE_CODE (value) != POINTER_PLUS_EXPR);
No need to have 'FIXME tuples'. Jakub, same question here re. CALL_EXPRs.
Thanks. Diego.
More information about the Gcc-patches
mailing list