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 7699F3858C60 for ; Mon, 13 Sep 2021 13:32:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7699F3858C60 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-out1.suse.de (Postfix) with ESMTPS id 7E90221D16; Mon, 13 Sep 2021 13:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631539930; 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=kzbtbSEjCID3ZOr02ikOd4T8YBAP2GRAWWb+kYKlHwI=; b=0VASTyq/9miIZY9a7B8MvvkIsBRuyzOmk+pVP85xeEOInUjdZvwguSvsD2ltmqG7J//tLG gZl6t/PCOfMFWvdB3ngL78fMdoYdCrUV45w8art34vp9hjt2aX7souPL8Kb7HTaBXha19m KRuLhWasOFEqHfVpxR6Fl5NJXA0++V0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631539930; 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=kzbtbSEjCID3ZOr02ikOd4T8YBAP2GRAWWb+kYKlHwI=; b=M2A58RBkMS4zcvQCatT+JKWMsbqXMytPLSTG6N+YQ0XzVSBqRMSMFhyPrn0sBONjJ8FN63 5O91A57cmzf4McAQ== 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 47DD713AB4; Mon, 13 Sep 2021 13:32:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fX5qENpSP2F+RAAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:32:10 +0000 Message-ID: <17a52ac5-dcc5-ef20-2399-0481b7e700d5@suse.cz> Date: Mon, 13 Sep 2021 15:32:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [PATCH] flag_complex_method: support optimize attribute Content-Language: en-US From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: Richard Biener , Jakub Jelinek Cc: Michael Matz , GCC Patches References: <82e71ebf-7b2e-67e7-1f08-ea525deee4cb@suse.cz> <1dfa7226-3056-d215-4626-01126d428891@suse.cz> <88fde73d-d36a-2010-5837-30f2943d9dad@suse.cz> <766332d7-388b-3697-9a7b-1933c030a966@suse.cz> <20210906114613.GU920497@tucnak> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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, 13 Sep 2021 13:32:12 -0000 PING^1 On 9/7/21 11:42, Martin Liška wrote: > On 9/6/21 14:16, Richard Biener wrote: >> On Mon, Sep 6, 2021 at 1:46 PM Jakub Jelinek wrote: >>> >>> On Mon, Sep 06, 2021 at 01:37:46PM +0200, Martin Liška wrote: >>>> --- a/gcc/opts.c >>>> +++ b/gcc/opts.c >>>> @@ -1323,6 +1323,14 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, >>>>         = (opts->x_flag_unroll_loops >>>>            || opts->x_flag_peel_loops >>>>            || opts->x_optimize >= 3); >>>> + >>>> +  /* With -fcx-limited-range, we do cheap and quick complex arithmetic.  */ >>>> +  if (opts->x_flag_cx_limited_range) >>>> +    flag_complex_method = 0; >>>> + >>>> +  /* With -fcx-fortran-rules, we do something in-between cheap and C99.  */ >>>> +  if (opts->x_flag_cx_fortran_rules) >>>> +    flag_complex_method = 1; >>> >>> That should then be opts->x_flag_complex_method instead of flag_complex_method. >>> >>> Ok with that change. >> >> But the C/C++ langhooks also set flag_complex_method so I fail to see how >> this helps?  As said I was referring to -fcx-limited-range on the command-line >> and -fno-cx-limited-range in the optimize node to undo this which should >> get you the langhook setting of flag_complex_method = 2. > > You are right, it's even more complicated as -fno-cx-limited-range is target specific. > Option handling has been introducing surprises every time ... > > The following tested patch should handle it. > > Ready to be installed? > Thanks, > Martin > >> >>> Note, I think we want to do much more in finish_options and less in >>> process_options, anything that is about Optimization options rather than >>> just the global ones.  Though one needs to be careful with the cases where >>> the code diagnoses something. >>> >>>          Jakub >>>