Description of Problem: gcc fails to compile xine-libs >= 0.9.10 because it can't find enough registers. gcc -fPIC -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../.. -I../../../.. -I../../../../src -I../../../../src -I../../../../src/xine-engine -I../../../../src/xine-engine -I../../../../src/xine-utils -I../../../../src/xine-utils -O2 -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H -c mpegvideo_mmx.c -DPIC -o mpegvideo_mmx.lo In file included from mpegvideo_mmx.c:545: mpegvideo_mmx_template.c: In function `dct_quantize_MMX': mpegvideo_mmx_template.c:87: can't find a register in class `GENERAL_REGS' while reloading `asm' Using -O0 makes it worse: gcc -fPIC -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../.. -I../../../.. -I../../../../src -I../../../../src -I../../../../src/xine-engine -I../../../../src/xine-engine -I../../../../src/xine-utils -I../../../../src/xine-utils -O0 -DCONFIG_DECODERS -DHAVE_AV_CONFIG_H -c mpegvideo_mmx.c -DPIC -o mpegvideo_mmx.lo In file included from mpegvideo_mmx.c:545: mpegvideo_mmx_template.c: In function `dct_quantize_MMX': mpegvideo_mmx_template.c:87: can't find a register in class `GENERAL_REGS' while reloading `asm' mpegvideo_mmx_template.c:139: can't find a register in class `GENERAL_REGS' while reloading `asm' Version-Release number of selected component (if applicable): 3.1-7
Created attachment 63047 [details] Source file causing this
Created attachment 63048 [details] preprocessed source (-O0)
Created attachment 63049 [details] preprocessed source (-O2)
I'd say fix xine then. with -fpic and with frame pointer IA-32 really doesn't have 6 spare registers for inline assembly, but 5. I've tried egcs 1.1.2 and gcc-2.96-110 on your testcase (after sedding it a little so that egcs would accept it) and it failed in those compilers similarly too. In dct_quantize_MMX function, I think the fix could be to kill one of qmat and bias variables which is doable because: (offsetof(MpegEncContext, q_intra_matrix16_bias) - offsetof(MpegEncContext, q_intra_matrix16)) == (offsetof(MpegEncContext, q_inter_matrix16_bias) - offsetof(MpegEncContext, q_inter_matrix16)) and thus you could replace movq (%2), %%mm5 with movq %3(%2), %%mm5 or something (where %2 would be say qmat and %3 would be "i" (difference between the 2 arrays) or something. The code would be even faster...
Just synced xine with ffmpeg cvs and added a fix from avifile sources to enable -fpic compilation. let me know if it works for you.
Created attachment 71344 [details] patch to enable -fpic compilation from xine cvs
We no longer ship xine in Red Hat Linux.