[Bug middle-end/85344] Constant constraint check sign extends unsigned constant input operands

thopre01 at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 11 12:28:00 GMT 2018


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

Thomas Preud'homme <thopre01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--- Comment #4 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
(In reply to Thomas Preud'homme from comment #3)
> More worrying is that this code compiles without error when it should error
> out:
> 
> void
> foo (void)
> {
>   __asm( "%0" :: "J" ((unsigned char) 0x80));
> }

In which case we end up with #-128 in the assembly which is not what the user
wrote. Thus adding wrong-code tag.


More information about the Gcc-bugs mailing list