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]

Re: gcc const int expressions and negative constants


Hi Geoff,

Thanks for your reply.

Geoff Keating wrote:-

> > What I'm confused about is whether the correct form of constants
> > appearing in QImode expressions is (HOST_WIDE_INT) 255 or -1?  The
> 
> It's -1.

OK, in that case, if I understand your following statement correctly
(are you sure what you say is what you mean?)

> Probably something is not truncating QImode -1 into SImode 255 when
> converting between int and unsigned char in the expression
> 
> sign == 255

the RTL generated for this expression is incorrect?  This is the -dr
dump:-

(insn 21 20 22 (set (reg:CC 17 flags)
        (compare:CC (reg/v:QI 42)
            (const_int 255 [0xff]))) -1 (nil)
    (nil))

That should read (const_int -1 [0xffffffff]) ?

If that's true, I was in quite the wrong place in combine.c.  I'll
have a look at the RTL generation.  I think there's at least 3 bugs in
GNATs that have the same root cause as this one.

Neil.

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