[llvm-dev] is this a bug in PruneEH?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 4 11:34:54 PDT 2019


Hi  Todd,

On Tue, 4 Jun 2019 at 11:05, Snider, Todd via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> It is legal to insert an unreachable after the call to a noreturn function in the if block, but the optimizer should not discard the call in a later optimization pass.

I think that's broadly correct. You're hitting
https://bugs.llvm.org/show_bug.cgi?id=965, a very old bug. It seems
very slow moving, but still moving.

As a workaround you can probably put an asm volatile("") statement
inside your loop to convince LLVM to be more cautious.

Cheers.

Tim.


More information about the llvm-dev mailing list