From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by sourceware.org (Postfix) with ESMTPS id AEFEA3858C27 for ; Tue, 2 Nov 2021 22:50:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEFEA3858C27 Received: by mail-ua1-x933.google.com with SMTP id q13so1017285uaq.2 for ; Tue, 02 Nov 2021 15:50:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XkGmuGKNSp0D3lnlNH9PmgZQ7WjIMVXcmHF3bfXMglY=; b=TBvFlriCLblqx/O4Qc6FXgy1sMdrt54usXe+GQTaotwLjrgg9ojIOhErDhgdEr2E0z NOKsChj2J/28D0N7qEfu886sdpzDT717JGnS48KBxISumgJvFsGNcxXdNFZ6zPWZ2Djd s/jsH8qgozqaXjBJdF4FNo2uZOlDmD+JQn4161MIp82LVxzLpTnLn1gtX7textjB5p/u bGZId2SoCs0fWqu7esMRgFdkNTk2XQ9TQkqXzEKjL9NiD3jOFBGoHJS0ztdjQGTIV1lm wQpOw51JW62uDbnQnnRQcsK6WPcT4upAsgFN0jro78gDF9q1i7Icu+cJ8ZwvuxzpFkR3 t7Mw== X-Gm-Message-State: AOAM533O6vFFDJzvml3AaABR9Ntx7pPX16xvd6Se+HM+dRwipbbjR4kh VYMeY+55Ne/vNhuC7dXnhUf5cvT5lsR0V+sLruo= X-Google-Smtp-Source: ABdhPJxEGVL2xj0q+2qO1WESkb4Bcoea7STZ0w2i2jnhiw1igyTJr0NJKSyhxQR7kRaPxLfFl/v/ADFbK7r/gIWUyy4= X-Received: by 2002:ab0:132e:: with SMTP id g43mr41515641uae.21.1635893401242; Tue, 02 Nov 2021 15:50:01 -0700 (PDT) MIME-Version: 1.0 References: <435f9ee2-88c6-392e-3584-2337dd5dd9c1@suse.cz> In-Reply-To: <435f9ee2-88c6-392e-3584-2337dd5dd9c1@suse.cz> From: Andrew Pinski Date: Tue, 2 Nov 2021 15:49:48 -0700 Message-ID: Subject: Re: [PATCH] Record that -gtoggle is already used in gcc_options. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.6 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.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: Tue, 02 Nov 2021 22:50:03 -0000 On Tue, Nov 2, 2021 at 7:11 AM Martin Li=C5=A1ka wrote: > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > When doing flip based on -gtoggle, record it. Otherwise, we will > apply it for the second time in finish_options. > > PR debug/102955 > > gcc/ChangeLog: > > * common.opt: Add new gtoggle_used variable. > * opts.c (finish_options): Do not interpret flag_gtoggle twice. > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr102955.c: New test. Hmm, this is a C++ testcase so shouldn't it be at g++.dg/pr102955.C ? Thanks, Andrew Pinski > --- > gcc/common.opt | 4 ++++ > gcc/opts.c | 3 ++- > gcc/testsuite/gcc.dg/pr102955.c | 14 ++++++++++++++ > 3 files changed, 20 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.dg/pr102955.c > > diff --git a/gcc/common.opt b/gcc/common.opt > index 1a5b9bfcca9..2568ecb98b8 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -3316,6 +3316,10 @@ gdescribe-dies > Common Driver Var(flag_describe_dies) Init(0) > Add description attributes to some DWARF DIEs that have no name attribu= te. > > +; True if -gtoggle option was already handled. > +Variable > +bool gtoggle_used > + > gtoggle > Common Driver Var(flag_gtoggle) > Toggle debug information generation. > diff --git a/gcc/opts.c b/gcc/opts.c > index 3f80fce82bc..ef38b8dbab0 100644 > --- a/gcc/opts.c > +++ b/gcc/opts.c > @@ -1375,8 +1375,9 @@ finish_options (struct gcc_options *opts, struct gc= c_options *opts_set, > profile_flag =3D 0; > } > > - if (flag_gtoggle) > + if (flag_gtoggle && !gtoggle_used) > { > + gtoggle_used =3D true; > if (debug_info_level =3D=3D DINFO_LEVEL_NONE) > { > debug_info_level =3D DINFO_LEVEL_NORMAL; > diff --git a/gcc/testsuite/gcc.dg/pr102955.c b/gcc/testsuite/gcc.dg/pr102= 955.c > new file mode 100644 > index 00000000000..de9689edec4 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr102955.c > @@ -0,0 +1,14 @@ > +/* PR debug/102955 */ > +/* { dg-do compile } */ > +/* { dg-options "-g -gtoggle" } */ > + > +#pragma GCC optimize "0" > +struct j > +{ > + explicit j (); > + ~j (); > +}; > +void g (void) > +{ > + new j(); > +} > -- > 2.33.1 >