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

            Bug ID: 120290
           Summary: internal compiler error: in expand_asm_stmt, at
                    cfgexpand.cc:3720
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario.rodriguezb1 at um dot es
  Target Milestone: ---

ICE in expand_asm_stmt at cfgexpand.cc:3720 with inline assembly using mov
%eax, 12(%edi):

```
#include <iostream>
int main(){
    int i = 7;
    int *k = &i;
    asm volatile("mov %eax, 12(%edi)\n"
                    : " =r" (k)
                : "0" (k)
                : "eax", "edi");
}

```

Stack dump:

```
during RTL pass: expand
<source>:5:5: internal compiler error: in expand_asm_stmt, at cfgexpand.cc:3720
0x2943505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2961276 internal_error(char const*, ...)
        ???:0
0xad8a2c fancy_abort(char const*, int, char const*)
        ???:0
```

It happens since first clang, but hiiden by bailing out

https://godbolt.org/z/8reMYva4a

Reply via email to