In this patch https://github.ibm.com/compiler/llvm-project/commit/30e3db2 , the TRAP instruction for
PowerPC has been set to isTerminator. In fact, the TRAP instruction should not add isTerminator property,
because when the TRAP has been handled, the program should be continued.
This bug has caused 6 lit cases error on PPC.
For below case,
void test_builtin_trap() { volatile int i = 0; __builtin_trap(); volatile int j = i; }
we use clang sim.c -target powerpc-unknown-unknown -c to build it, we will get below error:
*** Bad machine code: Non-terminator instruction after the first terminator *** - function: test_builtin_trap - basic block: %bb.0 entry (0x1002c61f1f8) - instruction: %1:gprc = LWZ 0, %stack.0.i :: (volatile dereferenceable load 4 from %ir.i) First terminator was: TRAP *** Bad machine code: Non-terminator instruction after the first terminator *** - function: test_builtin_trap - basic block: %bb.0 entry (0x1002c61f1f8) - instruction: STW killed %1:gprc, 0, %stack.1.j :: (volatile store 4 into %ir.j) First terminator was: TRAP fatal error: error in backend: Found 2 machine code errors.
This patch is to fix above bug.