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

--- Comment #4 from jbeulich at suse dot com ---
(In reply to Jakub Jelinek from comment #1)
> GCC inline asm has always worked like that, the operand is 8-bit and in GCC
> constants are always sign-extended.

But then ...

> If you try just
> static inline unsigned int
> foo (unsigned int a, signed char s)
> {
>   asm volatile ("# %1" : "+r" (a) : "ic" ((unsigned char) -s));

this should be sign-extension of the supplied value, i.e. the (potentially
negative) value cast to "unsigned char". And gas will be happy to accept that.

> In the assembly, if you have a spot which accepts 8-bit quantity, one
> shouldn't care if it is signed or unsigned.

I firmly disagree: I assume you did look at the description of the gas change.
A negative value for SHL may (by some) be viewed as reasonable (and as said in
the submission, I could have been convinced to further relax things, provided
fair arguments), but a negative value for RCL firmly is rubbish and hence
should have been rejected years ago.

Reply via email to