<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57962>57962</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Emitted binary changes when -g is enabled at -O1
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          theo-lw
      </td>
    </tr>
</table>

<pre>
    See `attributes_transformed_program0_preprocessed.c` below:

```
$ cat attributes_transformed_program0_preprocessed.c
char a[];
int b;
__attribute__((zero_call_used_regs("used"))) char c(int d) {
  *a = ({
    int e = d;
    b;
  });
}
void main() {}
$ clang-trunk -v
clang version 16.0.0 (https://github.com/llvm/llvm-project.git afb0b21f24adecfa0b302c79366980453b15ba7b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ clang-trunk -w -O1 attributes_transformed_program0_preprocessed.c -o a.out ; objdump --disassemble --section=.text a.out > no_dbg.txt
$ clang-trunk -w -O1 attributes_transformed_program0_preprocessed.c -o a.out -g ; objdump --disassemble --section=.text a.out > dbg.txt
$ diff no_dbg.txt dbg.txt
81,82c81,82
<     113d:  c3                      retq
<     113e:  66 90                   xchg   %ax,%ax
---
>     113d:  31 ff                   xor    %edi,%edi
>     113f:  c3                      retq
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VUuTozYQ_jVwUUGBeBgOHHbscSqnHDZ3SkJt0C5Is5IYs_n1aQH2bHa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