From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 1B1783858414 for ; Mon, 6 Sep 2021 12:17:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B1783858414 Received: by mail-ej1-x62e.google.com with SMTP id bt14so13166140ejb.3 for ; Mon, 06 Sep 2021 05:17:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HmlNyZwc9fMCuUsIADruEDH5SC/HPt3u/nremCNCzTA=; b=pSUDywN6+lg6eptoWkCW8AcU+XtkQ0su8UD4jdj6vzTvmXp2fcVbWB8fdB9mUFQ5HO W3K1j0ryrirSm9SZtVf78K3xpKYUnojY9AXMefCbNwiT1i7DJv45fGHMgaMxpo/xNOcg ivktOSsTkV7eyWRYUUrzvFr9FFDRq7OMuRu40hhsnq9MFNjprHPwXqD6u26JCG6E/H9u sCkiIjCLIbBgl7euhmDDcqwzjih8RY69l0HgLyK3hWppWl7wDYP0h/BnyblHKv6z4GgX fXZuRHRj3CeAbWyK+pzNdRGdxVqacW361In9ulAK8c0lLzjZk/Ect6gbvr2n4AdkLXtB ppQQ== X-Gm-Message-State: AOAM53005pf+c+lWUtqA8m8YqlxIWn7uH9vjuAmWuYhsmmehLBA98N1n 5XhHJjadMaf1Fl+K28v/1sE6pSxxA5S3vGIcIqE= X-Google-Smtp-Source: ABdhPJwKQ92LCQW7LDFy9OQ7W8VnpLwWqePskyXkqZJlhYa1/VUxBOxZKSeEKNBjakJMs2qJM6p+d8/T0fCf7GGKzcY= X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr13077470ejc.429.1630930629059; Mon, 06 Sep 2021 05:17:09 -0700 (PDT) MIME-Version: 1.0 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: <20210906114613.GU920497@tucnak> From: Richard Biener Date: Mon, 6 Sep 2021 14:16:58 +0200 Message-ID: Subject: Re: [PATCH] flag_complex_method: support optimize attribute To: Jakub Jelinek Cc: =?UTF-8?Q?Martin_Li=C5=A1ka?= , GCC Patches , Michael Matz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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, 06 Sep 2021 12:17:11 -0000 On Mon, Sep 6, 2021 at 1:46 PM Jakub Jelinek wrote: > > On Mon, Sep 06, 2021 at 01:37:46PM +0200, Martin Li=C5=A1ka wrote: > > --- a/gcc/opts.c > > +++ b/gcc/opts.c > > @@ -1323,6 +1323,14 @@ finish_options (struct gcc_options *opts, struct= gcc_options *opts_set, > > =3D (opts->x_flag_unroll_loops > > || opts->x_flag_peel_loops > > || opts->x_optimize >=3D 3); > > + > > + /* With -fcx-limited-range, we do cheap and quick complex arithmetic= . */ > > + if (opts->x_flag_cx_limited_range) > > + flag_complex_method =3D 0; > > + > > + /* With -fcx-fortran-rules, we do something in-between cheap and C99= . */ > > + if (opts->x_flag_cx_fortran_rules) > > + flag_complex_method =3D 1; > > That should then be opts->x_flag_complex_method instead of flag_complex_m= ethod. > > 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-l= ine and -fno-cx-limited-range in the optimize node to undo this which should get you the langhook setting of flag_complex_method =3D 2. > 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 wher= e > the code diagnoses something. > > Jakub >