diff options
| author | Philip Reames <listmail@philipreames.com> | 2015-10-15 16:51:00 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2015-10-15 16:51:00 +0000 |
| commit | a956cc7f085d8284d7c7cfd11fc20477838b2c04 (patch) | |
| tree | e364b29fa862fd07c58ca8b87fbf4f210ad1779d /lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | |
| parent | 5b327712b07225385a6370f6acd245b8690670b0 (diff) | |
Revert 250343 and 250344
Turns out this approach is buggy. In discussion about follow on work, Sanjoy pointed out that we could be subject to circular logic problems.
Consider:
if (i u< L) leave()
if ((i + 1) u< L) leave()
print(a[i] + a[i+1])
If we know that L is less than UINT_MAX, we could possible prove (in a control dependent way) that i + 1 does not overflow. This gives us:
if (i u< L) leave()
if ((i +nuw 1) u< L) leave()
print(a[i] + a[i+1])
If we now do the transform this patch proposed, we end up with:
if ((i +nuw 1) u< L) leave_appropriately()
print(a[i] + a[i+1])
That would be a miscompile when i==-1. The problem here is that the control dependent nuw bits got used to prove something about the first condition. That's obviously invalid.
This won't happen today, but since I plan to enhance LVI/CVP with exactly that transform at some point in the not too distant future...
llvm-svn: 250430
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp')
0 files changed, 0 insertions, 0 deletions
