This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/11203] source doesn't compile with -O0 but they compile with -O3
- From: "astrange at ithinksw dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2009 19:56:26 -0000
- Subject: [Bug inline-asm/11203] source doesn't compile with -O0 but they compile with -O3
- References: <bug-11203-1507@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #40 from astrange at ithinksw dot com 2009-10-18 19:56 -------
Linked from http://x264dev.multimedia.cx/?p=185, I'd forgotten all about the
ridiculous flamewar in this one.
Just as a note, the actual definitions of the four variables (from liba52):
x2k = x + 2 * k;
x3k = x2k + 2 * k;
x4k = x3k + 2 * k;
wB = wTB + 2 * k;
Also, the asm inputs are silly - output 0 is the same as input 6 for no reason,
and the same with output 2 and input 7. So change those to "+m" and change
%6/%7 to %0/%2.
That doesn't actually change anything, even though it should free two
registers. It works with gcc 4.5 -O0 -fno-pic -fomit-frame-pointer, but not
without one of those flags. Looks like that's because it's allocating 2 more
registers for the unused fake inputs for the "+m" - change it to "=m" and it
works with one flag removed, but still not both. So there's a specific bug.
And of course it all works at -O1 because it doesn't have to use registers
there. So maybe it should just do that.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203