On 12/21/06, Diego Novillo <[EMAIL PROTECTED]> wrote:
Robert Kennedy wrote on 12/21/06 11:37:
> The situation is that some SSA_NAMEs are disused (removed from the
> code) without being released onto the free list by
> release_ssa_name().
>
Yes, it happens if a name is put into the set of names to be updated by
update_ssa.
After update_ssa, it should be true that every SSA name with no
SSA_NAME_DEF_STMT is in the free list.
In this case this isn't true, because we have code that orphans ssa
names without releasing them.
I'm sure Robert will explain further details in a few moments :)
However, if we have SSA names with no defining statement that are still
in considered active, I would hardly consider it a serious bug. It's a
waste of memory, which you are more than welcome to fix, but it should
not cause correctness issues.
It will cause not code correctness issues, but make life very very
annoying. If you walk the ssa names one by one, and you have some
pointing to statements that don't exist anymore, because the names
were not released and defining statements nulled out by
release_ssa_name, you are going to run into segfaults trying to walk
them.
This is exactly what happens in the case we have.
BTW, the reason we walk the list of ssa names is to DFS them.
IE the code is someting like:
for (i = 0; i < num_ssa_names; i++)
{
tree name = ssa_name (i);
if (name && !SSA_NAME_IN_FREELIST (name)
DFS (name)
}
IIRC, DFS will crash trying to touch the def statement because it's
been GC'd if the ssa name is orphaned.
Anyway, it seems you still agree this is a bug in any case, even if
you don't think it's a serious bug.