[cfe-dev] RFC: Implementing -fno-delete-null-pointer-checks in clang

Friedman, Eli via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 18 12:02:05 PDT 2018


On 4/18/2018 11:21 AM, Tim Northover via cfe-dev wrote:
> On 18 April 2018 at 18:13, Manoj Gupta via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
>> Therefore, I would like to implement support for this flag (maybe with a
>> different name),
> I'd suggest -mdo-what-i-mean; the whole idea is horribly
> underspecified, and basically rips up the LangRef in favour of a
> nebulous set of good and bad optimizations (probably as dictated by
> the ones that have bitten someone who wrote bad code recently and was
> grumpy enough about it to complain at us).

Despite the name, the flag actually has rather straightforward semantics 
from the compiler's perspective.  From the gcc docs for 
-fdelete-null-pointer-checks: "Assume that programs cannot safely 
dereference null pointers, and that no code or data element resides at 
address zero."  (-fno-delete-null-pointer-checks is the opposite.)

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the cfe-dev mailing list