This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/37492] optimization causes inline assembler to emit syntax errors
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2008 14:13:24 -0000
- Subject: [Bug inline-asm/37492] optimization causes inline assembler to emit syntax errors
- References: <bug-37492-10301@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from ubizjak at gmail dot com 2008-09-12 14:13 -------
(In reply to comment #0)
> asm(
> " xorl %1, %1\n"
> " movl $0x12345678, %0\n"
> " bsrl %2, %0 ; setz %b1 "
> : "=r" (res), "=r" (resz)
> : "g" (val)
Use "q" constraint for operand 1. You will also need earlyclobbers on output
operands:
: "=&r" (res), "=&q" (resz)
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37492