From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id DD74A3854801 for ; Fri, 13 Jan 2023 09:09:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD74A3854801 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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-out2.suse.de (Postfix) with ESMTPS id B65FA5D98B; Fri, 13 Jan 2023 09:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673600987; 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=L/FQITcvdT8/5Eay71VV4mO1dXa151q4pncsw6myaFc=; b=2LHSQUfQsx8+z0+NLr9vEOOUUo53hbW61rKzCCMceDXIeJMNboG+YSTKoz2V71bHrO0/IK W+Fs7oLPGSVlZ/elM45USjjGKjhyHUFKvKYWar98rtX85bmDyWdjpGqL6cdcYbiANWmD3m 2d0glmRLr9P2rNZxvHLQJh4K/sZeYi0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673600987; 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=L/FQITcvdT8/5Eay71VV4mO1dXa151q4pncsw6myaFc=; b=95gPeGKlqrU5AHIMJvTrIAFap6R9WSNwFqG1ZwcHdp33ghz08axHj0gUOduWiABdmu1GYu TcN+qZNycYDnnmDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 963911358A; Fri, 13 Jan 2023 09:09:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6zLqItsfwWNZawAAMHmgww (envelope-from ); Fri, 13 Jan 2023 09:09:47 +0000 Message-ID: <83376324-e80c-8811-9c6f-a3df8b74f92b@suse.cz> Date: Fri, 13 Jan 2023 10:09:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] ipa: silent -Wodr notes with -w From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka , Martin Jambor References: <527d5c9b-c693-cdfb-5473-8326c2055194@suse.cz> <4bc02001-9340-7625-b275-b6aeb6289e54@suse.cz> Content-Language: en-US In-Reply-To: <4bc02001-9340-7625-b275-b6aeb6289e54@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: PING^3 On 12/22/22 13:15, Martin Liška wrote: > PING^2 > > On 12/9/22 09:27, Martin Liška wrote: >> PING^1 >> >> On 12/2/22 12:27, Martin Liška wrote: >>> If -w is used, warn_odr properly sets *warned = false and >>> so it should be preserved when calling warn_types_mismatch. >>> >>> Noticed that during a LTO reduction where I used -w. >>> >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >>> >>> Ready to be installed? >>> Thanks, >>> Martin >>> >>> gcc/ChangeLog: >>> >>> * ipa-devirt.cc (odr_types_equivalent_p): Respect *warned >>> value if set. >>> --- >>> gcc/ipa-devirt.cc | 12 ++++++------ >>> 1 file changed, 6 insertions(+), 6 deletions(-) >>> >>> diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc >>> index 265d07bb354..bcdc50c5bd7 100644 >>> --- a/gcc/ipa-devirt.cc >>> +++ b/gcc/ipa-devirt.cc >>> @@ -1300,7 +1300,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, NULL, NULL, warn, warned, >>> G_("it is defined as a pointer to different type " >>> "in another translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_TYPE (t1), TREE_TYPE (t2), >>> loc1, loc2); >>> return false; >>> @@ -1315,7 +1315,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, NULL, NULL, warn, warned, >>> G_("a different type is defined " >>> "in another translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_TYPE (t1), TREE_TYPE (t2), loc1, loc2); >>> return false; >>> } >>> @@ -1333,7 +1333,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, NULL, NULL, warn, warned, >>> G_("a different type is defined in another " >>> "translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_TYPE (t1), TREE_TYPE (t2), loc1, loc2); >>> } >>> gcc_assert (TYPE_STRING_FLAG (t1) == TYPE_STRING_FLAG (t2)); >>> @@ -1375,7 +1375,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, NULL, NULL, warn, warned, >>> G_("has different return value " >>> "in another translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_TYPE (t1), TREE_TYPE (t2), loc1, loc2); >>> return false; >>> } >>> @@ -1398,7 +1398,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, NULL, NULL, warn, warned, >>> G_("has different parameters in another " >>> "translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_VALUE (parms1), >>> TREE_VALUE (parms2), loc1, loc2); >>> return false; >>> @@ -1484,7 +1484,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, >>> warn_odr (t1, t2, f1, f2, warn, warned, >>> G_("a field of same name but different type " >>> "is defined in another translation unit")); >>> - if (warn && warned) >>> + if (warn && (warned == NULL || *warned)) >>> warn_types_mismatch (TREE_TYPE (f1), TREE_TYPE (f2), loc1, loc2); >>> return false; >>> } >> >