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

[perl #38264] Bug in compute_dominance_frontiers?

1 view
Skip to first unread message

Bob Rogers

unread,
Jan 17, 2006, 10:19:14 PM1/17/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Bob Rogers
# Please include the string: [perl #38264]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38264 >


The attached code compiles to byte code OK in r11235, until you
comment out the push_eh indicated by the patch, which makes
compute_dominance_frontiers take forever. (Sorry; I wish I had time to
try to make it smaller.) TIA,

-- Bob Rogers
http://rgrjr.dyndns.org/


toy-lisp.imc
commented-push-eh.patch

Jonathan Worthington

unread,
Jan 18, 2006, 7:12:43 AM1/18/06
to perl6-i...@perl.org, bugs-bi...@rt.perl.org, cgr...@gmail.com
"Bob Rogers (via RT)" <parrotbug...@parrotcode.org> wrote:
>
> The attached code compiles to byte code OK in r11235, until you
> comment out the push_eh indicated by the patch, which makes
> compute_dominance_frontiers take forever. (Sorry; I wish I had time to
> try to make it smaller.) TIA,
>
I hit upon this the other day, but with a 4,500 line PIR file which I've
also failed to get to a better test case. I'll see what I can do.

In the meantime, we don't actually need compute_dominance_frontiers unless
we are optimizing so far as I can see, so I have ci'd a change to only do
that when the optimize flag is set.

I've cc'd in Curtis Rawls who I believe implemented the routine - Curtis,
any chance you may have time to have a quick look at this?

Thanks,

Jonathan

Bob Rogers

unread,
Jan 19, 2006, 9:39:06 PM1/19/06
to parrotbug...@parrotcode.org, Jonathan Worthington, cgr...@gmail.com
Here's some further background:

On 14-Jan-06 I had done some hacking on my compiler using r11187, and
all worked fine when I did my last checkin that day. When I updated to
r11220 late on 16-Jan-06, doing the standard "make clean test" on my
code broke mysteriously in a number of places. I found two separate
syndromes by the time I had to quit:

1. Several of the cases were segfaulting; the only one I looked at
in detail was doing mark_context from Parrot_Closure_mark.

2. One case reported ":outer '_test_1' not found" where _test_1
existed but declared no lexicals (i.e. the "closure" had no variables
closed over); deleting the :outer construct from the inner sub made it
work. I was tracking this down when I stumbled onto the
compute_dominance_frontiers issue, which I assumed was yet another bug.

But maybe not. This evening, after updating to Parrot r11257, doing
"make clean test" on my code worked just fine. That suggests that
compute_dominance_frontiers became subtly broken between r11187 and
r11220, but too subtly for the test suite to detect it (which is kinda
scary).

FWIW, if I try 'parrot -O1' or 'parrot -O2' in r11257, it doesn't
even compile my code; it segfaults in branch_reorg in some place
completely different. Caveat optimizator, I guess . . .

-- Bob

P.S. I needed to resend this in order to get it into RT.

Curtis Rawls

unread,
Jan 20, 2006, 1:07:04 AM1/20/06
to Jonathan Worthington, perl6-i...@perl.org, bugs-bi...@rt.perl.org
On 1/18/06, Jonathan Worthington <jona...@jwcs.net> wrote:
> "Bob Rogers (via RT)" <parrotbug...@parrotcode.org> wrote:
> >
> > The attached code compiles to byte code OK in r11235, until you
> > comment out the push_eh indicated by the patch, which makes
> > compute_dominance_frontiers take forever. (Sorry; I wish I had time to
> > try to make it smaller.) TIA,
> >
> I hit upon this the other day, but with a 4,500 line PIR file which I've
> also failed to get to a better test case. I'll see what I can do.
>
> In the meantime, we don't actually need compute_dominance_frontiers unless
> we are optimizing so far as I can see, so I have ci'd a change to only do
> that when the optimize flag is set.

In fact, the dominance frontier information is only useful for SSA,
which is not completed, so you would be just as well off commenting
out the entire compute_dominance_frontiers call in reg_alloc.c until
it is needed.

> I've cc'd in Curtis Rawls who I believe implemented the routine - Curtis,
> any chance you may have time to have a quick look at this?

I don't see that any changes have been made to the algorithm itself,
so I guess the dominator tree input has been altered in some way that
was assumed to be stable. If there was a smaller failing test case I
could try to debug it and see what's going on.
-Curtis

>
> Thanks,
>
> Jonathan

Bob Rogers

unread,
Jan 19, 2008, 3:41:24 PM1/19/08
to parrotbug...@parrotcode.org, Jonathan Worthington
Prompted by the optimizer bug submitted by Geoffrey Broadwell (see
https://rt.perl.org/rt3/Ticket/Display.html?id=49968), I decided to
revisit this one. After updating, I got the code to compile under
Parrot r24875. So either the original problem was somehow fixed, or it
shifted in such a way that the test case no longer triggers it. Either
way, this ticket should probably be closed. (But I don't seem to be
able to do this.)

P.S. All of the updates were obvious (change "PerlInt" to "Integer",
etc.), so I see no point in attaching the updated PIR code.

0 new messages