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: Fix problems with tree-sra.c with VIEW_CONVERT_EXPR


On Mon, 2004-06-28 at 13:48, Richard Kenner wrote:
>     Why not call get_base_address here?
> 
> That returns NULL_TREE is it's not an SSA_VAR_P.
>
Huh?  It does exactly what you added to is_sra_candidate_complex_ref.

> I thought this code was looking for *non*-SSA decls?
>
What code?  The scalarizer?  What does that have to do with my remark
about code duplication?


Also, the modifications that you made to scalarize_modify_expr need to
be factored with the code in scalarize_structure_assignment.  There's
code duplication now:

*************** scalarize_modify_expr (block_stmt_iterat
*************** scalarize_modify_expr (block_stmt_iterat
       preventing the optimizers from removing all the redundant
       operations.  */
!   else if (is_sra_candidate_ref (rhs, true))
      {
-       tree var = TREE_OPERAND (rhs, 0);
        emit_scalar_copies (si_p, var, var, FIELD_SCALAR);
      }
  
--- 969,988 ----
       preventing the optimizers from removing all the redundant
       operations.  */
!   else if (is_sra_candidate_complex_ref (rhs, &var))
      {
        emit_scalar_copies (si_p, var, var, FIELD_SCALAR);
+ 
+       /* If the LHS of the assignment is also a scalarizable
structure, insert
+        copies into the scalar replacements after the call.  */
+       if (is_sra_candidate_decl (lhs))
+       {
+         tree list = create_scalar_copies (lhs, lhs, SCALAR_FIELD);
+         if (EXPR_HAS_LOCATION (stmt))
+           annotate_all_with_locus (&list, EXPR_LOCATION (stmt));
+         if (stmt_ends_bb_p (stmt))
+           insert_edge_copies (list, bb_for_stmt (stmt));
+         else
+           bsi_insert_after (si_p, list, BSI_NEW_STMT);
+       }
      }
  
This new hunk of code is exactly the same thing that
scalarize_structure_assignment does at the end.  Why is it that you are
adding this here?

Are you trying to handle some kind of structure nesting?  Can you give
me an example?


Thanks.  Diego.


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