aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.cc')
-rw-r--r--gcc/gcc.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index becc560..16bb07f 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -4291,9 +4291,13 @@ driver_handle_option (struct gcc_options *opts,
break;
case OPT_fdiagnostics_format_:
- diagnostic_output_format_init (dc, opts->x_dump_base_name,
- (enum diagnostics_output_format)value);
- break;
+ {
+ const char *basename = (opts->x_dump_base_name ? opts->x_dump_base_name
+ : opts->x_main_input_basename);
+ diagnostic_output_format_init (dc, basename,
+ (enum diagnostics_output_format)value);
+ break;
+ }
case OPT_Wa_:
{