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]

Aliasing patch for tree-optimization/28778


I attached a patch to Bugzilla that fixes this bug at the revision it first
appeared.  The current code has changed a bit, but the basic problem seems
to be the same.

  # blistD.1872_1 = PHI <blistD.1872_3(3), blistD.1872_6(4)>;
<L2>:;
  blist.0D.1874_7 = (const GLintD.1866 *) blistD.1872_1;
  #   SMT.5D.1883_9 = V_MAY_DEF <SMT.5D.1883_8>;

Variable: blistD.1872, UID 1872, const intD.0 *

Variable: blist.0D.1874, UID 1874, const GLintD.1866 *, symbol memory tag:
SMT.5D.1883

Variable: SMT.5D.1883, UID 1883, const GLintD.1866, is addressable, is
global, call clobbered (, passed to call, is global var )

structalias knows that blistD.1872_1 could point to list.  But, it never
reports that information, because it also knows that it could point to
&ANYTHING.  As a result nothing ever marks list as escaping, and it never
gets marked as call clobbered.

If blist is an int* instead, then there's no blist.0_7 involved, and so we
notice that blist_1 escapes.  That makes things work out all right.

I fixed this before by allowing variables to have both pt_anything and
pt_vars in one more case.  But nowadays set_pt_anything clears pt_vars, so I
have the impression that either:

  - this isn't working the way it's supposed to, and list should be marked
    call clobbered through some other mechanism.

  - or confusion about what pt_anything is supposed to mean has spread
    further through the code.

This patch, which I've tested on x86_64-pc-linux-gnu, fixes the test case.
But I'm not entirely sure it's the right way to do it.  If it is, should
set_pt_anything not clobber pt_vars?  If it's not, should aliasing be
solving escaping as a dataflow problem to get the full set, so that we know
what "clobbers anything" really clobbers?

Comments appreciated.

-- 
Daniel Jacobowitz
CodeSourcery

2006-08-25  Daniel Jacobowitz  <dan@codesourcery.com>

	PR tree-optimization/28778
	* tree-ssa-structalias.c (find_what_p_points_to): Don't bail out
	for pt_anything.

Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c	(revision 116400)
+++ tree-ssa-structalias.c	(working copy)
@@ -4227,9 +4227,6 @@ find_what_p_points_to (tree p)
 		}
 	    }
 
-	  if (pi->pt_anything)
-	    return false;
-
 	  if (!pi->pt_vars)
 	    pi->pt_vars = BITMAP_GGC_ALLOC ();
 


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