From: Richard Biener Date: Fri, 9 Jul 2021 09:13:11 +0000 (+0200) Subject: driver/101383 - handle -gtoggle in driver X-Git-Tag: basepoints/gcc-13~5995 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3b383cf8825197e714a4a21852eca071f8e67e;p=thirdparty%2Fgcc.git driver/101383 - handle -gtoggle in driver The driver amends assembler options with for example --gdwarf-5 when debugging is enabled but the check for that does not consider the effect of -gtoggle which is not handled in the common option machinery. The following alters debug_info_level according to -gtoggle mimicing what process_options later does in the compiler. This in particular avoids changing of the cc1-checksum with every bootstrap (debug) cycle as we compute that from stage2 where we use -g -gtoggle but with --gdwarf-5 and no debug info from the compiler the assembler will fill the line table with the temporary assembler file names. 2021-07-09 Richard Biener PR driver/101383 * gcc.c (process_command): Process -gtoggle like process_options would after parsing options. --- diff --git a/gcc/gcc.c b/gcc/gcc.c index 12b3440c3420..3e98bc7973eb 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -4927,6 +4927,16 @@ process_command (unsigned int decoded_options_count, #endif } + /* Handle -gtoggle as it would later in toplev.c:process_options to + make the debug-level-gt spec function work as expected. */ + if (flag_gtoggle) + { + if (debug_info_level == DINFO_LEVEL_NONE) + debug_info_level = DINFO_LEVEL_NORMAL; + else + debug_info_level = DINFO_LEVEL_NONE; + } + if (output_file && strcmp (output_file, "-") != 0 && strcmp (output_file, HOST_BIT_BUCKET) != 0)