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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> Well, I just noticed clang transforms it into:
> $ clang libavformat.i -w -S -O2 -o /dev/stdout | grep shr
>       shrl    $255, %eax

Well, GNU inline assembly is a GNU extension, how clang implemented the GNU
extension doesn't change anything on what GCC should and shouldn't do.
That said, if binutils rejects negative immediates and not also too large
immediates,
it is completely wrong.  IMHO it should reject neither, it is a runtime thing
what will happen.  E.g.
int
foo (int x)
{
  return x >> -1;
}
and similar can appear in dead code just fine, the important thing is not to
trigger
it at runtime.  GCC uses for 32-bit shifts on x86 actually "cI" constraint
rather than "ci" and so negative or too large shift counts will be reloaded
into %cl register and so it itself doesn't care.

Reply via email to