This is the mail archive of the gcc-patches@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]

Re: fix alpha gcc.dg/20040123-1.c


On Thu, Jun 16, 2005 at 07:33:44PM +0900, Kazuhiro Inaoka wrote:
> I'm using m32r-elf-gcc (3.4, 4.0, mainline).
> It has a same problem (FAIL: gcc.dg/20040123-1.c).
> Would you give me some idea to fix the problem?

The problematic transformation is here, gen_compare:

815           /* Reg/smallconst equal comparison.  */
816           if (compare_code == EQ
817               && GET_CODE (y) == CONST_INT
818               && CMP_INT16_P (INTVAL (y)))
819             {
820               rtx tmp = gen_reg_rtx (SImode);
821
822               emit_insn (gen_addsi3 (tmp, x, GEN_INT (-INTVAL (y))));

And another at line 694.  (It seems like this code could be reorganized
such that you don't need two copies of this code.)

As in the alpha patch, you can check REG_POINTER and suppress this particular
transformation.  Which looks as if it will fall through to the setcc insn.

You could add a second transformation using XOR here.  First, because XOR
has a different range of constants than PLUS, and so could be useful in
other cases.  But second because XOR will not suffer the same strong symbol
problem that the PLUS transformation does.



r~


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