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

Ramiro Ribeiro Polla ramiro
Mon Apr 2 22:21:13 CEST 2007

Trent Piepho wrote:
> 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:

New patch attached with earlyclobbers on first and second outputs.
Sorry about sending a patch that had already been suggested wrong.

> 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.
Yes, that's exacly what made me thing it's a real 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.

With gcc 4.0.0, and svn I get the error. 4.0.0 puts both on ebx.
With 4.0.3-1ubuntu5, that doesn't happen.

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: internal.diff
Type: text/x-patch
Size: 414 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070402/6c991e5b/attachment.bin>

More information about the ffmpeg-devel mailing list