Mainline space problem

James E Wilson wilson@specifixinc.com
Fri Sep 3 05:12:00 GMT 2004


On Tue, 2004-08-31 at 21:17, Bradley Lucier wrote:
> I found that the example program compiled on July 20 and didn't on July 
> 24.

The change that broke it is a cleanup patch from Richard Henderson.
    http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02228.html
The part that specifically caused the problem is the may_be_aliased
change.  Instrumenting this, I see that the old one returns true for
extern variables, but the new one returns false for them.  This is
because there is a !TREE_STATIC check for automatic variables, but
externs also are !TREE_STATIC.  This seems to be a legitimate bug.

With the attached patch, the may_be_aliased function gives the same
result as before for all variables for this testcase.  The testcase can
be compiled again, using about 10K pseudos instead of about 130K
pseudos.

I started a ppc-darwin build to test this.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

-------------- next part --------------
2004-09-02  James E Wilson  <wilson@specifixinc.com>

	* tree-ssa-alias.c (may_be_aliased): Move TREE_STATIC check after
	DECL_EXTERNAL check.

Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.25
diff -p -r2.25 tree-ssa-alias.c
*** tree-ssa-alias.c	25 Aug 2004 21:21:16 -0000	2.25
--- tree-ssa-alias.c	3 Sep 2004 04:44:03 -0000
*************** may_be_aliased (tree var)
*** 2467,2481 ****
    if (TREE_ADDRESSABLE (var))
      return true;
  
-   /* Automatic variables can't have their addresses escape any other way.  */
-   if (!TREE_STATIC (var))
-     return false;
- 
    /* Globally visible variables can have their addresses taken by other
       translation units.  */
    if (DECL_EXTERNAL (var) || TREE_PUBLIC (var))
      return true;
  
    /* If we're in unit-at-a-time mode, then we must have seen all occurrences
       of address-of operators, and so we can trust TREE_ADDRESSABLE.  Otherwise
       we can only be sure the variable isn't addressable if it's local to the
--- 2467,2483 ----
    if (TREE_ADDRESSABLE (var))
      return true;
  
    /* Globally visible variables can have their addresses taken by other
       translation units.  */
    if (DECL_EXTERNAL (var) || TREE_PUBLIC (var))
      return true;
  
+   /* Automatic variables can't have their addresses escape any other way.
+      This must be after the check for global variables, as extern declarations
+      do not have TREE_STATIC set.  */
+   if (!TREE_STATIC (var))
+     return false;
+ 
    /* If we're in unit-at-a-time mode, then we must have seen all occurrences
       of address-of operators, and so we can trust TREE_ADDRESSABLE.  Otherwise
       we can only be sure the variable isn't addressable if it's local to the


More information about the Gcc mailing list