From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 770613858C50; Tue, 23 Apr 2024 14:11:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 770613858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713881487; bh=d0eFjZHT8weQwNoN8zZPHr22DAkjKi1IPmLR9t0S9Pw=; h=From:To:Subject:Date:From; b=cm2A6BIB4K4/xw8EzxTQYtywjT3QGpFG8hxZTXSB3ZbgvQJ+1mOQu1QUuYbNYRnl7 7oeMbStl0Dt79FG60WB0H8gOwOu2kzzsfFRROh8pKqz77qz9Z3R4LvoedQtVmyK5mh QzMTHAbmhAhndm/JmZSI2m+tylGXuplPF6vNNfk0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11340] Objective-C, NeXT runtime: Correct the default for fobjc-nilcheck. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 87431b4a81e9dc5988509399704a7352800c6a77 X-Git-Newrev: b907af1ce4966b662ae3d26afa24fa6c3ac468c9 Message-Id: <20240423141127.770613858C50@sourceware.org> Date: Tue, 23 Apr 2024 14:11:27 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b907af1ce4966b662ae3d26afa24fa6c3ac468c9 commit r11-11340-gb907af1ce4966b662ae3d26afa24fa6c3ac468c9 Author: Iain Sandoe Date: Sun Aug 15 12:52:30 2021 +0100 Objective-C, NeXT runtime: Correct the default for fobjc-nilcheck. It is intended that the default for the NeXT runtime at ABI 2 is to check for nil message receivers. This updates this to match the documented behaviour and to match the behaviour of the system tools. Signed-off-by: Iain Sandoe gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Default receiver nilchecks on. (cherry picked from commit de0b250b2badb475f8c09f3cd2c57fd3f9127fe3) Diff: --- gcc/objc/objc-next-runtime-abi-02.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c index e99c048e3a1..2f18b04e34a 100644 --- a/gcc/objc/objc-next-runtime-abi-02.c +++ b/gcc/objc/objc-next-runtime-abi-02.c @@ -254,6 +254,10 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks) flag_objc_sjlj_exceptions = 0; } + /* NeXT ABI 2 is intended to default to checking for nil receivers. */ + if (! global_options_set.x_flag_objc_nilcheck) + flag_objc_nilcheck = 1; + rthooks->initialize = next_runtime_02_initialize; rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME; rthooks->tag_getclass = TAG_GETCLASS;