* dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 10 Jan 2018 20:59:04 +0000 (20:59 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 10 Jan 2018 20:59:04 +0000 (20:59 +0000)
From-SVN: r256454

gcc/ChangeLog
gcc/dwarf2out.c

index 7a989b42c4c1cc51f9d9ac87483d03c347a0adc8..413f24cf860ab3bc2fbc8041eaaaecee03be139e 100644 (file)
@@ -1,3 +1,7 @@
+2018-01-10  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * dwarf2out.c (dwarf2out_var_location): Do not pass NULL to fprintf.
+
 2018-01-10  Peter Bergner  <bergner@vnet.ibm.com>
 
        PR target/83399
index b70856fce8bfbb9b5307ac8ddce9eaeb81bb3a16..fc206562abe8905ea558eecfc48f3a0ecaf806d6 100644 (file)
@@ -26584,11 +26584,16 @@ create_label:
 
   if (var_loc_p && flag_debug_asm)
     {
-      const char *name = NULL, *sep = " => ", *patstr = NULL;
+      const char *name, *sep, *patstr;
       if (decl && DECL_NAME (decl))
        name = IDENTIFIER_POINTER (DECL_NAME (decl));
+      else
+       name = "";
       if (NOTE_VAR_LOCATION_LOC (loc_note))
-       patstr = str_pattern_slim (NOTE_VAR_LOCATION_LOC (loc_note));
+       {
+         sep = " => ";
+         patstr = str_pattern_slim (NOTE_VAR_LOCATION_LOC (loc_note));
+       }
       else
        {
          sep = " ";