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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to jbeulich from comment #9)
> (In reply to Jakub Jelinek from comment #1)
> > How does that look like a gcc bug?  It is either a binutils bug for not
> > accepting it anymore, or ffmpeg-4 bug for relying on the negative shifts.
> 
> While I'm not sure in how far reduction from original code has discarded too
> much context, the impression I'm getting is that they use inline assembly
> because if the same way expressed in a similar way in C, the compiler would
> warn. And then, rather than making the expression match C standard
> requirements, assembly code was used instead to silence that diagnostic.

Of course the code could use whatever_32bit >> (count & 31) and GCC wouldn't
warn
and on arches like x86 where the shr instruction does effectively the masking
would fold the masking into the actual shift instruction.  Plus, it would mask
constants at compile time to the right range.

Reply via email to