From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Christian Iseli Cc: egcs@cygnus.com Subject: Re: Infinite loop in init_alias_analysis Date: Tue, 04 Nov 1997 05:49:00 -0000 Message-id: <8225.878651459@hurl.cygnus.com> References: <199711041226.NAA07119@Rivendell.MiddleEarth.net> X-SW-Source: 1997-11/msg00136.html In message < 199711041226.NAA07119@Rivendell.MiddleEarth.net >you write: > 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. Sorry, I really can't follow your problem description. Typically, when the alias code looped, that indicated that some register that could hold a pointer at function entry wasn't put into the new_reg_base_value array -- for example the static chain, or structure value address tweaked this problem when I was working on the code. > 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)), OK. > (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) OK. > - Now the first iteration terminates and the values from new_reg_base_value OK. > > 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... Sorry, this is where you lost me. Can you describe this better? What are the arguments for the relavent calls to find_base_value? What does find_base_value return for those calls? How does this set up a condition where we always think something changed? Can you describe exactly what registers have pointer values in them at function start? An RTL dump of the function in question might be useful too. > I'm not sure what's the best fix... > - set reg_seen of the argument register when it is copied to the pseudo ? I don't think this is right -- reg_seen tracks which registers have been set, not the registers that were used as sources of sets. > - avoid the part before NOTE_INSN_FUNCTION_BEG in subsequent loop > iterations No, I think this is wrong too -- seems to me that you have to be consistent in how you handle argument copying each time through the loop. > - do some clever testing of new_reg_base_value and reg_base_value ? Such as? > - reverse the if statements in the REG case in find_base_value ? Hmmm, I don't think this is right either. > What do you think? I think we need more information :-) The one thing I'd considered was setting new_reg_base_value from reg_base_value at the bottom of the loop. I couldn't ever come up with a compelling reason why it would be needed, but maybe you have. I'd need more information to make that decision though. jeff