[Bug inline-asm/93981] New: No EH information generated for asm statements

jwjagersma at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Feb 29 14:07:00 GMT 2020


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

            Bug ID: 93981
           Summary: No EH information generated for asm statements
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwjagersma at gmail dot com
  Target Milestone: ---

No exception handling information is generated for asm statements:

```
$ cat unwind.cpp
void f()
{
    try { asm ("nop #try"); }
    catch (...) { asm ("nop #catch"); }
}

$ g++-9 -fnon-call-exceptions unwind.cpp -S -dA -o -
        .file   "unwind.cpp"
        .text
        .globl  _Z1fv
        .type   _Z1fv, @function
_Z1fv:
.LFB0:
        .cfi_startproc
# BLOCK 2 seq:0
# PRED: ENTRY (FALLTHRU)
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
#APP
# 3 "unwind.cpp" 1
        nop #try
# 0 "" 2
#NO_APP
        nop
        popq    %rbp
        .cfi_def_cfa 7, 8
# SUCC: EXIT [always] 
        ret
        .cfi_endproc
.LFE0:
        .size   _Z1fv, .-_Z1fv
        .ident  "GCC: (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102"
        .section        .note.GNU-stack,"",@progbits
```

Since asms may contain trapping instructions, they should be covered by
an EH region in the unwind tables when compiling with
-fnon-call-exceptions.


More information about the Gcc-bugs mailing list