This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/64733] MOV instruction error when inline assembly code is used in a C 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, 22 Jan 2015 19:50:23 +0000
- Subject: [Bug inline-asm/64733] MOV instruction error when inline assembly code is used in a C function
- Auto-submitted: auto-generated
- References: <bug-64733-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64733
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to aji from comment #2)
> The issue is with this line of code:
> asm volatile("mov X1, #0x10000003");
>
> If I modify the mov instruction to take a variable input it works.
>
> val = 0x10000003;
> asm volatile("mov X1, %0":"=r"(val));
>
> Just want to understand why is this?
Please read the ARM ARM. 0x10000000 works as it can be used with movw while
0x10000003 there is no one instruction which works. If you want 0x10000003,
you need to use two instructions movz and movk.
There is no GCC bug here.