aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/ThreadLocal.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-06-26 13:39:21 +0000
committerDuncan Sands <baldrick@free.fr>2012-06-26 13:39:21 +0000
commit8bc764aecaf8b3db1b3747472d560f3af04ef595 (patch)
treeb00d7a86ef5c19b33536aa34821ed61f4fbd0d34 /llvm/lib/Support/ThreadLocal.cpp
parente481e0daf40fc12df0c88c9da2448f26af3b2a46 (diff)
downloadllvm-8bc764aecaf8b3db1b3747472d560f3af04ef595.zip
llvm-8bc764aecaf8b3db1b3747472d560f3af04ef595.tar.gz
llvm-8bc764aecaf8b3db1b3747472d560f3af04ef595.tar.bz2
Replacing zero-sized alloca's with a null pointer is too aggressive, instead
merge all zero-sized alloca's into one, fixing c43204g from the Ada ACATS conformance testsuite. What happened there was that a variable sized object was being allocated on the stack, "alloca i8, i32 %size". It was then being passed to another function, which tested that the address was not null (raising an exception if it was) then manipulated %size bytes in it (load and/or store). The optimizers cleverly managed to deduce that %size was zero (congratulations to them, as it isn't at all obvious), which made the alloca zero size, causing the optimizers to replace it with null, which then caused the check mentioned above to fail, and the exception to be raised, wrongly. Note that no loads and stores were actually being done to the alloca (the loop that does them is executed %size times, i.e. is not executed), only the not-null address check. llvm-svn: 159202
Diffstat (limited to 'llvm/lib/Support/ThreadLocal.cpp')
0 files changed, 0 insertions, 0 deletions