From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id B56F6388CC13 for ; Wed, 28 Jul 2021 22:32:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B56F6388CC13 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E074722343; Wed, 28 Jul 2021 22:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627511531; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+/LpZavLhQ3h/87lf41JRLSNQxiPk9kmGefM4lVzM0=; b=j9aZ0TMKSdPKIfFSR/DJvXESSkrB2d4stMxgsBt6HwQOYJyZOyiJz+ORIOdaH1K3Gera2v eGKxZMweSFPKvfS2+qqJSFDQ4iQRbQoiM1TkDAETqpNNq8l84DxC1mUcxGop9A8L970msj ezh7NcwJ2Hc+A612HzkPhk8PaIFB5lI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627511531; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+/LpZavLhQ3h/87lf41JRLSNQxiPk9kmGefM4lVzM0=; b=MU3MDaxoIICR8QtCDfGc5NBxwOMh320J78/Id2Ahyl7gbEKXyNV00z2FP4vRmmdQHa/ab4 NKF5Rmq5H0bqJTBw== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id BC9F913D6B; Wed, 28 Jul 2021 22:32:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id VLSILOvaAWEucwAAGKfGzw (envelope-from ); Wed, 28 Jul 2021 22:32:11 +0000 Subject: Re: [gdb/build] Fix Werror=nonnull-compare build breaker with gcc 12 From: Tom de Vries To: Tom Tromey Cc: Jan-Benedict Glaw , "gdb-patches@sourceware.org" , Andrew Burgess References: <20210726211101.ivychvbfgaafxjtz@lug-owl.de> <20210727100354.GB4037238@embecosm.com> <20210727113511.GC4037238@embecosm.com> <6cf80ba9-b010-bb42-c92d-84e4f396813c@suse.de> Message-ID: Date: Thu, 29 Jul 2021 00:32:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 22:32:14 -0000 [ quote-copied from https://sourceware.org/pipermail/gdb-patches/2021-July/181173.html. I didn't get this email in either my inbox or gdb-patches folder. ] > Tom> I managed now to reproduce, and wrote a patch along these lines. > > Tom> Any comments? > > Tom> In particular, any suggestion where to put ignore_nonnull? > > Tom> Or, is it perhaps a better idea to have a gdb_assert_nonnull and > Tom> implement things there? > Thanks for giving your take on this. > How about we either drop the nonnull attribute That's a possibility indeed. > or we use > -fno-delete-null-pointer-checks? > Unfortunately, that doesn't work (and it took me some hours today to realize and understand). I've submitted a patch to improved the nonnull documentation ( https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576218.html ), hopefully it should be clear from there that -fno-delete-null-pointer-checks doesn't disable the optimization we're having trouble with. > I personally feel that the gcc approach in this area is > counter-productive, at least for our purposes. My view is that the > point of this stuff is to help us detect programming errors -- and we're > uninterested in using non-null-ness as some kind of optimization hint. > gcc seems to want it both ways, which seems bizarre. I think they just implemented two attributes: assume_nonnull and verify_nonnull as a single attribute nonnull. Then still that could be workable, but eventually the problem is that you can't switch the two interpretations on and off in a reasonable manner. > But, given that > this is how the compiler works, IMO we should choose reliability > whichever way we best can. Yes, I hope to get some reasonable feedback, but I'm not holding my breath. So we could possibly end up with dropping nonnull. Thanks, - Tom