[tree-ssa] ssa copy-prop issue

Jason Merrill jason@redhat.com
Wed Jun 4 22:35:00 GMT 2003


I've recently been working on a patch to always evaluate expressions into
temps before copying them into user vars, so we can catch more
redundancies.  In doing so, I ran into an assign_vars crash in
cp/name-lookup.c:binding_table_expand.

The gimplified code looks like

...
  F.30 = table->chain;
  old_chains = F.30;
...
  while (1)
    {
      ...
              F.31 = i * 4;
              F.32 = (struct binding_entry_s * *)F.31;
HERE->        F.33 = old_chains + F.32;
              F.44 = entry->chain;
              *F.33 = F.44;
              F.30 = table->chain;
              F.45 = j * 4;
              F.46 = (struct binding_entry_s * *)F.45;
              F.47 = F.30 + F.46;
              F.48 = *F.47;
              entry->chain = F.48;
      ...
    }   

At HERE, rewrite_stmt thinks it can substitute F.30 for old_chains because
there's no live definition of F.30 at that point.  But if you do that,
suddenly that definition of F.30 needs to live until we exit the loop,
including across the lifetime of the definition later in the loop.  So we
have a conflict that we can't deal with yet.

Basically, the !var_is_live test isn't conservative enough.  Commenting it
out fixes bootstrap/test with my patch.  Would you mind if I check in such
a change until out-of-ssa is ready?

Jason



More information about the Gcc mailing list