From 14c7041a1f00ef4ee9a036e0b369c97646db5b5c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 1 Nov 2021 16:28:34 +0100 Subject: 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. --- gcc/opts.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/opts.c') diff --git a/gcc/opts.c b/gcc/opts.c index 3f80fce..caed625 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1377,6 +1377,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if (flag_gtoggle) { + /* Make sure to process -gtoggle only once. */ + flag_gtoggle = false; if (debug_info_level == DINFO_LEVEL_NONE) { debug_info_level = DINFO_LEVEL_NORMAL; -- cgit v1.1