summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2002-11-04 20:06:28 +0000
committerDale Johannesen <dalej@gcc.gnu.org>2002-11-04 20:06:28 +0000
commit2aff950822bee20e1398a2a528ad927740f799f8 (patch)
tree757f262de1fc974cf8a0f7aebb26aea20afbf563 /gcc/loop.c
parente86e721fc7b44cdd46c72f60de48af228d7df4b9 (diff)
downloadgcc-2aff950822bee20e1398a2a528ad927740f799f8.tar.gz
Fix bugs that showed up building Spec on ppc darwin.
From-SVN: r58800
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 9461530e894..04f95ab4925 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -3273,6 +3273,13 @@ loop_invariant_p (loop, x)
&& REGNO (x) < FIRST_PSEUDO_REGISTER && call_used_regs[REGNO (x)])
return 0;
+ /* Out-of-range regs can occur when we are called from unrolling.
+ These have always been created by the unroller and are set in
+ the loop, hence are never invariant. */
+
+ if (REGNO (x) >= regs->num)
+ return 0;
+
if (regs->array[REGNO (x)].set_in_loop < 0)
return 2;