On Tue, Nov 12, 2024 at 9:30 PM Richard Biener
<richard.guent...@gmail.com> wrote:
>
> On Tue, Nov 12, 2024 at 1:49 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> >
> > When passing 0xff as an unsigned char function argument, the C frontend
> > promotion will promote it to int:
> >
> > <integer_cst 0x7fffe6aa23a8 type <integer_type 0x7fffe98225e8 int> constant 
> > 255>
> >
> > and expand_normal always returns the rtx value using the sign-extended
> > representation,
> >
> > (const_int 255 [0xff])
> >
> > If the C frontend doesn't promote unsigned char to int, expand_normal will
> > get
> >
> > <integer_cst 0x7fffe9824018 type <integer_type 0x7fffe9822348 unsigned char 
> > > co
> > nstant 255>
> >
> > and return
> >
> > (const_int -1 [0xffffffffffffffff])
>
> that looks wrong to me, but in other places we ensure
> to use trunc_int_for_mode (), not some odd function like
> you introduce here?

I opened:

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

-- 
H.J.

Reply via email to