mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-21 02:59:15 +00:00
3b91357ef0
original code was matching like this: if (match(A, m_Not(m_Value(B)))) B was already matched as a 'select' instruction. However, this isn't matching what we think it's matching. It would match B as a 'Value', so basically anything would match to it. In this case, a Constant matched. B was replaced with a constant representation. And then the wrong value would be used in the SelectInst::Create statement, causing a crash. After thinking on this for a moment, and after Nick L. told me how the pattern matching stuff was supposed to work, the solution was to match NOT an m_Value, but an m_Select. llvm-svn: 58946
18 lines
218 B
C
18 lines
218 B
C
// RUN: %llvmgcc %s -S -emit-llvm -O2 -o -
|
|
// PR3028
|
|
|
|
int g_187;
|
|
int g_204;
|
|
int g_434;
|
|
|
|
int func_89 (void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
void func_20 (int p_22)
|
|
{
|
|
if (1 & p_22 | g_204 & (1 < g_187) - func_89 ())
|
|
g_434 = 1;
|
|
}
|