Handle a location with NULL as a file (PR driver/90495)
authorMartin Liska <mliska@suse.cz>
Fri, 17 May 2019 07:22:00 +0000 (09:22 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 17 May 2019 07:22:00 +0000 (07:22 +0000)
2019-05-17  Martin Liska  <mliska@suse.cz>

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
gcc/toplev.c

index d8bed3a817d332952ef0e5d6950e9b96cc9e05fb..b1d0271cd8ef549bc1b67b28424f05920c4f9df3 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-17  Martin Liska  <mliska@suse.cz>
+
+       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  <jakub@redhat.com>
 
        PR c++/90484
index 397a164068d2a1ede02d9407bd14d8323256c3fc..a27cdc4325d5d882801155dd6ece93c426867c78 100644 (file)
@@ -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,