public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/109257] New: `-masm=intel` generates weird syntax for indirect jumps
@ 2023-03-23  5:38 lh_mouse at 126 dot com
  2023-03-23 11:30 ` [Bug target/109257] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lh_mouse at 126 dot com @ 2023-03-23  5:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109257
           Summary: `-masm=intel` generates weird syntax for indirect
                    jumps
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

https://gcc.godbolt.org/z/Tc8v5qfv1

a proper tail call:

```
extern int (*foo)(int, int);
int ptc_to_foo(int a, int b) { return foo(a, b);  }
```

GCC compiles it to this:

```
ptc_to_foo:
        jmp     [QWORD PTR foo[rip]]
```

The outer pair of brackets are superfluous.


The `foo[rip]` part is also invalid but it's a common issue for all addressing
operands for x86_64, not specifically about jmp.

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

end of thread, other threads:[~2023-05-20 16:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23  5:38 [Bug target/109257] New: `-masm=intel` generates weird syntax for indirect jumps lh_mouse at 126 dot com
2023-03-23 11:30 ` [Bug target/109257] " jakub at gcc dot gnu.org
2023-03-23 15:52 ` jbeulich at suse dot com
2023-03-23 16:16 ` lh_mouse at 126 dot com
2023-03-23 16:35 ` jbeulich at suse dot com
2023-03-23 16:40 ` lh_mouse at 126 dot com
2023-05-20 16:51 ` lh_mouse at 126 dot com

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).