]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cgraphunit.c
Correct a function pre/postcondition [PR102403].
[thirdparty/gcc.git] / gcc / cgraphunit.c
index cf64e56ab951a0a757e507f59c236523b003a6be..55cb0347149c4658e603751f41f80f263438381d 100644 (file)
@@ -678,8 +678,6 @@ cgraph_node::analyze (void)
          gimple_register_cfg_hooks ();
          bitmap_obstack_initialize (NULL);
          execute_pass_list (cfun, g->get_passes ()->all_lowering_passes);
-         free_dominance_info (CDI_POST_DOMINATORS);
-         free_dominance_info (CDI_DOMINATORS);
          compact_blocks ();
          bitmap_obstack_release (NULL);
          lowered = true;
@@ -859,8 +857,11 @@ process_function_and_variable_attributes (cgraph_node *first,
       if (node->alias
          && lookup_attribute ("flatten", DECL_ATTRIBUTES (decl)))
        {
-         warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
-                     "%<flatten%> attribute is ignored on aliases");
+         tree tdecl = node->get_alias_target_tree ();
+         if (!tdecl || !DECL_P (tdecl)
+             || !lookup_attribute ("flatten", DECL_ATTRIBUTES (tdecl)))
+           warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wattributes,
+                       "%<flatten%> attribute is ignored on aliases");
        }
       if (DECL_PRESERVE_P (decl))
        node->mark_force_output ();
@@ -1073,7 +1074,7 @@ check_global_declaration (symtab_node *snode)
       && ! DECL_ARTIFICIAL (decl)
       && ! TREE_PUBLIC (decl))
     {
-      if (TREE_NO_WARNING (decl))
+      if (warning_suppressed_p (decl, OPT_Wunused))
        ;
       else if (snode->referred_to_p (/*include_self=*/false))
        pedwarn (input_location, 0, "%q+F used but never defined", decl);
@@ -1191,8 +1192,6 @@ analyze_functions (bool first_time)
              changed = true;
              if (symtab->dump_file)
                fprintf (symtab->dump_file, " %s", node->dump_asm_name ());
-             if (!changed && symtab->dump_file)
-               fprintf (symtab->dump_file, "\n");
            }
          if (node == first_analyzed
              || node == first_analyzed_var)
@@ -1891,10 +1890,6 @@ cgraph_node::expand (void)
      comdat groups.  */
   assemble_thunks_and_aliases ();
   release_body ();
-  /* Eliminate all call edges.  This is important so the GIMPLE_CALL no longer
-     points to the dead function body.  */
-  remove_callees ();
-  remove_all_references ();
 }
 
 /* Node comparator that is responsible for the order that corresponds