public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/98896] New: local label displaced with -O2
@ 2021-01-29 22:08 stsp at users dot sourceforge.net
  2021-01-29 22:33 ` [Bug middle-end/98896] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: stsp at users dot sourceforge.net @ 2021-01-29 22:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98896

            Bug ID: 98896
           Summary: local label displaced with -O2
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stsp at users dot sourceforge.net
  Target Milestone: ---

The following code works as expected with
clang, but hangs with gcc with -O2 (works with -O1):

---
int main()
{
    __label__ ret;
    asm volatile ("jmp *%0\n" :: "r"(&&ret) : "memory");
ret:
    return 0;
}
---

As can be seen from a disasm, the label is put before asm block.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-30 15:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 22:08 [Bug c/98896] New: local label displaced with -O2 stsp at users dot sourceforge.net
2021-01-29 22:33 ` [Bug middle-end/98896] " pinskia at gcc dot gnu.org
2021-01-29 22:35 ` pinskia at gcc dot gnu.org
2021-01-29 23:08 ` stsp at users dot sourceforge.net
2021-01-29 23:32 ` stsp at users dot sourceforge.net
2021-01-30 10:02 ` jakub at gcc dot gnu.org
2021-01-30 11:25 ` stsp at users dot sourceforge.net
2021-01-30 11:54 ` jakub at gcc dot gnu.org
2021-01-30 12:11 ` stsp at users dot sourceforge.net
2021-01-30 15:03 ` stsp at users dot sourceforge.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).