This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Check for nonlocal goto in check_maybe_invariant
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 28 Apr 2004 13:12:45 -0700
- Subject: Re: Check for nonlocal goto in check_maybe_invariant
- References: <20040427204627.GA12061@atrey.karlin.mff.cuni.cz>
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