This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] expr.c: Remove an obsolete comment.


Hi,

> -	/* If lhs is complex, expand calls in rhs before computing it.
> -	   That's so we don't compute a pointer and save it over a
> -	   call.  If lhs is simple, compute it first so we can give it
> -	   as a target if the rhs is just a call.  This avoids an
> -	   extra temp and copy and that prevents a partial-subsumption
> -	   which makes bad code.  Actually we could treat
> -	   component_ref's of vars like vars.  */
> -

This comment seems to be for the time when we still had
preexpand_calls, which was removed by Mark Mitchell.

  http://gcc.gnu.org/ml/gcc-bugs/2000-10/msg00471.html

Until then, the code used to look like

	/* If lhs is complex, expand calls in rhs before computing it.
	   That's so we don't compute a pointer and save it over a call.
	   If lhs is simple, compute it first so we can give it as a
	   target if the rhs is just a call.  This avoids an extra temp and copy
	   and that prevents a partial-subsumption which makes bad code.
	   Actually we could treat component_ref's of vars like vars.  */

	tree lhs = TREE_OPERAND (exp, 0);
	tree rhs = TREE_OPERAND (exp, 1);
	tree noncopied_parts = 0;
	tree lhs_type = TREE_TYPE (lhs);

	temp = 0;

	if (TREE_CODE (lhs) != VAR_DECL
	    && TREE_CODE (lhs) != RESULT_DECL
	    && TREE_CODE (lhs) != PARM_DECL
	    && ! (TREE_CODE (lhs) == INDIRECT_REF
		  && TYPE_READONLY (TREE_TYPE (TREE_OPERAND (lhs, 0)))))
	  preexpand_calls (exp);

where the comment makes sense.  I committed my patch as obvious.

Kazu Hirata


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]