This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53933] Register choosing error when inline assembly used at inline function
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 06:55:21 +0000
- Subject: [Bug c/53933] Register choosing error when inline assembly used at inline function
- Auto-submitted: auto-generated
- References: <bug-53933-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53933
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-07-12 06:55:21 UTC ---
>1) the system type: arm cortex-a8 / linux-montavista
We (MontaVista) does not provide a GCC 4.6.x.
Anyways the problem is not related to GCC but rather your inline-asm is
incorrect. You should mark the output constraint as an early clobber since you
write to it before reading the input registers like so:
asm volatile (
"mov %0, %1 \n\t"
"cmp %1, %2 \n\t"
"movlt %0, %2 \n\t"
"cmp %1, %3 \n\t"
"movgt %0, %3 \n\t"
: "=&r"(a)
: "r"(a), "r"(amin), "r"(amax)
//: "r0", "r1", "r2"
);