public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH to gimplify_modify_expr to avoid extra copies
@ 2004-06-11  5:43 Jason Merrill
  2004-06-11  6:08 ` Jason Merrill
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Merrill @ 2004-06-11  5:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: bbooth, Richard Kenner

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

This patch should help to avoid the extra copies kenner has been seeing.

Brian, can you make sure that my comment about V_MAY_DEF is accurate when
you check in your patch?  :)

Tested x86_64-pc-linux-gnu, applied to trunk.

2004-06-10  Jason Merrill  <jason@redhat.com>

	* gimplify.c (gimplify_modify_expr): Don't force a temporary
	of an aggregate_value_p type.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1511 bytes --]

*** gimplify.c.~1~	2004-06-10 16:27:29.000000000 -0400
--- gimplify.c	2004-06-10 22:54:18.000000000 -0400
*************** gimplify_modify_expr (tree *expr_p, tree
*** 2493,2504 ****
  
  	 FIXME this should be handled by the is_gimple_rhs predicate.  */
  
!       if (TREE_CODE (*from_p) == CALL_EXPR
! 	  || (flag_non_call_exceptions && tree_could_trap_p (*from_p))
! 	  /* If we're dealing with a renamable type, either source or dest
! 	     must be a renamed variable.  */
! 	  || (is_gimple_reg_type (TREE_TYPE (*from_p))
! 	      && !is_gimple_reg (*to_p)))
  	gimplify_expr (from_p, pre_p, post_p, is_gimple_val, fb_rvalue);
  
        /* If the value being copied is of variable width, expose the length
--- 2493,2508 ----
  
  	 FIXME this should be handled by the is_gimple_rhs predicate.  */
  
!       if (aggregate_value_p (TREE_TYPE (*from_p), NULL_TREE))
! 	/* Don't force a temp of a large aggregate type; the copy could be
! 	   arbitrarily expensive.  Instead we will generate a V_MAY_DEF for
! 	   the assignment.  */;
!       else if (TREE_CODE (*from_p) == CALL_EXPR
! 	       || (flag_non_call_exceptions && tree_could_trap_p (*from_p))
! 	       /* If we're dealing with a renamable type, either source or dest
! 		  must be a renamed variable.  */
! 	       || (is_gimple_reg_type (TREE_TYPE (*from_p))
! 		   && !is_gimple_reg (*to_p)))
  	gimplify_expr (from_p, pre_p, post_p, is_gimple_val, fb_rvalue);
  
        /* If the value being copied is of variable width, expose the length

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re:  PATCH to gimplify_modify_expr to avoid extra copies
@ 2004-06-11 17:55 Richard Kenner
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Kenner @ 2004-06-11 17:55 UTC (permalink / raw)
  To: jason; +Cc: gcc-patches

    This patch should help to avoid the extra copies kenner has been seeing.

I *think* it does, but can't be sure (I'm blowing up in a different place
in that file and can't be sure that it's later; I'm travelling now).

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

end of thread, other threads:[~2004-06-11 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11  5:43 PATCH to gimplify_modify_expr to avoid extra copies Jason Merrill
2004-06-11  6:08 ` Jason Merrill
2004-06-11  6:36   ` Richard Henderson
2004-06-11 19:38   ` Jason Merrill
2004-06-11 17:55 Richard Kenner

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