[Bug tree-optimization/27087] [4.1/4.2 regression] ICE in merge_alias_info

Jeffrey A Law law@redhat.com
Tue Apr 11 05:56:00 GMT 2006


On Sat, 2006-04-08 at 23:16 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-08 23:16 -------
> Confirmed, the ICE is during DOM.
As I mentioned in the PR notes, the problem is
tree-ssa-copy.c::may_propagate_copy allows copy propagations which
are rejected by merge_alias_info.  Specifically it allows copy
propagating when the flow-sensitive alias information is not
compatible.

I'm not entirely sure the compatibility check in may_propagate_copy
and merge_alias_info is correct.  It seems to me that we want to 
verify that one is a subset of the other, not just that the two
objects have intersecting flow sensitive information.  Someone
more familiar with this code should follow-up on that issue.

My patch merely makes the two routines consistent in how they handle
flow-sensitive alias information for copy propagations.

Bootstrapped and regression tested on i686-pc-linux-gnu.


-------------- next part --------------
	PR/27087
	* tree-ssa-copy.c (may_propagate_copy): Test flow sensitive
	alias information too.

	* gcc.c-torture/compile/pr27087.c: New test.

Index: testsuite/gcc.c-torture/compile/pr27087.c
===================================================================
*** testsuite/gcc.c-torture/compile/pr27087.c	(revision 0)
--- testsuite/gcc.c-torture/compile/pr27087.c	(revision 0)
***************
*** 0 ****
--- 1,23 ----
+ extern int ptbl[4];
+ extern int ctbl[4];
+ 
+ void doViews(void) {
+     int  *c = ctbl, *p = ptbl;
+     while (1)
+   {
+         p++;
+         c++;
+         if (*p)
+         {
+             if (c == p)
+             {
+                 if (*c)
+                     return;
+             }
+             else
+               return;
+         }
+     }
+ 
+     g();
+ }
Index: tree-ssa-copy.c
===================================================================
*** tree-ssa-copy.c	(revision 112848)
--- tree-ssa-copy.c	(working copy)
*************** may_propagate_copy (tree dest, tree orig
*** 117,122 ****
--- 117,137 ----
        else if (get_alias_set (TREE_TYPE (type_d)) != 
  	       get_alias_set (TREE_TYPE (type_o)))
  	return false;
+ 
+       /* Also verify flow-sensitive information is compatible.  */
+       if (SSA_NAME_PTR_INFO (orig) && SSA_NAME_PTR_INFO (dest))
+ 	{
+ 	  struct ptr_info_def *orig_ptr_info = SSA_NAME_PTR_INFO (orig);
+ 	  struct ptr_info_def *dest_ptr_info = SSA_NAME_PTR_INFO (dest);
+ 
+ 	  if (orig_ptr_info->name_mem_tag
+ 	      && dest_ptr_info->name_mem_tag
+ 	      && orig_ptr_info->pt_vars
+ 	      && dest_ptr_info->pt_vars
+ 	      && !bitmap_intersect_p (dest_ptr_info->pt_vars,
+ 				      orig_ptr_info->pt_vars))
+ 	    return false;
+ 	}
      }
  
    /* If the destination is a SSA_NAME for a virtual operand, then we have


More information about the Gcc-patches mailing list