[FFmpeg-devel] [PATCH] remove gcc 3.3 workaround in swscale_template.c

Reimar Döffinger Reimar.Doeffinger
Sun Sep 20 19:12:44 CEST 2009

On Sun, Sep 20, 2009 at 06:53:36PM +0200, Diego Biurrun wrote:
> There's an ugly preprocessor gcc 3.3 workaround in swscale_template.c:
>   /* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here,
>      which is needed to support GCC 4.0. */
>   #if ARCH_X86_64 && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
>                   :: "m" (src1), "m" (dst), "g" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
>   #else
>                   :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
>   #endif
> At the very least it should be updated to use the AV_GCC_VERSION_AT_LEAST
> macro from libavutil.  However, I would prefer to get rid of it
> completely.  If I understand the comment correctly, deleting the whole
> #else clause would be the way to achieve this.  Since I know little
> enough assembler to have no real idea what "g" and "m" operands are all
> about I'd like to hear an informed opinion.

Huh? No, the upper line should give faster code but causes crashes due
to miscompilation with gcc 3.3
The lower line does not compile with gcc 4.0 on x86_64 but produces correct code
with 3.3.
At least that's what the comment says.

More information about the ffmpeg-devel mailing list