public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix alias verifier buglet
@ 2004-07-30  8:52 Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2004-07-30  8:52 UTC (permalink / raw)
  To: gcc-patches


Found while working on another patch.


Diego.


	* tree-ssa.c (verify_flow_sensitive_alias_info): When
	comparing points-to sets of different pointers, make sure the
	second pointer is actually referenced in the code.

Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.25
diff -d -u -p -r2.25 tree-ssa.c
--- tree-ssa.c	28 Jul 2004 17:49:06 -0000	2.25
+++ tree-ssa.c	29 Jul 2004 19:48:24 -0000
@@ -471,7 +471,7 @@ verify_flow_sensitive_alias_info (void)
 	      tree ptr2 = ssa_name (j);
 	      struct ptr_info_def *pi2 = SSA_NAME_PTR_INFO (ptr2);
 
-	      if (!POINTER_TYPE_P (TREE_TYPE (ptr2)))
+	      if (!TREE_VISITED (ptr2) || !POINTER_TYPE_P (TREE_TYPE (ptr2)))
 		continue;
 
 	      if (pi2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Fix alias verifier buglet
@ 2004-07-29  2:50 Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2004-07-29  2:50 UTC (permalink / raw)
  To: gcc-patches


The alias verifier was only looking for may aliases inside memory tags. 
When we group aliases, regular variables will have may aliases as well.

This fixes the alias verification ICE in Ada.  Though I only made it so
far as to build stage2.  Ada dies while building stage3.

Bootstrapped and tested x86, x86-64 and ppc.


Diego.


	* tree-ssa.c (verify_flow_insensitive_alias_info): Process
	every variable that may have aliases, not just tags.

Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.24
diff -d -c -p -r2.24 tree-ssa.c
*** tree-ssa.c	28 Jul 2004 05:13:08 -0000	2.24
--- tree-ssa.c	28 Jul 2004 17:47:40 -0000
*************** verify_flow_insensitive_alias_info (void
*** 348,375 ****
  
    for (i = 0; i < num_referenced_vars; i++)
      {
        var_ann_t ann;
  
        var = referenced_var (i);
        ann = var_ann (var);
  
!       if (ann->mem_tag_kind == TYPE_TAG || ann->mem_tag_kind == NAME_TAG)
  	{
! 	  size_t j;
! 	  varray_type may_aliases = ann->may_aliases;
! 
! 	  for (j = 0; may_aliases && j < VARRAY_ACTIVE_SIZE (may_aliases); j++)
! 	    {
! 	      tree alias = VARRAY_TREE (may_aliases, j);
  
! 	      bitmap_set_bit (visited, var_ann (alias)->uid);
  
! 	      if (!may_be_aliased (alias))
! 		{
! 		  error ("Non-addressable variable inside an alias set.");
! 		  debug_variable (alias);
! 		  goto err;
! 		}
  	    }
  	}
      }
--- 348,372 ----
  
    for (i = 0; i < num_referenced_vars; i++)
      {
+       size_t j;
        var_ann_t ann;
+       varray_type may_aliases;
  
        var = referenced_var (i);
        ann = var_ann (var);
+       may_aliases = ann->may_aliases;
  
!       for (j = 0; may_aliases && j < VARRAY_ACTIVE_SIZE (may_aliases); j++)
  	{
! 	  tree alias = VARRAY_TREE (may_aliases, j);
  
! 	  bitmap_set_bit (visited, var_ann (alias)->uid);
  
! 	  if (!may_be_aliased (alias))
! 	    {
! 	      error ("Non-addressable variable inside an alias set.");
! 	      debug_variable (alias);
! 	      goto err;
  	    }
  	}
      }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-29 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-30  8:52 Fix alias verifier buglet Diego Novillo
  -- strict thread matches above, loose matches on Subject: below --
2004-07-29  2:50 Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).