[LLVMdev] interesting possible compiler bug
Krzysztof Parzyszek
kparzysz at codeaurora.org
Mon Oct 15 14:38:44 PDT 2012
On 10/2/2012 4:12 AM, Nick Lewycky wrote:
>
> This is a straight-forward application of the as-if rule. The malloc
> call behaves as-if it allocated memory. Because we prove that the code
> doesn't use that memory, we can get away with allocating no memory at
> all and not change the behaviour of the program.
Are you saying that we do this kind of an analysis at -O2? This could
only work if the entire program was contained in a single source file,
and even then it would require interprocedural analysis to get it right.
-K
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev
mailing list