GNOME Bugzilla – Bug 323665
gst-ffmpeg-0.10.0 compilation problem with gcc 3.3.5 (dsputil_mmx.c:620: error: can't find a register in class `GENERAL_REGS' while reloading `asm')
Last modified: 2007-09-10 10:58:58 UTC
Distribution/Version: Debian 3.1 (Sarge) gcc 3.3.5 is the default compiler on Debian 3.1 (aka Sarge): ben$gcc --version gcc (GCC) 3.3.5 (Debian 1:3.3.5-13) ben$as --version GNU assembler 2.15 ben$cd gst-ffmpeg-0.10.0/ ben$./configure && make [...] dsputil_mmx.c: In function `transpose4x4': dsputil_mmx.c:620: error: can't find a register in class `GENERAL_REGS' while reloading `asm' and the build fails. As sugested by alley_cat on IRC, compiling with -O3 (env CFLAGS=-O3 ./configure && make) fix the problem with this version of gcc.
hmm... This isn't a problem with gst-ffmpeg, but with ffmpeg. Maybe we could force CFLAGS to have -O3.
alley_cat , that pointed me to the solution, also said that on his gcc 3.4.4 and gcc 4.0.1 systems, the build fails whith -O3 (and not with the default -Os). So forcing to -O3 as Edward suggested wouldn't be good either. And yes, the problem is within ffmpeg, not in the gst-ffmpeg specific code, but we should choose a ffmpeg version that work better when possible (hence this bug report). Also, it should be noted that the bug only appear when compiled with -fPIC (as gst-ffmpeg does). For instance, the compilation from ffmpeg sources (that don't imply -fPIC), as opposed to compiling from gst, doesn't expose those problems.
So should we force the CFLAGS to have -O3 ?
If you want to force it, only force it for gcc 3.3.x, as it definitely fails to compile in a similar way with -O3 on gcc 3.4 and 4.0
AFAICT, -O3 simply hides this behind a bug in gcc. Or rather, a gcc bug is triggered in very similar situations. I'd recommend against it, and simply fix the assembly code.
I think it's reasonably unlikely we're going to be fixing ffmpeg's assembly code unless someone gives us a patch or one arrives upstream. I updated our ffmpeg snapshot on the weekend, which may or may not have touched the code in question.
Just FYI, the new snapshot didn't fix the problem (but move it on the file). Arwed: is there a way to force -03 when autoconf (or whatever) find a gcc 3.3 ? In file included from dsputil_mmx.c:2492: h264dsp_mmx.c:49:1: warning: "SBUTTERFLY" redefined dsputil_mmx.c:1525:1: warning: this is the location of the previous definition In file included from dsputil_mmx.c:2492: h264dsp_mmx.c: In function `ff_h264_idct_dc_add_mmx2': h264dsp_mmx.c:122: error: can't find a register in class `GENERAL_REGS' while reloading `asm' h264dsp_mmx.c:1050:1: warning: "PUT_OP" redefined dsputil_mmx.c:2377:1: warning: this is the location of the previous definition gmake[8]: *** [libmmxsse_la-dsputil_mmx.lo] Error 1
Benjamin, what about the latest snapshot ? Does it work for you ?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!