https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123802
Bug ID: 123802
Summary: Add -fsanitize-trap-loop which loops instead of traps
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
Target Milestone: ---
>From https://github.com/llvm/llvm-project/pull/177688 's documentation
addition:
.. option:: -fsanitize-trap-loop
When a UBSan or CFI check fails in trapping mode, spin in an infinite
loop instead of executing a trap instruction. Conditional branching
in an infinite loop has been experimentally determined to be executed
more efficiently (when the branch is not taken) than a conditional
branch to a trap instruction on AMD and older Intel microarchitectures,
and is also more code size efficient by avoiding the need to emit a
trap instruction and possibly a long branch instruction.