compiler-explorer / compiler-explorer/compiler-explorer

Expose assembly label aliases more explicitly

Open
#2,440 2 comments 0 reactions 0 assignees View on GitHub
Assembly enhancement Status: triaged
Dominant language
TypeScript
Stars
19.1k
Forks
2.1k
Avg merge
3d 15h
Merged PRs (30d)
67

Description

Hi,

This bug is more of a "nice to have" but I wanted to make you aware of it.

In https://gcc.godbolt.org/z/fGK6b4 we have

```
A::A() [base object constructor]:
push rbp
mov rbp, rsp
mov QWORD PTR [rbp-8], rdi
nop
pop rbp
ret
caller():
push rbp
mov rbp, rsp
sub rsp, 16
lea rax, [rbp-1]
mov rdi, rax
call A::A() [complete object constructor]
nop
leave
ret
```

Note that there is a call to `A::A() [complete object constructor]` (mangled as `_ZN1AC1Ev`) but we only see a definition for `A::A() [base object constructor]` (mangled as `_ZN1AC2Ev`)

If we turn off filtering of directives we see the culprit:
```
.set _ZN1AC1Ev,_ZN1AC2Ev
```

This is not a huge deal, but if one felt like fixing it, one could make a pass through all such `.set` directives and form a closure of all equivalent labels. Then, any line which defines one label could list all of them. In the above, the first part could then read as

```
A::A() [base object constructor]:
= A::A() [complete object constructor]:
push rbp
mov rbp, rsp
...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.