[perl #36407] [BUG] imcc - register allocation

Christoph Otto via RT parrotbug-followup at parrotcode.org
Mon Apr 20 08:22:21 UTC 2009


On Fri Apr 17 20:09:10 2009, cotto wrote:
> On Sun Jun 15 06:26:12 2008, chromatic at wgz.org wrote:
> > On Sunday 15 June 2008 03:31:56 Patrick R. Michaud wrote:
> > 
> > > On Sat, Jun 14, 2008 at 08:58:22PM -0400, Bob Rogers wrote:
> > > > [...]  And
> > > > the easiest fix would be to decide not to support it at all.
> > > +1.  Another +1 if we can somehow get IMCC to report an error
> > > when there's a label/symbol conflict.
> > 
> > I think that may be possible.  I'll look into it while I'm fixing
> > another bug
> > in register allocation today.
> > 
> > -- c
> > 
> 
> The attached patch makes imcc fail more gracefully when a symreg and a
> label have the same name.  I'm not exactly sure if this is the kind of
> fix that we're looking for, but it does report the correct line number
> for rgrjr's example.

The attached (updated) patch makes imcc catch two cases; when a named
variable is defined having the name of an existing label, and vice
versa.  Both are fatal, as they can cause very misleading error
messages.  The change causes a couple test failures and will probably
have to wait until after the next deprecation cycle, but it's only a
couple more months on a nearly 4-year-old ticket.

Ideally imcc would use a smart enough symbol table to differentiate
between labels and variable names, but it doesn't and that's why it's on
the way out.

I don't think there are any more cases that imcc needs to deal with, as
opcodes seem to work correctly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imcc_duplicate_symbols_fix2.patch
Type: text/x-diff
Size: 2719 bytes
Desc: not available
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20090420/ebee45ab/attachment.bin>


More information about the parrot-dev mailing list