From 804424b95b112cd334ae29d942351e4c4e24ba94 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 17 May 2019 09:22:00 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/toplev.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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, -- 2.30.2