This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Buggy peephole prevents bootstrap (i386)
- To: Zack Weinberg <zackw at Stanford dot EDU>
- Subject: Re: Buggy peephole prevents bootstrap (i386)
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Sat, 14 Oct 2000 15:17:31 +1100 (EST)
- cc: gcc-bugs at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>
On Fri, 13 Oct 2000, Zack Weinberg wrote:
> Ah, so the miscompilation of gen_rtx_CONST_INT is because we aren't
> changing j<cc> to jn<cc> then. I got confused by the enormous table
> of <cc>s in the architecture manual with no indication of whether
> they're signed or unsigned.
>
> The offending peepholes look like
>
> (define_peephole2
> [(set (reg 17)
> (compare (match_operand:SI 0 "register_operand" "")
> (const_int 128)))]
> "ix86_match_ccmode (insn, CCmode)
> && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
> [(parallel [(set (reg:CC 17)
> (compare:CC (neg:SI (const_int -128))
> (match_dup 0)))
> (clobber (match_dup 0))])]
> "")
>
> -- we need to make them permit only unsigned compare and update the
> jump insn. I don't know how to do either.
Changing
"ix86_match_ccmode (insn, CCmode)"
above to
"ix86_match_ccmode (insn, CCGCmode)"
ought to fix the problem by disallowing this peephole when you need to
test carry. Note that I'm not at all sure whether this is correct, as I'm
basing this on what I've gleaned from i386.h and i368.c about CCGCmode in
the last half hour... Attempting a bootstrap now.
Alan
--
Linuxcare. Support for the Revolution.