From: Andrew Pinski <pinskia@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Record that -gtoggle is already used in gcc_options.
Date: Tue, 2 Nov 2021 15:49:48 -0700 [thread overview]
Message-ID: <CA+=Sn1mONWJOwute3RR2v=Q4D+4TqJv-enj_Sz5UEmzoskZNGg@mail.gmail.com> (raw)
In-Reply-To: <435f9ee2-88c6-392e-3584-2337dd5dd9c1@suse.cz>
On Tue, Nov 2, 2021 at 7:11 AM Martin Liška <mliska@suse.cz> 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 attribute.
>
> +; 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 gcc_options *opts_set,
> profile_flag = 0;
> }
>
> - if (flag_gtoggle)
> + if (flag_gtoggle && !gtoggle_used)
> {
> + gtoggle_used = true;
> if (debug_info_level == DINFO_LEVEL_NONE)
> {
> debug_info_level = DINFO_LEVEL_NORMAL;
> diff --git a/gcc/testsuite/gcc.dg/pr102955.c b/gcc/testsuite/gcc.dg/pr102955.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
>
prev parent reply other threads:[~2021-11-02 22:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 14:10 Martin Liška
2021-11-02 14:33 ` Richard Biener
2021-11-02 15:11 ` Martin Liška
2021-11-02 16:45 ` Richard Biener
2021-11-04 12:51 ` Martin Liška
2021-11-04 13:09 ` Richard Biener
2021-11-04 15:11 ` Martin Liška
2021-11-05 10:23 ` Richard Biener
2021-11-05 12:01 ` Martin Liška
2021-11-02 22:49 ` Andrew Pinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+=Sn1mONWJOwute3RR2v=Q4D+4TqJv-enj_Sz5UEmzoskZNGg@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mliska@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).