This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47265] [4.6 Regression] Error: SSA name in freelist but still referenced
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jan 2011 10:47:38 +0000
- Subject: [Bug tree-optimization/47265] [4.6 Regression] Error: SSA name in freelist but still referenced
- Auto-submitted: auto-generated
- References: <bug-47265-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47265
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-25 10:47:29 UTC ---
(In reply to comment #5)
> Actually, there is a far easier fix. Either add
> if (all && !has_zero_uses (name))
> all = false;
> to the end of forward_propagate_addr_expr, or we could iterate some more,
> either like this:
> --- gcc/tree-ssa-forwprop.c.jj 2011-01-15 11:26:42.000000000 +0100
> +++ gcc/tree-ssa-forwprop.c 2011-01-25 11:22:02.828495766 +0100
> @@ -1061,6 +1061,8 @@ forward_propagate_addr_expr (tree name,
> bool all = true;
> bool single_use_p = has_single_use (name);
>
> + do
> + {
> FOR_EACH_IMM_USE_STMT (use_stmt, iter, name)
> {
> bool result;
> @@ -1113,6 +1115,7 @@ forward_propagate_addr_expr (tree name,
> gsi_remove (&gsi, true);
> }
> }
> + } while (all && !has_zero_uses (name));
>
> return all;
> }
>
> or say just once or say 4 times:
> int i;
> for (i = 0; i < 4; i++)
> {
> FOR_EACH_IMM_USE_STMT (use_stmt, iter, name)
> {
> ...
> }
> if (!all || has_zero_uses (name))
> return all;
> }
> return false;
Or simply
return all && has_zero_uses (name);
?