Is regmove.c:discover_flags_reg still needed?
Jim Wilson
wilson@specifixinc.com
Wed Jun 9 02:41:00 GMT 2004
Daniel Jacobowitz wrote:
> But GET_CODE of the result of gen_add3_insn is generally going to be INSN.
> I went back to a Mar. 1999 snapshot to check, and it was a SET; my guess is
> that the changes to not emit needless SEQUENCE rtl changes the result of
> gen_sequence for a single insn. But discover_flags_reg has probably been
> returning pc_rtx (i.e. "confused") since then. It's easy to fix this but
> that suggests the code is no longer necessary...
From looking at the code, it appears that it is still necessary, but it
may be that the failure case is very rare, or no longer occurs because
of other bugs, or other changes to the compiler.
The main problem case seems to be the one where code is set to MINUS,
which leads to a later emit_insn_after call. If we can hit here, we can
have a problem. We could perhaps try adding an abort to see if this
code ever executes anymore.
There is a second case where overlap is true, that leads to a
emit_insn_after_with_line_notes call that may also be a problem.
The patch appeared here:
http://gcc.gnu.org/ml/gcc-patches/1999-02n/msg00489.html
Unfortunately there is no testcase, but it explains why the patch is
necessary.
Just looking at gen_add3_insn calls, there appears to be a second place
where it is used wrong, feeding into a validate_change call.which is
expecting a SET instead of an INSN.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list