Hello,
I managed to mess up my testing today for the unreachable function change and 
profiling
update.  The following patch should fix the fallout.
First problem is testsuite expecting that extern inlines are not instrumented. 
While
this is not handled consistently for years (since ealry inlining was 
introduced) my
patch made it worse.
Second fix removes overactive sanity check - symtab_remove_unreachable_nodes 
can iterate
in rare cases and thus it is unsafe to use it for testing that it was run 
previously.

Bootstrap/regtest in progress, will commit once it passes.

Honza

        * tree-profile.c (tree_profiling): Skip external functions
        when doing coverage instrumentation.
        * cgraphunit.c (compile): Do not assert that all nodes are reachable.

        * gcc.dg/ipa/ctor-empty-1.c: Update template.
Index: tree-profile.c
===================================================================
--- tree-profile.c      (revision 214223)
+++ tree-profile.c      (working copy)
@@ -578,6 +578,13 @@ tree_profiling (void)
       if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
        continue;
 
+      /* Do not instrument extern inline functions when testing coverage.
+        While this is not perfectly consistent (early inlined extern inlines
+        will get acocunted), testsuite expects that.  */
+      if (DECL_EXTERNAL (node->decl)
+         && flag_test_coverage)
+       continue;
+
       push_cfun (DECL_STRUCT_FUNCTION (node->decl));
 
       /* Local pure-const may imply need to fixup the cfg.  */
Index: cgraphunit.c
===================================================================
--- cgraphunit.c        (revision 214224)
+++ cgraphunit.c        (working copy)
@@ -2209,11 +2209,6 @@ compile (void)
   cgraph_materialize_all_clones ();
   bitmap_obstack_initialize (NULL);
   execute_ipa_pass_list (g->get_passes ()->all_late_ipa_passes);
-#ifdef ENABLE_CHECKING
-  symtab_node::verify_symtab_nodes ();
-  /* Verify late IPA passes cleaned up after themselves.  */
-  gcc_assert (!symtab_remove_unreachable_nodes (false, dump_file));
-#endif
   bitmap_obstack_release (NULL);
   mark_functions_to_output ();
 
Index: testsuite/gcc.dg/ipa/ctor-empty-1.c
===================================================================
--- testsuite/gcc.dg/ipa/ctor-empty-1.c (revision 214239)
+++ testsuite/gcc.dg/ipa/ctor-empty-1.c (working copy)
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -c -fdump-ipa-cgraph"  } */
+/* { dg-options "-O3 -c -fdump-ipa-free-inline-summary"  } */
 static __attribute__((constructor))
 void empty_constructor()
 {
 }
-/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor"  
"cgraph"  } } */
-/* { dg-final { cleanup-ipa-dump "cgraph" } } */
+/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor"  
"free-inline-summary"  } } */
+/* { dg-final { cleanup-ipa-dump "free-inline-summary" } } */
Index: testsuite/g++.dg/ipa/devirt-37.C
===================================================================
--- testsuite/g++.dg/ipa/devirt-37.C    (revision 214240)
+++ testsuite/g++.dg/ipa/devirt-37.C    (working copy)
@@ -30,7 +30,7 @@ t()
 /* After inlining the call within constructor needs to be checked to not go 
into a basetype.
    We should see the vtbl store and we should notice extcall as possibly 
clobbering the
    type but ignore it because b is in static storage.  */
-/* { dg-final { scan-tree-dump "Determined dynamic type."  "fre2"  } } */
+/* { dg-final { scan-tree-dump "No dynamic type change found."  "fre2"  } } */
 /* { dg-final { scan-tree-dump "Checking vtbl store:"  "fre2"  } } */
 /* { dg-final { scan-tree-dump "Function call may change dynamic type:extcall" 
 "fre2"  } } */
 /* { dg-final { scan-tree-dump "converting indirect call to function virtual 
void"  "fre2"  } } */
Index: testsuite/g++.dg/ipa/devirt-40.C
===================================================================
--- testsuite/g++.dg/ipa/devirt-40.C    (revision 0)
+++ testsuite/g++.dg/ipa/devirt-40.C    (revision 0)
@@ -0,0 +1,23 @@
+/* { dg-options "-O2 -fdump-tree-fre2-details"  } */
+typedef enum
+{
+} UErrorCode;
+class UnicodeString
+{
+public:
+  UnicodeString ();
+  virtual ~UnicodeString ();
+};
+class A
+{
+  UnicodeString &m_fn1 (UnicodeString &, int &p2, UErrorCode &) const;
+};
+UnicodeString::UnicodeString () {}
+UnicodeString &
+A::m_fn1 (UnicodeString &, int &p2, UErrorCode &) const
+{
+  UnicodeString a[2];
+}
+
+/* { dg-final { scan-tree-dump-not "converting indirect call to function 
virtual UnicodeString" "fre2"  } } */
+/* { dg-final { cleanup-tree-dump "fre2" } } */

Reply via email to