From 88016fb7ef61bcc40b7cf8b1d6c6511a8896f594 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 27 Aug 1997 16:43:23 +0000 Subject: [PATCH] loop.c (combine_movables): Earlier insns don't match later ones. * loop.c (combine_movables): Earlier insns don't match later ones. Brought over from the fsf. From-SVN: r14966 --- gcc/ChangeLog | 4 ++++ gcc/loop.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0483a4f8e25..473e0e2d410 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 27 01:56:18 1997 Doug Evans + + * loop.c (combine_movables): Earlier insns don't match later ones. + Wed Aug 27 01:24:25 1997 H.J. Lu (hjl@gnu.ai.mit.edu) * config/linux.h (CC1_SPEC): Define it only if not defined. diff --git a/gcc/loop.c b/gcc/loop.c index f924e2a7416..5e0d1d1dac6 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -1342,7 +1342,9 @@ combine_movables (movables, nregs) bzero (matched_regs, nregs); matched_regs[regno] = 1; - for (m1 = movables; m1; m1 = m1->next) + /* We want later insns to match the first one. Don't make the first + one match any later ones. So start this loop at m->next. */ + for (m1 = m->next; m1; m1 = m1->next) if (m != m1 && m1->match == 0 && n_times_used[m1->regno] == 1 /* A reg used outside the loop mustn't be eliminated. */ && !m1->global -- 2.30.2