This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc const int expressions and negative constants
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: gcc const int expressions and negative constants
- From: Neil Booth <NeilB at earthling dot net>
- Date: Fri, 18 Aug 2000 00:00:19 +0100
- Bcc: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <E13PABJ-0006Gp-00@daikokuya.demon.co.uk> <jmg0o4yje2.fsf@envy.cygnus.com>
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.