https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99299
Bug ID: 99299
Summary: Need a recoverable version of __builtin_trap()
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: christophe.leroy at csgroup dot eu
Target Milestone: ---
Linux kernel implements WARN() and WARN_ON() asserts using trap instructions.
Because gcc __builtin_trap() is not recoverable, Linux Kernel has hand code the
trap, at the moment using 'twnei'. This leads to sub-optimal code generation.
As the powerpc trap instruction is recoverable as it generated a recoverable
exception, it would be extremely usefull to also have a recoverable version of
__builtin_trap() in gcc. Maybe call it __buitin_recoverable_trap()