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 CF5273858002 for ; Mon, 12 Jul 2021 04:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF5273858002 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 AA2951FF3B; Mon, 12 Jul 2021 04:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1626063568; 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=aoO7YU90cfzJWbn6lUdFbIY7JF9ugSJsiRtyCyLR00k=; b=Dw/DKfdBNOJZ1wfZkC/1iH5QhO0H3p8aauJtm+0kZuPobDDWMOzZKKnHKUg1iNlvokC28J /twFHY5t7SMW0Eq9tXvXaJ994pCYZPzmtuebGnLyBAC1RJUVndBijOL40KYpB/QVIy6FP6 AaKTn8nYZwqusn7vVxMgRKPe/gJ2REY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1626063568; 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=aoO7YU90cfzJWbn6lUdFbIY7JF9ugSJsiRtyCyLR00k=; b=EgvwJcWi9+2hDcoMxcqYY+jk/Aw2UBZfah3aPqyNNKNWJIu8oOt+L/5o0EBE++ye1m13z1 Ea9d0/jci57ZzSCw== 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 759D11377D; Mon, 12 Jul 2021 04:19:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6gZXGtDC62BhXgAAMHmgww (envelope-from ); Mon, 12 Jul 2021 04:19:28 +0000 Subject: Re: [PATCH] rs6000: Fix restored rs6000_long_double_type_size. From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org References: <94436f10-5012-6590-d059-428a8705377e@suse.cz> <20210623224610.GH5077@gate.crashing.org> <35838613-a5fe-8b46-e223-5120dfdd9adf@suse.cz> Message-ID: Date: Mon, 12 Jul 2021 06:19:28 +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: <35838613-a5fe-8b46-e223-5120dfdd9adf@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2021 04:19:31 -0000 PING^1 On 6/28/21 2:19 PM, Martin Liška wrote: > On 6/24/21 12:46 AM, Segher Boessenkool wrote: >> Hi! >> >> On Wed, Jun 23, 2021 at 03:22:34PM +0200, Martin Liška wrote: >>> As mentioned in the "Fallout: save/restore target options in >>> handle_optimize_attribute" >>> thread, we need to support target option restore of >>> rs6000_long_double_type_size == FLOAT_PRECISION_TFmode. >> >> I have no idea?  Could you explain please? > > Sure. Few weeks ago, we started using cl_target_option_{save,restore} calls > even for optimize attributes (and pragma). Motivation was that optimize options > can influence target options (and vice versa). > > Doing that, FLOAT_PRECISION_TFmode must be accepted as a valid option value > for rs6000_long_double_type_size. > >> >>> --- a/gcc/config/rs6000/rs6000.c >>> +++ b/gcc/config/rs6000/rs6000.c >>> @@ -4185,6 +4185,8 @@ rs6000_option_override_internal (bool global_init_p) >>>         else >>>       rs6000_long_double_type_size = default_long_double_size; >>>       } >>> +  else if (rs6000_long_double_type_size == FLOAT_PRECISION_TFmode) >>> +    ; /* The option can be restored a TREE_TARGET_OPTION.  */ >> >> What does that mean?  It is not grammatical, and not obvious what it >> should mean. > > Updated. > >> >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.target/powerpc/pragma-optimize.c >>> @@ -0,0 +1,14 @@ >>> +/* { dg-do compile { target { powerpc*-*-linux* } } } */ >> >> Why on Linux only?  That doesn't sound right.  Do you need some other >> selector(s)? > > Sorry, I copied the test-case. > >> >>> +/* { dg-options "-O2 -mlong-double-128 -mabi=ibmlongdouble" } */ >>> + >>> +extern unsigned long int x; >>> +extern float f (float); >>> +extern __typeof (f) f_power8; >>> +extern __typeof (f) f_power9; >>> +extern __typeof (f) f __attribute__ ((ifunc ("f_ifunc"))); >>> +static __attribute__ ((optimize ("-fno-stack-protector"))) __typeof (f) * >> >> -fno-stack-protector is default. > > Yes, but one needs an optimize attribute in order to trigger cl_target_option_save/restore > mechanism. > > Martin > >> >>> +f_ifunc (void) >>> +{ >>> +  __typeof (f) *res = x ? f_power9 : f_power8; >>> +  return res; >>> +} >> >> The testcase should say what it is testing for, it is not obvious? >> >> >> Segher >> >