This is the mail archive of the gcc@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: Problem with your new SRA code


On Thu, Jul 01, 2004 at 02:52:51PM -0700, Richard Henderson wrote:
> Indeed.  Well, it handles plain view_convert_expr ok, but doesn't
> figure out how to propagate the variable indexing thing to the
> right place.  I should have a fix momentarily.

Like so.  Now I get 

Initial instantiation for bin_op_types<D1060>
Scalarization disabled for bin_op_types<D1060>

as we both expected.


r~


	* tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr
	in order to disable scalarization.  Instead set a flag and wait
	for a candidate decl.

Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.11
diff -c -p -d -r2.11 tree-sra.c
*** tree-sra.c	29 Jun 2004 17:04:44 -0000	2.11
--- tree-sra.c	1 Jul 2004 22:17:10 -0000
*************** sra_walk_expr (tree *expr_p, block_stmt_
*** 615,620 ****
--- 615,621 ----
  {
    tree expr = *expr_p;
    tree inner = expr;
+   bool disable_scalarization = false;
  
    /* We're looking to collect a reference expression between EXPR and INNER,
       such that INNER is a scalarizable decl and all other nodes through EXPR
*************** sra_walk_expr (tree *expr_p, block_stmt_
*** 632,638 ****
  	if (is_sra_candidate_decl (inner))
  	  {
  	    struct sra_elt *elt = maybe_lookup_element_for_expr (expr);
! 	    fns->use (elt, expr_p, bsi, is_output);
  	  }
  	return;
  
--- 633,642 ----
  	if (is_sra_candidate_decl (inner))
  	  {
  	    struct sra_elt *elt = maybe_lookup_element_for_expr (expr);
! 	    if (disable_scalarization)
! 	      elt->cannot_scalarize = true;
! 	    else
! 	      fns->use (elt, expr_p, bsi, is_output);
  	  }
  	return;
  
*************** sra_walk_expr (tree *expr_p, block_stmt_
*** 649,662 ****
  	   without duplicating too much code.  */
  	if (!is_valid_const_index (inner))
  	  {
! 	    if (fns->initial_scan)
! 	      {
! 		struct sra_elt *elt
! 		  = maybe_lookup_element_for_expr (TREE_OPERAND (inner, 0));
! 		if (elt)
! 		  elt->cannot_scalarize = true;
! 	      }
! 	    return;
  	  }
  	/* ??? Are we assured that non-constant bounds and stride will have
  	   the same value everywhere?  I don't think Fortran will...  */
--- 653,660 ----
  	   without duplicating too much code.  */
  	if (!is_valid_const_index (inner))
  	  {
! 	    disable_scalarization = true;
! 	    goto use_all;
  	  }
  	/* ??? Are we assured that non-constant bounds and stride will have
  	   the same value everywhere?  I don't think Fortran will...  */


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