From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id D6D08385740A; Thu, 19 Aug 2021 18:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6D08385740A 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 r12-3030] Objective-C, NeXT runtime: Correct the default for fobjc-nilcheck. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: 18e9e7db7afb8635316414b560c10852db13c4c1 X-Git-Newrev: de0b250b2badb475f8c09f3cd2c57fd3f9127fe3 Message-Id: <20210819183917.D6D08385740A@sourceware.org> Date: Thu, 19 Aug 2021 18:39:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 18:39:18 -0000 https://gcc.gnu.org/g:de0b250b2badb475f8c09f3cd2c57fd3f9127fe3 commit r12-3030-gde0b250b2badb475f8c09f3cd2c57fd3f9127fe3 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. 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 0d963e357c4..ce831fc34ae 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;