public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR102955-gtoggle-ice-v3)] Reset when -gtoggle is used in gcc_options.
@ 2021-11-04 13:56 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-11-04 13:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b458389805f3d0677b04850d95990a88df40806f

commit b458389805f3d0677b04850d95990a88df40806f
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 1 16:28:34 2021 +0100

    Reset when -gtoggle is used in gcc_options.
    
            PR debug/102955
    
    gcc/ChangeLog:
    
            * opts.c (finish_options): Reset flag_gtoggle when it is used.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/pr102955.C: New test.

Diff:
---
 gcc/opts.c                      |  1 +
 gcc/testsuite/g++.dg/pr102955.C | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/gcc/opts.c b/gcc/opts.c
index 3f80fce82bc..442e6597b63 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1377,6 +1377,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
 
   if (flag_gtoggle)
     {
+      flag_gtoggle = false;
       if (debug_info_level == DINFO_LEVEL_NONE)
 	{
 	  debug_info_level = DINFO_LEVEL_NORMAL;
diff --git a/gcc/testsuite/g++.dg/pr102955.C b/gcc/testsuite/g++.dg/pr102955.C
new file mode 100644
index 00000000000..de9689edec4
--- /dev/null
+++ b/gcc/testsuite/g++.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();
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-04 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 13:56 [gcc(refs/users/marxin/heads/PR102955-gtoggle-ice-v3)] Reset when -gtoggle is used in gcc_options Martin Liska

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).