This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/54450] Extended asm in global scope
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 29 Jul 2017 12:35:42 +0000
- Subject: [Bug inline-asm/54450] Extended asm in global scope
- Auto-submitted: auto-generated
- References: <bug-54450-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450
--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #6)
> (In reply to Marek Polacek from comment #2)
> > Probably dup of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41045
>
> Agreed, closing as a duplicate of it
>
> *** This bug has been marked as a duplicate of bug 41045 ***
Really?
What the OP wants is
>> void *ptr;
>>
>> __asm__ ("my_function:\n\t"
>> "jmp *%0\n\t" : : "r"(ptr));
Constraint "r" cannot work at toplevel, hence this PR is invalid.
What PR41045 is about is top-level asm arguments that are compiler-time
constants (constraint "n") and maybe also symbols (constraints "i" and "s").
So the initial request is only valid if the address of ptr was used (and &ptr
is CONST_INT, CONST or SYMBOL_REF etc.):
void *ptr;
__asm__ ("my_function:\n\t"
"jmp ??? %0" : : "i" (&ptr));