[Bug inline-asm/54450] Extended asm in global scope

2017-07-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

Eric Gallager  changed:

   What|Removed |Added

 Resolution|DUPLICATE   |INVALID

--- Comment #8 from Eric Gallager  ---
(In reply to Georg-Johann Lay from comment #7)
> (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
>  is CONST_INT, CONST or SYMBOL_REF etc.):
> 
> void *ptr;
> 
> __asm__ ("my_function:\n\t"
>  "jmp ??? %0" : : "i" ());

Oh OK, changing to INVALID then.

[Bug inline-asm/54450] Extended asm in global scope

2017-07-29 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #7 from Georg-Johann Lay  ---
(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 
is CONST_INT, CONST or SYMBOL_REF etc.):

void *ptr;

__asm__ ("my_function:\n\t"
 "jmp ??? %0" : : "i" ());

[Bug inline-asm/54450] Extended asm in global scope

2017-07-28 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=25967
 Resolution|--- |DUPLICATE

--- Comment #6 from Eric Gallager  ---
(In reply to jnz from comment #1)
> I'd be happy to use __attribute__((naked)) but it's not supported on x86 for
> some reason.

That's bug 25967

(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 ***

[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread just.serejko at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

Sergey Zolotarev just.serejko at gmail dot com changed:

   What|Removed |Added

 Target||x86
   Host||x86

--- Comment #1 from Sergey Zolotarev just.serejko at gmail dot com 2012-09-01 
10:10:25 UTC ---
I'd be happy to use __attribute__((naked)) but it's not supported on x86 for
some reason.


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

Marek Polacek polacek at redhat dot com changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #2 from Marek Polacek polacek at redhat dot com 2012-09-01 
10:59:21 UTC ---
Probably dup of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41045


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #3 from Marek Polacek polacek at redhat dot com 2012-09-01 
11:10:10 UTC ---
Also, __attribute__((naked)) for x86 will never be implemented.


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread just.serejko at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #4 from Sergey Zolotarev just.serejko at gmail dot com 2012-09-01 
12:43:52 UTC ---
 Also, __attribute__((naked)) for x86 will never be implemented.

May I ask why?


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #5 from Marek Polacek polacek at redhat dot com 2012-09-01 
13:15:46 UTC ---
(In reply to comment #4)
 May I ask why?

See e.g. http://gcc.gnu.org/ml/gcc/2004-02/msg00943.html