summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-03-23 22:52:04 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-03-23 22:52:04 +0000
commit425489d3972ca9819d0c72e9d61e46493e26e635 (patch)
tree9861b3a415293caefd9227ec9763c19ace1fad6f /clang/lib/CodeGen/CGObjCGNU.cpp
parentca1176aaeefa0e7adf36d10d6d441dfabffe2175 (diff)
downloadbcm5719-llvm-425489d3972ca9819d0c72e9d61e46493e26e635.tar.gz
bcm5719-llvm-425489d3972ca9819d0c72e9d61e46493e26e635.zip
Cmp peephole optimization isn't always safe for signed arithmetics.
int tries = INT_MAX; while (tries > 0) { tries--; } The check should be: subs r4, #1 cmp r4, #0 bgt LBB0_1 The subs can set the overflow V bit when r4 is INT_MAX+1 (which loop canonicalization apparently does in this case). cmp #0 would have cleared it while not changing the N and Z bits. Since BGT is dependent on the V bit, i.e. (N == V) && !Z, it is not safe to eliminate the cmp #0. rdar://9172742 llvm-svn: 128179
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud