public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] expr.c: Don't request a value to expand_assignment.
@ 2004-10-16 12:36 Kazu Hirata
  2004-10-16 12:58 ` Kazu Hirata
  2004-10-18 20:29 ` Jeffrey A Law
  0 siblings, 2 replies; 3+ messages in thread
From: Kazu Hirata @ 2004-10-16 12:36 UTC (permalink / raw)
  To: gcc-patches

Hi,

Attached is a patch to not request a value to expand_assignment when
expanding a MODIFY_EXPR.

As far as I know, the tree-ssa infrastructure does not generate tree
that requests a value of an assignment (e.g. a = b = c;) regardless of
whether optimizing or not.

This is the only place that requests a value to expand_assignment.
Once this patch is applied, we can clean up expand_assignment so that
it won't have to bother returning a value.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

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

	* expr.c (expand_expr_real_1) [MODIFY_EXPR]: Don't request a
	value to expand_assignment.

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	15 Oct 2004 21:58:23 -0000
@@ -8077,6 +8090,8 @@
 
 	temp = 0;
 
+	gcc_assert (ignore);
+
 	/* Check for |= or &= of a bitfield of size one into another bitfield
 	   of size 1.  In this case, (unless we need the result of the
 	   assignment) we can do this more efficiently with a
@@ -8085,8 +8100,7 @@
 	   ??? At this point, we can't get a BIT_FIELD_REF here.  But if
 	   things change so we do, this code should be enhanced to
 	   support it.  */
-	if (ignore
-	    && TREE_CODE (lhs) == COMPONENT_REF
+	if (TREE_CODE (lhs) == COMPONENT_REF
 	    && (TREE_CODE (rhs) == BIT_IOR_EXPR
 		|| TREE_CODE (rhs) == BIT_AND_EXPR)
 	    && TREE_OPERAND (rhs, 0) == lhs
@@ -8109,7 +8123,7 @@
 	    return const0_rtx;
 	  }
 
-	temp = expand_assignment (lhs, rhs, ! ignore);
+	temp = expand_assignment (lhs, rhs, 0);
 
 	return temp;
       }

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

* Re: [patch] expr.c: Don't request a value to expand_assignment.
  2004-10-16 12:36 [patch] expr.c: Don't request a value to expand_assignment Kazu Hirata
@ 2004-10-16 12:58 ` Kazu Hirata
  2004-10-18 20:29 ` Jeffrey A Law
  1 sibling, 0 replies; 3+ messages in thread
From: Kazu Hirata @ 2004-10-16 12:58 UTC (permalink / raw)
  To: gcc-patches

Hi,

> Tested on i686-pc-linux-gnu.  OK to apply?

Oops.  Actually, bootstrap and testing in progress.

Kazu Hirata

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

* Re: [patch] expr.c: Don't request a value to expand_assignment.
  2004-10-16 12:36 [patch] expr.c: Don't request a value to expand_assignment Kazu Hirata
  2004-10-16 12:58 ` Kazu Hirata
@ 2004-10-18 20:29 ` Jeffrey A Law
  1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 2004-10-18 20:29 UTC (permalink / raw)
  To: Kazu Hirata; +Cc: gcc-patches

On Sat, 2004-10-16 at 06:32, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to not request a value to expand_assignment when
> expanding a MODIFY_EXPR.
> 
> As far as I know, the tree-ssa infrastructure does not generate tree
> that requests a value of an assignment (e.g. a = b = c;) regardless of
> whether optimizing or not.
> 
> This is the only place that requests a value to expand_assignment.
> Once this patch is applied, we can clean up expand_assignment so that
> it won't have to bother returning a value.
> 
> Tested on i686-pc-linux-gnu.  OK to apply?
> 
> Kazu Hirata
> 
> 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
> 
> 	* expr.c (expand_expr_real_1) [MODIFY_EXPR]: Don't request a
> 	value to expand_assignment.
This is fine.  Please install.

jeff


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-16 12:36 [patch] expr.c: Don't request a value to expand_assignment Kazu Hirata
2004-10-16 12:58 ` Kazu Hirata
2004-10-18 20:29 ` Jeffrey A Law

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).