This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix (hopefully) x86_64 bootstrap failure
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 14 Dec 2003 12:55:33 +0100
- Subject: Re: [tree-ssa] Fix (hopefully) x86_64 bootstrap failure
- References: <200312140142.hBE1g6sV018363@speedy.slc.redhat.com>
>
> Sigh. Via a wonderful series of events we had an SSA_NAME on the freelist,
> but still referenced in the IL. Not good.
>
> This patch avoids the problem by not removing PHI nodes (and thus freeing
> SSA_NAMES) until such point as we can do a full CFG cleanup which
> will ensure that all references to dead/unused variables will be wiped
> out together.
>
> This makes flow.i build with an x86_64 cross compiler and hopefully brings
> it back to bootstrapping status.
>
> I've also bootstrapped and regression tested this on i686-pc-linux-gnu.
>
> * tree-ssa-dom.c (optimize_stmt): Don't call cleanup_control_expr
> here. Instead just note that we need to cleanup the cfg (which
> will DTRT).
Interesting :)
It would be nice to try update checkers for such a easilly verifiable
bits so they become more usefull (or anoying?). Does the attached patch
look OK? (connection to my testing machine broke for some reason, but
it got bootstrapped i686-pc-gnu-linux at least)
Honza
* tree-cfg.c (verify_addr_expr): Rename to ....
(verify_expr): ... this one; check that no SSA names are on
freelist.
(verify_stmt, verify_stmts): Update calls of verify_addr_expr.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.230
diff -c -3 -p -r1.1.4.230 tree-cfg.c
*** tree-cfg.c 6 Dec 2003 12:31:27 -0000 1.1.4.230
--- tree-cfg.c 14 Dec 2003 11:47:52 -0000
*************** has_label_p (basic_block bb, tree label)
*** 2791,2799 ****
properly noticed as such. */
static tree
! verify_addr_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
! void *data ATTRIBUTE_UNUSED)
{
if (TREE_CODE (*tp) == ADDR_EXPR)
{
tree x = TREE_OPERAND (*tp, 0);
--- 2791,2805 ----
properly noticed as such. */
static tree
! verify_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
! void *data ATTRIBUTE_UNUSED)
{
+ if (TREE_CODE (*tp) == SSA_NAME
+ && SSA_NAME_IN_FREE_LIST (*tp))
+ {
+ error ("SSA name in freelist still referred");
+ return *tp;
+ }
if (TREE_CODE (*tp) == ADDR_EXPR)
{
tree x = TREE_OPERAND (*tp, 0);
*************** verify_addr_expr (tree *tp, int *walk_su
*** 2805,2811 ****
if (TREE_CODE (x) != VAR_DECL && TREE_CODE (x) != PARM_DECL)
return NULL;
if (!TREE_ADDRESSABLE (x))
! return x;
}
return NULL;
}
--- 2811,2820 ----
if (TREE_CODE (x) != VAR_DECL && TREE_CODE (x) != PARM_DECL)
return NULL;
if (!TREE_ADDRESSABLE (x))
! {
! error ("Address taken, but ADDRESABLE bit not set");
! return x;
! }
}
return NULL;
}
*************** verify_stmt (tree stmt)
*** 2827,2836 ****
debug_generic_stmt (stmt);
return true;
}
! addr = walk_tree (&stmt, verify_addr_expr, NULL, NULL);
if (addr)
{
- error ("Address taken, but ADDRESABLE bit not set");
debug_generic_stmt (addr);
return true;
}
--- 2836,2844 ----
debug_generic_stmt (stmt);
return true;
}
! addr = walk_tree (&stmt, verify_expr, NULL, NULL);
if (addr)
{
debug_generic_stmt (addr);
return true;
}
*************** verify_stmts (void)
*** 2915,2924 ****
err |= true;
}
! addr = walk_tree (&t, verify_addr_expr, NULL, NULL);
if (addr)
{
- error ("Address taken, but ADDRESABLE bit not set");
debug_generic_stmt (addr);
err |= true;
}
--- 2923,2931 ----
err |= true;
}
! addr = walk_tree (&t, verify_expr, NULL, NULL);
if (addr)
{
debug_generic_stmt (addr);
err |= true;
}