Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IMCC bug: Sub names are not labels?

4 views
Skip to first unread message

Luke Palmer

unread,
Jul 15, 2003, 4:54:58 AM7/15/03
to perl6-i...@perl.org
The following doesn't work:

.sub _main
newsub $P0, Sub, _foo
invokecc $P0
end
.end

.sub _foo
# ...
.end

Indeed, it can be done by using C<addr> and C<set>, but shouldn't sub
names be considered global labels, too?

Luke

Leopold Toetsch

unread,
Jul 15, 2003, 6:11:55 AM7/15/03
to Luke Palmer, perl6-i...@perl.org
Luke Palmer <fibo...@babylonia.flatirons.org> wrote:

[ bug ]

I've fixed it somehow - still calling conventions stuff is missing.
(the register allocator will happily globber the return continuation in
the sub if not written explictely as P1).

This works now:

.sub _main
newsub P0, .Sub, _foo # note the dot
invokecc P0
end
.end

.sub _foo
print "foo\n"
invoke P1
.end

> Luke

leo

Leopold Toetsch

unread,
Jul 15, 2003, 5:56:10 AM7/15/03
to Luke Palmer, perl6-i...@perl.org
Luke Palmer <fibo...@babylonia.flatirons.org> wrote:
> The following doesn't work:

[ snip ]

> Indeed, it can be done by using C<addr> and C<set>, but shouldn't sub
> names be considered global labels, too?

Of course. But newsub and the whole calling convention stuff isn't
finished yet. Meaning the newsub opcode doesn't work yet in PIR code,
global fixup is missing ...

> Luke

leo

0 new messages