This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783

--- Comment #21 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Michael Karcher from comment #20)
> Of course. The instructions involving src_reg in make_not_reg_insn dealing
> with src_reg are completely quoted here:
> 
> +  // On SH we can do only SImode and DImode comparisons.
> +  if (! (GET_MODE (src_reg) == SImode || GET_MODE (src_reg) == DImode))
> +    return NULL;
> 
> In this fragment, you accept DImode source operands. So that code may be
> used to replace a DImode compare.
> 
> +  emit_insn (gen_rtx_SET (VOIDmode, m_ccreg,
> +			  gen_rtx_fmt_ee (EQ, SImode, src_reg, const0_rtx)));
> 
> In this fragment, you are generating the replacement instruction, which is
> always an SImode compare. Maybe I miss the point, but I fail to undestand
> how an SImode compare might be acceptable on an DImode operand. Possibly,
> this even ICEs, I don't know enough about gcc internals to know what happens
> if src_reg is DImode which is passed to EQ in SImode.

The SImode refers to the result of the EQ, not the operands.  In sh.md the
pattern cmpeqdi_t will be picked up for this.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]