public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] expr.c: Remove an obsolete comment.
@ 2004-10-17 16:21 Kazu Hirata
  2004-10-17 17:23 ` Kazu Hirata
  0 siblings, 1 reply; 2+ messages in thread
From: Kazu Hirata @ 2004-10-17 16:21 UTC (permalink / raw)
  To: gcc-patches

Hi,

Attached is a patch to remove an obsolete comment.

This comment does not seem to describe any code.  I looked at
expand_assignment, which handles MODIFY_EXPR, but I didn't find any
code that would be described by this comment.

OK to apply?

Kazu Hirata

2004-10-17  Kazu Hirata  <kazu@cs.umass.edu>

	* expr.c (expand_expr_real_1): Remove an obsolete comment.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.726
diff -u -r1.726 expr.c
--- expr.c	3 Oct 2004 22:50:18 -0000	1.726
+++ expr.c	17 Oct 2004 15:55:49 -0000
@@ -8064,14 +8064,6 @@
 
     case MODIFY_EXPR:
       {
-	/* 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);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] expr.c: Remove an obsolete comment.
  2004-10-17 16:21 [patch] expr.c: Remove an obsolete comment Kazu Hirata
@ 2004-10-17 17:23 ` Kazu Hirata
  0 siblings, 0 replies; 2+ messages in thread
From: Kazu Hirata @ 2004-10-17 17:23 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-17 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-17 16:21 [patch] expr.c: Remove an obsolete comment Kazu Hirata
2004-10-17 17:23 ` Kazu Hirata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).