[Bug middle-end/98896] local label displaced with -O2

2021-01-30 Thread stsp at users dot sourceforge.net via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-30 Thread stsp at users dot sourceforge.net via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-30 Thread stsp at users dot sourceforge.net via Gcc-bugs
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) {

[Bug middle-end/98896] local label displaced with -O2

2021-01-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-29 Thread stsp at users dot sourceforge.net via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-29 Thread stsp at users dot sourceforge.net via Gcc-bugs
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

[Bug middle-end/98896] local label displaced with -O2

2021-01-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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.

[Bug middle-end/98896] local label displaced with -O2

2021-01-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---