[Ffmpeg-devel] Re: [PATCH] fix build for --cpu=i686

Trent Piepho xyzzy
Fri Mar 30 01:16:21 CEST 2007


On Thu, 29 Mar 2007, Uoti Urpala wrote:
> On Thu, 2007-03-29 at 16:32 -0300, Ramiro Ribeiro Polla wrote:
> > Michael Niedermayer wrote:
> > >though either way the change is wrong, the early clobbers would have to
> > >be on the first and second not second and third
> > >
> > >
> > Patch attached with earlyclobbers for all 3 outputs, as suggested by a
> > gcc dev on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31386
>
> Why do so many people on this list send bogus bug reports to gcc? I
> think this is at least the third one in less than a year (and there
> haven't been that many valid bugreports).
>
> There should be no need for the last output operand to be earlyclobber,
> as it's clearly not modified before use of input operands has finished.

Clearly.  I don't know why putting early clobber on all three was
suggested.  gcc won't let output registers overlap, how could that possibly
work?  I even tried this:

int a;
asm volatile("# %0 %1 %2 %3 %4 %5 %6":"+r"(a),"+r"(a),"+r"(a),"+r"(a),"+r"(a),"+r"(a),"+r"(a));

With omit-frame-pointer, it uses different registers each time.  Without,
gcc runs out of registers and fails.  This is gcc 4.0.1

In Ramiro's sample, his gcc produced:
        cmpl %edx, %esi
        cmovl %esi, %edx
        cmovl %edi, %eax
        cmovl %ecx, %eax

It put the last two outputs in the same register!  Seems to me that must be
a gcc bug.

When I compile the test case from the bug report, I don't get this register
overlap.  The only one I get is:

CMOV_COMBO( -1, -1 );

becomes:
	cmpl %eax, %edx
	cmovl %edx, %eax
	cmovl %edi, %ecx
	cmovl %edi, %ebx

gcc sticks both -1's into the same input register, which is perfectly ok.




More information about the ffmpeg-devel mailing list