From: Martin Liska Date: Fri, 17 May 2019 07:22:00 +0000 (+0200) Subject: Handle a location with NULL as a file (PR driver/90495) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=804424b95b112cd334ae29d942351e4c4e24ba94;p=gcc.git Handle a location with NULL as a file (PR driver/90495) 2019-05-17 Martin Liska PR driver/90495 * toplev.c (output_stack_usage): With LTO and sanitizer it happens that a global ctor (_GLOBAL__sub_I_00099_0_main) has no file location. From-SVN: r271312 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d8bed3a817d..b1d0271cd8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-05-17 Martin Liska + + PR driver/90495 + * toplev.c (output_stack_usage): With LTO and sanitizer it + happens that a global ctor (_GLOBAL__sub_I_00099_0_main) + has no file location. + 2019-05-16 Jakub Jelinek PR c++/90484 diff --git a/gcc/toplev.c b/gcc/toplev.c index 397a164068d..a27cdc4325d 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1019,7 +1019,7 @@ output_stack_usage (void) fprintf (stack_usage_file, "%s:%d:%d:%s\t" HOST_WIDE_INT_PRINT_DEC"\t%s\n", - lbasename (loc.file), + loc.file == NULL ? "(artificial)" : lbasename (loc.file), loc.line, loc.column, name,