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]

[PATCH]: Fix PR tree-optimization/20926


We can't add_type_alias the var if it has subvars, we need to do the
subvars instead, otherwise, we'll get verify_ssa errors later when we
see the var instead of it's subvars.

Diego, since this is *always* the case, should i simply attempt to move
this logic into add_type_alias itself, so that if you call it with a var
that has subvars, it automatically does the right thing?  
I wasn't sure whether i should force the callers to know what they are
doing, or just make the callee handle it for them.

--Dan
2005-04-11  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR tree-optimization/20926
	
	* tree-ssa-loop-ivopts.c (rewrite_address_base): Handle subvars.

Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.59
diff -u -p -r2.59 tree-ssa-loop-ivopts.c
--- tree-ssa-loop-ivopts.c	9 Apr 2005 01:37:24 -0000	2.59
+++ tree-ssa-loop-ivopts.c	11 Apr 2005 16:48:48 -0000
@@ -4849,7 +4849,19 @@ rewrite_address_base (block_stmt_iterato
       if (tag)
 	var_ann (new_ptr)->type_mem_tag = tag;
       else
-	add_type_alias (new_ptr, var);
+	{
+	  subvar_t svars;
+	  if (var_can_have_subvars (var)
+	      && (svars = get_subvars_for_var (var)))
+	    {
+	      subvar_t sv;
+	      
+	      for (sv = svars; sv; sv = sv->next)
+		  add_type_alias (new_ptr, sv->var);
+	    }
+	  else
+	    add_type_alias (new_ptr, var);
+	}
       new_name = make_ssa_name (new_ptr, copy);
     }
 

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