[tree-ssa] PATCH for various tweaks

Jason Merrill jason@redhat.com
Thu Nov 21 07:46:00 GMT 2002


Booted and tested i686-pc-linux-gnu.  No new failures.

2002-11-16  Jason Merrill  <jason@redhat.com>

	Improve tree dumps.
	* c-pretty-print.c, tree-pretty-print.c (dump_c_node): Handle
	integers larger than a host word.
	(op_prio): Handle INIT_EXPR.
	* gimplify.c (simplify_bind_expr): Set TREE_SIDE_EFFECTS and type
	of void_type_node on the COMPOUND_EXPRs as we walk.
	* tree-simple.c (right_assocify_expr): Propagate the type from cur 
	rather than rhs.

These last two fix cases of statements being separated by commas instead of
semicolons in the dumps.

	* c-decl.c (finish_function): Call c_genericize instead of
	simplify_function_tree.
	* c-simplify.c (c_genericize): New function.
	(simplify_stmt_expr): Just genericize.
	(simplify_compound_literal_expr): Likewise.
	(c_build_bind_expr): Don't build a block for an artificial decl.
	(simplify_decl_stmt): Add the variable to the temps list iff it's 
	artificial.
	(c_simplify_expr): Don't call push/pop_context.
	* c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL.
	* c-tree.h: Declare c_genericize.

I started out trying to genericize without gimplification, but it turned
out to be rather complicated, largely because you still sometimes need to
generate temps.  You could just add them directly to the outermost
BIND_EXPR, but that doesn't work if we haven't already genericized.  So I'm
punting for now.

	* c-simplify.c (tree_build_scope): Remove.

Unused.

	Remove INIT_EXPR from GIMPLE.
	* c-simplify.c (simplify_decl_stmt): Use MODIFY_EXPR.
	* gimplify.c (simplify_bind_expr): Likewise.
	(simplify_modify_expr): Convert INIT_EXPR to MODIFY_EXPR.

There seems to be no useful difference between INIT_EXPR and MODIFY_EXPR at
the GIMPLE level.

	* c-simplify.c (create_tmp_var_1): Drop; change all users to call
	create_tmp_var.
	(gimple_add_tmp_var): Now adds to the external temps list if 
	available, or directly to the function otherwise.

Streamlining.

	Avoid gratuitous unused warnings.
	* c-simplify.c (simplify_expr_stmt): Check TREE_SIDE_EFFECTS
	directly.  Also check for explicit conversions to void.
	(expr_has_effect): Remove.

	* Makefile.in (OBJS): Remove tree-dchain.o.

	* stor-layout.c (variable_size): We don't care about
	global_bindings_p if the frontend doesn't want a list of the
	expressions.

This came up when trying to genericize a compound literal of
variable-length type.  We called variable_size when laying out the
temporary, and it complained about global_bindings_p returning null.  But
we don't care about that when gimplifying.
	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 24203 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20021121/93ccc14c/attachment.bin>


More information about the Gcc-patches mailing list