public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Infinite loop in init_alias_analysis
@ 1997-11-04  4:26 Christian Iseli
  1997-11-04  5:49 ` Jeffrey A Law
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Iseli @ 1997-11-04  4:26 UTC (permalink / raw)
  To: egcs

Hi there,

I got an infinite loop while compiling sone test code here.  I think I have 
tracked down the
problem to the new (as of snapshot 971031) code in alias.c, in the 
init_alias_analysis routine,
in the while (changed) loop.

Things happen in the following way:
- During the first iteration of the loop, new_reg_base_value[24] is set to 
(address (reg:HI 1 %r3)),
  (reg 1 is a FUNCTION_ARG_REGNO_P) while copying_arguments is true.
- Later in the function, new_reg_base_value[1] is set to (reg/v:HI 24)

- Now the first iteration terminates and the values from new_reg_base_value 
are copied into
  reg_base_value.
- In the next loop iteration, find_base_value is called and promptly returns 
the values it finds
  in reg_base_value, which yields to new_reg_base_value[24] => (reg/v:HI 24) 
and
  new_reg_base_value[1] => (address (reg:HI 1 %r3))
- And so on...

I'm not sure what's the best fix...
  - set reg_seen of the argument register when it is copied to the pseudo ?
  - avoid the part before NOTE_INSN_FUNCTION_BEG in subsequent loop iterations 
?
  - do some clever testing of new_reg_base_value and reg_base_value ?
  - reverse the if statements in the REG case in find_base_value ?

What do you think?

					Christian



^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Infinite loop in init_alias_analysis
@ 1997-11-05  4:30 Christian Iseli
  1997-11-05  9:26 ` Jeffrey A Law
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Iseli @ 1997-11-05  4:30 UTC (permalink / raw)
  To: law; +Cc: egcs

> Yup.  Having HJ's alpha failure to look at was a big help too.  This
> is a case where an RTL dump from the pass before the alias code hung
> would have been quite useful since I can't just build your target
> and look at it under the debugger :-)

Right.  I'll keep that in mind...

> Just to be sure.  I assume you've got something like this
> in your RTL dump:
> 
> (set (reg 24) (reg 1)
> NOTE_INSN_FUNCTION_BEGIN
> ...
> (set (reg 1) (reg 24))
> ...

Yup, exactly.

> HJ's alpha example is actually one copy deeper, but the same
> basic problem:

I was wondering if longer cycles were likely to happen.  Now I know :-)

> Now that I've had a chance to look at the code, I suspect either
> your solution or mine will work.  Mine converges quicker, but I'm
> somewhat leery that for some weird example the quicker convergence
> might be to the wrong state :(

What's your solution?

>   > I hope I was more clear this time.
> Yup.  I'm going to add a comment or two and use your solution.

Ok, thanks.  Waiting for the next snapshot... ;-)

					Christian

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Infinite loop in init_alias_analysis
@ 1997-11-05  9:26 Christian Iseli
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Iseli @ 1997-11-05  9:26 UTC (permalink / raw)
  To: law; +Cc: egcs

>   > What's your solution?
> Instead of wiping new_reg_base_value clean at the start of the loop,
> you copy entries from reg_base_value to it.   Problem is I can't
> convince myself this is the right thing to do, but I can convince
> myself that your solution is the right thing to do.

I'll let you be the judge on this one :)

					Christian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-11-05  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-04  4:26 Infinite loop in init_alias_analysis Christian Iseli
1997-11-04  5:49 ` Jeffrey A Law
1997-11-04 12:32   ` Christian Iseli
1997-11-04 15:39     ` Jeffrey A Law
1997-11-05  4:30 Christian Iseli
1997-11-05  9:26 ` Jeffrey A Law
1997-11-05  9:26 Christian Iseli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).