From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by sourceware.org (Postfix) with ESMTPS id 279F33858D35 for ; Tue, 15 Sep 2020 06:40:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 279F33858D35 Received: by mail-ed1-x543.google.com with SMTP id g4so1926317edk.0 for ; Mon, 14 Sep 2020 23:40:26 -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; bh=PntlH9EeBM68sVQVBZkfjWqzcxLKpUYbsGyrqp8yxkc=; b=FTy0ViS3QSpY3BCpk1fueLCQ+HPF4wLYly+61emwVqP8E/jkI+plmlAbQ4mLgGFy4F jS54ZKX9I5n1g0sezxS5xl7n5pkeLefPgB/kWt8ZjaSVvVI7kcIAz6vmug4SVGMe807v 5nPabXpkdYLQ0/n5dJYz2QjOL+q9ZGLca8sNORAhq5ni4Gwo0a4G2kT6MQdd8MXLkgOR YeA/NzzQsn0TPos+xTG2koaRWYSQSAOUSHfvTvLZ+wg+2CzOxVjYxZQr9EylYEQ1UTlF AEdWXYT7dy5+li0YE5/HWuD62yg20LA3uwtoIw03YcTY5+Ed6pRTXbkAR+KBwFDvQnJx a8HA== X-Gm-Message-State: AOAM5332lrfA3kwadsgJuFzREqK7I+GV+Jzb/ZtgC1uO7oRKzRT0XRk/ F7m4+THAtY0c0faVFmAH5qGnpcalUQPqujTvqqY= X-Google-Smtp-Source: ABdhPJxygUoVl3o92N4+305NBWBurOZHpKVNetTyOdX05rqnm81uvMV0YOp7/++QH5/4OaGvPZ3cHhHELK1f2qkjpj0= X-Received: by 2002:a50:84a2:: with SMTP id 31mr21274641edq.138.1600152025217; Mon, 14 Sep 2020 23:40:25 -0700 (PDT) MIME-Version: 1.0 References: <20200911215518.2646852-1-slyfox@gentoo.org> <20200914235703.4f247e61@sf> In-Reply-To: <20200914235703.4f247e61@sf> From: Richard Biener Date: Tue, 15 Sep 2020 08:40:14 +0200 Message-ID: Subject: Re: [PATCH] -fprofile-reproducible: fix option value handling To: Sergei Trofimovich Cc: GCC Patches , Martin Liska , Sergei Trofimovich Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 15 Sep 2020 06:40:27 -0000 On Tue, Sep 15, 2020 at 12:57 AM Sergei Trofimovich wrote: > > On Mon, 14 Sep 2020 09:34:08 +0200 > Richard Biener wrote: > > > On Fri, Sep 11, 2020 at 11:56 PM Sergei Trofimovich via Gcc-patches > > wrote: > > > > > > From: Sergei Trofimovich > > > > > > Before the change option handling did not accept an argument: > > > xgcc: error: unknown profile reproducibility method '=serial' > > > xgcc: note: valid arguments to '-fprofile-reproducible' are: multithreaded parallel-runs serial; did you mean 'serial'? > > > > > > The change also includes trailing '=' as part of option prefix. > > > > Does it still work without an option then? > > '-fprofile-reproducible' seems to be unacceptable value. > > Initially when I sent the patch I though there was no way to pass > the option to gcc. But now I understand how to do it (case 4): > > Before: > 1 $ gcc-11.0.0 -c -fprofile-reproducible a.c -o a > gcc-11.0.0: error: missing argument to '-fprofile-reproducible' > 2 $ gcc-11.0.0 -c -fprofile-reproducible= a.c -o a > gcc-11.0.0: error: unknown profile reproducibility method '=' > gcc-11.0.0: note: valid arguments to '-fprofile-reproducible' are: multithreaded parallel-runs serial > 3 $ gcc-11.0.0 -c -fprofile-reproducible=serial a.c -o a > gcc-11.0.0: error: unknown profile reproducibility method '=serial' > gcc-11.0.0: note: valid arguments to '-fprofile-reproducible' are: multithreaded parallel-runs serial; did you mean 'serial'? > 4 $ gcc-11.0.0 -c -fprofile-reproducibleserial a.c -o a > # ok > > Note: case 4 was a way to pass the option. > > After: > 1 $ ./xgcc -B. -c -fprofile-reproducible a.c -o a.o > xgcc: error: unrecognized command-line option '-fprofile-reproducible'; did you mean '-fprofile-reproducible='? > 2 $ ./xgcc -B. -c -fprofile-reproducible= a.c -o a.o > xgcc: error: missing argument to '-fprofile-reproducible=' > 3 $ ./xgcc -B. -c -fprofile-reproducible=serial a.c -o a.o > # ok > 4 $ ./xgcc -B. -c -fprofile-reproducibleserial a.c -o a.o > xgcc: error: unrecognized command-line option '-fprofile-reproducibleserial'; did you mean '-fprofile-reproducible=serial'? > > Note: two problems here: > a) case 2 got worse diagnostic > b) case 4 broke something that worked before > > I'll look at "a)" to check if it can be easily fixed. Is "b)" worth handling as well? > I'll need a hint or example how to handle an alias like that. I think you want sth like fdiagnostics-color Common Alias(fdiagnostics-color=,always,never) ; fdiagnostics-color= Driver Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO) -fdiagnostics-color=[never|always|auto] Colorize diagnostics. thus have -fprofile-reproducible an alias to fprofile-reproducible=,, (not sure if it works to omit the -fno-profile-reproducible case). Note I don't know what should be (parallel-runs or multithreaded) but since 'multithreaded' isn't even documented (eh), that should be probably the default. Maybe Martin has sth to say here. The question is what -fprofile-reproducible did up until now... Richard. > > OK if so. > > > > > gcc/ChangeLog: > > > > > > * common.opt: Fix handling of '-fprofile-reproducible' option. > > > --- > > > gcc/common.opt | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/gcc/common.opt b/gcc/common.opt > > > index dd68c61ae1d..84bf521128d 100644 > > > --- a/gcc/common.opt > > > +++ b/gcc/common.opt > > > @@ -2228,7 +2228,7 @@ Enum(profile_reproducibility) String(parallel-runs) Value(PROFILE_REPRODUCIBILIT > > > EnumValue > > > Enum(profile_reproducibility) String(multithreaded) Value(PROFILE_REPRODUCIBILITY_MULTITHREADED) > > > > > > -fprofile-reproducible > > > +fprofile-reproducible= > > > Common Joined RejectNegative Var(flag_profile_reproducible) Enum(profile_reproducibility) Init(PROFILE_REPRODUCIBILITY_SERIAL) > > > -fprofile-reproducible=[serial|parallel-runs|multithreaded] Control level of reproducibility of profile gathered by -fprofile-generate. > > > > > > -- > > > 2.28.0 > > > > > > -- > > Sergei