This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Check for nonlocal goto in check_maybe_invariant


Zdenek Dvorak wrote:
this code is in loop.c:loop_invariant_p:
Why do we check current_function_has_nonlocal_goto here?

If you have a nonlocal goto inside a loop, then you are going to have insns that modify the frame pointer inside the loop. Of course, you are going to immediately exit the loop right after changing the fp, but maybe there was a case where part of the non-local goto sequence was incorrectly optimized because we thought the fp was loop invariant.


The check was added here:
Sun Apr 13 08:15:31 1997 Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>


        * loop.c (invariant_p, case REG): Pointers into frame are not
        invariants if function has nonlocal gotos.
        * reload1.c (reload): If function has nonlocal label, mark all
        caller-saved regs as used.

This predates gcc.gnu.org, so I can't easily find a mail message discussing it.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]