From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id D3B56382DE1C for ; Wed, 26 Oct 2022 15:58:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3B56382DE1C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail 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-out1.suse.de (Postfix) with ESMTPS id 665F921FE7; Wed, 26 Oct 2022 15:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666799911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bJ3mj2WzjYICdvoiWiP+g6zitpxDd0h1j+BUjbobb6M=; b=mvh5bmboW61GOHo9wX9BBNbikdRPRScSYyWjBNGTIDZ6ma5eAOSyxROl5/EC+Pq0qDM9XN lzDnS/Zh+6Ax7WAcy1Z0eRABRBZ0acYO9PJG4KXM1dWUhhVX9TZzuG7MiTIGg+D4Zkqnup IfTi0d11GgkYMFNuCPkvIdDmDVoHB0I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666799911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bJ3mj2WzjYICdvoiWiP+g6zitpxDd0h1j+BUjbobb6M=; b=AFb1c4917Uy/VzEee4M3ZQcfGpxfWmpfZPwgn7Ur2ZlGCNRfwy0SnaZ06T+5Ql+N4LeIoZ FFOLVHOdUyC3iFBQ== 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 5816113A6E; Wed, 26 Oct 2022 15:58:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id V6h0FSdZWWPJMgAAMHmgww (envelope-from ); Wed, 26 Oct 2022 15:58:31 +0000 From: Martin Jambor To: Alexander Monakov , gcc-patches@gcc.gnu.org Cc: Jan Hubicka , Alexander Monakov , Artem Klimov Subject: Re: [PATCH] ipa-visibility: remove assert in TLS optimization [PR107353] In-Reply-To: <20221026135238.24678-1-amonakov@ispras.ru> References: <20221026135238.24678-1-amonakov@ispras.ru> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Wed, 26 Oct 2022 17:58:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_SOFTFAIL,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: Hi, On Wed, Oct 26 2022, Alexander Monakov wrote: > When upgrading TLS access model based on optimized symbol visibility > status, we attempted to assert that recomputing the model would not > weaken it. It turns out that C, C++, and Fortran front-ends all can > (unintentionally) assign a stronger model than what can be derived > from the declaration. If you believe that FEs assign a wrong model sometimes (that is my impression after reading your bugzilla comments), please open bugs for those cases. > > Let's act conservatively instead of asserting, at least as long as > such pre-existing issues remain. > > gcc/ChangeLog: > > PR other/107353 > * ipa-visibility.cc (function_and_variable_visibility): > Conditionally upgrade TLS model instead of asserting. The patch is OK (assuming it passes bootstrap&testing). Thanks, Martin > --- > gcc/ipa-visibility.cc | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/gcc/ipa-visibility.cc b/gcc/ipa-visibility.cc > index 3ed2b7cf6..238f7eb84 100644 > --- a/gcc/ipa-visibility.cc > +++ b/gcc/ipa-visibility.cc > @@ -886,8 +886,12 @@ function_and_variable_visibility (bool whole_program) > && vnode->ref_list.referring.length ()) > { > enum tls_model new_model = decl_default_tls_model (decl); > - gcc_checking_assert (new_model >= decl_tls_model (decl)); > - set_decl_tls_model (decl, new_model); > + STATIC_ASSERT (TLS_MODEL_GLOBAL_DYNAMIC < TLS_MODEL_LOCAL_DYNAMIC); > + STATIC_ASSERT (TLS_MODEL_INITIAL_EXEC < TLS_MODEL_LOCAL_EXEC); > + /* We'd prefer to assert that recomputed model is not weaker than > + what the front-end assigned, but cannot: see PR 107353. */ > + if (new_model >= decl_tls_model (decl)) > + set_decl_tls_model (decl, new_model); > } > } > } > -- > 2.37.2