[all-commits] [llvm/llvm-project] d458f3: [GWP-ASan] Change unreachable -> trap to work arou...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Thu Jul 8 13:07:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d458f379324967c3c408be06e21aad9bc92c54cb
      https://github.com/llvm/llvm-project/commit/d458f379324967c3c408be06e21aad9bc92c54cb
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2021-07-08 (Thu, 08 Jul 2021)

  Changed paths:
    M compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp

  Log Message:
  -----------
  [GWP-ASan] Change unreachable -> trap to work around DCE bug.

trapOnAddress is designed to SEGV on a specific address. Unfortunately,
with an IR change, __builtin_unreachable() ends up doing DCE on things
that have side effects, like the load that causes the trap.

Change to __builtin_trap() to avoid the optimisation.

Root cause is still an LLVM bug, and tracked in
https://bugs.llvm.org/show_bug.cgi?id=47480.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D105654




More information about the All-commits mailing list