This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix latent bug in cse
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Tue, 31 Dec 2002 00:41:54 +0100
- Subject: Fix latent bug in cse
Hi,
another latent bug found by new checking code. This time cse attempts to
replace load by reg-reg move (as the value is known to be in register), but
does so by emitting the move after load and keeping load around.
This does not work, since the load won't get elliminated by the dead code removal
and remains in the middle of basic block.
Bootstrapped/regtested i386. Ok for mainline? I am checking this to rtlopt to let it bootstrap.
Honza
Tue Dec 31 00:36:52 CET 2002 Jan Hubicka <jh@suse.cz>
* cse.c (cse_set_around_loop): Do not rely on dead code removal to kill
the dead set.
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.231.2.4
diff -c -3 -p -r1.231.2.4 cse.c
*** cse.c 18 Dec 2002 10:35:12 -0000 1.231.2.4
--- cse.c 30 Dec 2002 23:36:33 -0000
*************** cse_set_around_loop (x, insn, loop_start
*** 6804,6809 ****
--- 6804,6810 ----
SET_SRC, add an insn after P to copy its destination
to what we will be replacing SET_SRC with. */
if (cse_check_loop_start_value
+ && single_set (p)
&& validate_change (insn, &SET_SRC (x),
src_elt->exp, 0))
{
*************** cse_set_around_loop (x, insn, loop_start
*** 6822,6828 ****
abort ();
}
else
! emit_insn_after (move, p);
}
break;
}
--- 6823,6832 ----
abort ();
}
else
! {
! emit_insn_after (move, p);
! delete_insn (p);
! }
}
break;
}