* Check for nonlocal goto in check_maybe_invariant
@ 2004-04-27 22:39 Zdenek Dvorak
2004-04-28 22:05 ` Jim Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Zdenek Dvorak @ 2004-04-27 22:39 UTC (permalink / raw)
To: gcc
Hello,
this code is in loop.c:loop_invariant_p:
case REG:
if ((x == frame_pointer_rtx || x == hard_frame_pointer_rtx
|| x == arg_pointer_rtx || x == pic_offset_table_rtx)
&& ! current_function_has_nonlocal_goto)
return 1;
Why do we check current_function_has_nonlocal_goto here?
Zdenek
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Check for nonlocal goto in check_maybe_invariant
2004-04-27 22:39 Check for nonlocal goto in check_maybe_invariant Zdenek Dvorak
@ 2004-04-28 22:05 ` Jim Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2004-04-28 22:05 UTC (permalink / raw)
To: Zdenek Dvorak; +Cc: gcc
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-28 20:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-27 22:39 Check for nonlocal goto in check_maybe_invariant Zdenek Dvorak
2004-04-28 22:05 ` Jim Wilson
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).