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 to gimplify_modify_expr to avoid extra copies


On Thu, 10 Jun 2004 23:05:53 -0400, Jason Merrill <jason@redhat.com> wrote:

> Brian, can you make sure that my comment about V_MAY_DEF is accurate when
> you check in your patch?  :)
>
> ! 	/* 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.  */;

Ah, I see you already checked it in.  Does something like this make sense
to you?

*** tree-ssa-operands.c.~1~	2004-06-10 23:07:12.000000000 -0400
--- tree-ssa-operands.c	2004-06-10 23:24:32.000000000 -0400
*************** get_stmt_operands (tree stmt)
*** 821,827 ****
        if (TREE_CODE (TREE_OPERAND (stmt, 0)) == ARRAY_REF 
            || TREE_CODE (TREE_OPERAND (stmt, 0)) == COMPONENT_REF
  	  || TREE_CODE (TREE_OPERAND (stmt, 0)) == REALPART_EXPR
! 	  || TREE_CODE (TREE_OPERAND (stmt, 0)) == IMAGPART_EXPR)
          get_expr_operands (stmt, &TREE_OPERAND (stmt, 0), opf_is_def, 
  	                   &prev_vops);
        else
--- 821,833 ----
        if (TREE_CODE (TREE_OPERAND (stmt, 0)) == ARRAY_REF 
            || TREE_CODE (TREE_OPERAND (stmt, 0)) == COMPONENT_REF
  	  || TREE_CODE (TREE_OPERAND (stmt, 0)) == REALPART_EXPR
! 	  || TREE_CODE (TREE_OPERAND (stmt, 0)) == IMAGPART_EXPR
! 	  /* Use a V_MAY_DEF if the RHS might throw, as the LHS won't be
! 	     modified in that case.  FIXME we should represent somehow
! 	     that it is killed on the fallthrough path.  */
! 	  || TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR
! 	  || (flag_non_call_exceptions
! 	      && tree_could_trap_p (TREE_OPERAND (stmt, 1))))
          get_expr_operands (stmt, &TREE_OPERAND (stmt, 0), opf_is_def, 
  	                   &prev_vops);
        else

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