https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #9 from Stas Sergeev ---
(In reply to Jakub Jelinek from comment #7)
> you need to tell the compiler
> the asm can goto to that label.
Of course the one would wonder what else
could be done to the passed label. :)
Maybe some
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #8 from Stas Sergeev ---
(In reply to Jakub Jelinek from comment #7)
> It doesn't mean you can't use "r" (&),
Well, if not for Andrew telling exactly that
you can't, both here and in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #7 from Jakub Jelinek ---
It doesn't mean you can't use "r" (&), but you need to tell the compiler
the asm can goto to that label.
Or of course can just use the rip based addressing yourself in the inline asm,
the label's %X stands
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #6 from Stas Sergeev ---
(In reply to Jakub Jelinek from comment #5)
> I think Andrew meant asm goto, which you haven't tried.
You are right.
Thanks for mentioning that.
But it doesn't work as well:
---
int main(void)
{
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #4 from Stas Sergeev ---
I can achieve similar results with this:
---
void cont(void) asm("_cont");
asm volatile (
"push %0\n"
"ret\n"
"_cont:\n"
::"r"(cont));
---
But this doesn't work if the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #3 from Stas Sergeev ---
I can't use inline-asm gotos because
I can't manipulate such a label in a portable way.
For example:
---
asm volatile (
"push $1f\n"
"ret\n"
"1:\n"
);
---
This won't work with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
--- Comment #2 from Andrew Pinski ---
See PR 29305 and others too on why this is undefined.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---