===================================================================
@@ -19764,10 +19764,6 @@
{
struct cgraph_node *node;
- orig_decl = DECL_ORIGIN (decl_context);
- while (orig_decl != DECL_ORIGIN (orig_decl))
- orig_decl = DECL_ORIGIN (orig_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. */
@@ -19777,6 +19773,16 @@
cgraph_is_aux_decl_external (node))
return;
+ if (TREE_CODE_CLASS (TREE_CODE (decl_context)) == tcc_type)
+ {
+ decl_context = TYPE_CONTEXT (decl_context);
+ continue;
+ }
+
+ orig_decl = DECL_ORIGIN (decl_context);
+ while (orig_decl != DECL_ORIGIN (orig_decl))
+ orig_decl = DECL_ORIGIN (orig_decl);
+
decl_context = DECL_CONTEXT (orig_decl);
}
}