Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2754)

Issue 5355042: [google] fix for undefined location list symbol in LIPO

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by xur
Modified:
12 years, 6 months ago
Reviewers:
Cary, davidxl, Diego Novillo
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/main/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -0 lines) Patch
M gcc/dwarf2out.c View 2 chunks +34 lines, -0 lines 0 comments Download

Messages

Total messages: 4
xur
Don't emit the type info if a function's context type is not output. For google ...
12 years, 6 months ago (2011-11-04 17:13:15 UTC) #1
davidxl
Ok for google branches. David On Fri, Nov 4, 2011 at 10:13 AM, Rong Xu ...
12 years, 6 months ago (2011-11-04 17:41:26 UTC) #2
Diego Novillo
On Fri, Nov 4, 2011 at 13:13, Rong Xu <xur@google.com> wrote: > Don't emit the ...
12 years, 6 months ago (2011-11-04 19:26:50 UTC) #3
Cary
12 years, 6 months ago (2011-11-05 06:57:01 UTC) #4
>> 2011-11-04   Rong Xu  <xur@google.com>
>>
>>        * gcc/dwarf2out.c (dwarf2out_decl): not emit type info
>>          for unreachable functions in LIPO mode.

Here's a follow-on patch to fix the build breakage caused by the
declaration in the middle of a block. It also fixes up the style
complaints that Diego mentioned. I won't be able to commit this, so
could someone else take care of it? I'd check it in as obvious, but
I'm about to leave the country, and didn't want to commit and run.

-cary


Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 181007)
+++ dwarf2out.c	(working copy)
@@ -21424,8 +21424,10 @@ dwarf2out_imported_module_or_decl (tree
 void
 dwarf2out_decl (tree decl)
 {
+  dw_die_ref context_die;
+
   /* In LIPO mode, we may output some functions whose type is defined
-     in another function that will not be output. This can result in
+     in another function that will not be output.  This can result in
      undefined location list symbols in the debug type info.
      Here we disable the output of the type info for this case.
      It is safe since this function and its debug info should never
@@ -21435,8 +21437,8 @@ dwarf2out_decl (tree decl)
       tree decl_context, orig_decl;

       decl_context = DECL_CONTEXT (decl);
-      while (decl_context &&
-          TREE_CODE (decl_context) != TRANSLATION_UNIT_DECL)
+      while (decl_context
+	     && TREE_CODE (decl_context) != TRANSLATION_UNIT_DECL)
       {
         struct cgraph_node *node;

@@ -21447,17 +21449,17 @@ dwarf2out_decl (tree decl)
         /* Refer to cgraph_mark_functions_to_output() in cgraphunit.c,
            if cgraph_is_aux_decl_external() is true,
            this function will not be output in LIPO mode.  */
-        if (TREE_CODE (decl_context) == FUNCTION_DECL &&
-            TREE_PUBLIC (decl_context) &&
-            (node = cgraph_get_node (decl_context)) &&
-            cgraph_is_aux_decl_external (node))
+        if (TREE_CODE (decl_context) == FUNCTION_DECL
+            && TREE_PUBLIC (decl_context)
+	    && (node = cgraph_get_node (decl_context))
+	    && cgraph_is_aux_decl_external (node))
           return;

         decl_context = DECL_CONTEXT (orig_decl);
       }
     }

-  dw_die_ref context_die = comp_unit_die ();
+  context_die = comp_unit_die ();

   switch (TREE_CODE (decl))
     {
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b