aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-04-13 08:15:13 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-04-13 08:15:13 -0400
commit1f027d54a1f8d5ca34a8924eeea12af92d1075c8 (patch)
tree8555c9974c4d8993c048d6361a225f221916a92a /gcc/loop.c
parent51a96571d69e0bf21d9c5aa6c9e9251f3efe6647 (diff)
downloadgcc-1f027d54a1f8d5ca34a8924eeea12af92d1075c8.zip
gcc-1f027d54a1f8d5ca34a8924eeea12af92d1075c8.tar.gz
gcc-1f027d54a1f8d5ca34a8924eeea12af92d1075c8.tar.bz2
(invariant_p, case REG): Pointers into frame are not invariants if
function has nonlocal gotos. From-SVN: r13862
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 3e7bb58..698e7a1 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -2761,14 +2761,19 @@ invariant_p (x)
case REG:
/* We used to check RTX_UNCHANGING_P (x) here, but that is invalid
since the reg might be set by initialization within the loop. */
- if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
- || x == arg_pointer_rtx)
+
+ if ((x == frame_pointer_rtx || x == hard_frame_pointer_rtx
+ || x == arg_pointer_rtx)
+ && ! current_function_has_nonlocal_goto)
return 1;
+
if (loop_has_call
&& REGNO (x) < FIRST_PSEUDO_REGISTER && call_used_regs[REGNO (x)])
return 0;
+
if (n_times_set[REGNO (x)] < 0)
return 2;
+
return n_times_set[REGNO (x)] == 0;
case MEM: