diff options
author | Cary Coutant <ccoutant@google.com> | 2014-05-14 21:48:47 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@gcc.gnu.org> | 2014-05-14 14:48:47 -0700 |
commit | bc91b0e0869c090d093ade248feaae54ca45550d (patch) | |
tree | 85d6b02ec6b3b63f2df6520db9aa013275cfc641 /gcc/opts.c | |
parent | 5f35dde552bfb56e7517e4e0fd0b90acad08347a (diff) | |
download | gcc-bc91b0e0869c090d093ade248feaae54ca45550d.zip gcc-bc91b0e0869c090d093ade248feaae54ca45550d.tar.gz gcc-bc91b0e0869c090d093ade248feaae54ca45550d.tar.bz2 |
Change -g so that it will override -g1 but not -g3.
gcc/
PR debug/61013
* opts.c (common_handle_option): Don't special-case "-g".
(set_debug_level): Default to at least level 2 with "-g".
From-SVN: r210442
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -1814,13 +1814,8 @@ common_handle_option (struct gcc_options *opts, break; case OPT_g: - /* -g by itself should force -g2. */ - if (*arg == '\0') - set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, "2", opts, opts_set, - loc); - else - set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg, opts, opts_set, - loc); + set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg, opts, opts_set, + loc); break; case OPT_gcoff: @@ -2070,10 +2065,12 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg, opts_set->x_write_symbols = type; } - /* A debug flag without a level defaults to level 2. */ + /* A debug flag without a level defaults to level 2. + If off or at level 1, set it to level 2, but if already + at level 3, don't lower it. */ if (*arg == '\0') { - if (!opts->x_debug_info_level) + if (opts->x_debug_info_level < DINFO_LEVEL_NORMAL) opts->x_debug_info_level = DINFO_LEVEL_NORMAL; } else |