OSDN Git Service

Fix for PR34888.
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 10 Oct 2017 08:46:10 +0000 (08:46 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 10 Oct 2017 08:46:10 +0000 (08:46 +0000)
commited65875cbdcd259d0acd371e537bcda6727695ac
treeb117dc78736c1841b3cb9ee362bcb03910eac686
parenta59b5e16be9f7352721dfcfd8bd043059c12a807
Fix for PR34888.

The issue is that we assume operand zero of the input to the add instruction
is a register. In this case, the input comes from inline assembly and
operand zero is not a register thereby causing a crash.
The code will bail anyway if the input instruction doesn't have the right
opcode. So do that check first and let short-circuiting prevent the crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCMIPeephole.cpp
test/CodeGen/PowerPC/PR3488.ll [new file with mode: 0644]