]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/66503 (missing DW_AT_abstract_origin for cross-unit call sites)
authorRichard Biener <rguenther@suse.de>
Thu, 11 Jun 2015 12:44:56 +0000 (12:44 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 11 Jun 2015 12:44:56 +0000 (12:44 +0000)
2015-06-11  Richard Biener  <rguenther@suse.de>

PR middle-end/66503
* dwarf2out.c (resolve_addr): Guard backport of PR66549
with in_lto_p.

From-SVN: r224372

gcc/ChangeLog
gcc/dwarf2out.c

index 17dda0a267636f5a8a4cc13f23b5940ac36ba2cc..aac374463d808cbfaced1df48a4e8633c094da84 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-11  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/66503
+       * dwarf2out.c (resolve_addr): Guard backport of PR66549
+       with in_lto_p.
+
 2015-06-10  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        Backport from mainline:
index 6543d81e93cd960c1b9d4f85fde34011bcf3e483..6b4e83ad566056d89f07855588d4b7edab1c9b6a 100644 (file)
@@ -23426,22 +23426,29 @@ resolve_addr (dw_die_ref die)
          {
            tree tdecl = SYMBOL_REF_DECL (a->dw_attr_val.v.val_addr);
            dw_die_ref tdie = lookup_decl_die (tdecl);
-           dw_die_ref cdie;
            if (tdie == NULL
                && DECL_EXTERNAL (tdecl)
-               && DECL_ABSTRACT_ORIGIN (tdecl) == NULL_TREE
-               && (cdie = lookup_context_die (DECL_CONTEXT (tdecl))))
+               && DECL_ABSTRACT_ORIGIN (tdecl) == NULL_TREE)
              {
-               /* Creating a full DIE for tdecl is overly expensive and
-                  at this point even wrong when in the LTO phase
-                  as it can end up generating new type DIEs we didn't
-                  output and thus optimize_external_refs will crash.  */
-               tdie = new_die (DW_TAG_subprogram, cdie, NULL_TREE);
-               add_AT_flag (tdie, DW_AT_external, 1);
-               add_AT_flag (tdie, DW_AT_declaration, 1);
-               add_linkage_attr (tdie, tdecl);
-               add_name_and_src_coords_attributes (tdie, tdecl);
-               equate_decl_number_to_die (tdecl, tdie);
+               dw_die_ref cdie;
+               if (!in_lto_p)
+                 {
+                   force_decl_die (tdecl);
+                   tdie = lookup_decl_die (tdecl);
+                 }
+               else if ((cdie = lookup_context_die (DECL_CONTEXT (tdecl))))
+                 {
+                   /* Creating a full DIE for tdecl is overly expensive and
+                      at this point even wrong when in the LTO phase
+                      as it can end up generating new type DIEs we didn't
+                      output and thus optimize_external_refs will crash.  */
+                   tdie = new_die (DW_TAG_subprogram, cdie, NULL_TREE);
+                   add_AT_flag (tdie, DW_AT_external, 1);
+                   add_AT_flag (tdie, DW_AT_declaration, 1);
+                   add_linkage_attr (tdie, tdecl);
+                   add_name_and_src_coords_attributes (tdie, tdecl);
+                   equate_decl_number_to_die (tdecl, tdie);
+                 }
              }
            if (tdie)
              {