Issue 140701
Summary [clang] Clang ignores parameter for C23 gnu::interrupt attribute on RISC-V64
Labels clang
Assignees
Reporter MofX
    When trying to create a supervisor trap handler on RISC-V64 using C23 attribute syntax, the parameter "supervisor" seems to be ignored and a machine trap handler is generated.

I.e. the following snipped generates an `mret` instead of an `sret` for the `c23` variant, while the correct one is generated for the `pre_c23` variant:
```
__attribute__((interrupt("supervisor"))) void pre_c23(){}

[[gnu::interrupt("supervisor")]] void c23(){}
```

gcc generates the correct code in both variants, see also in compiler explorer: https://godbolt.org/z/zeEjM8f5E
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to