]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix setting of hotness in non-LTO mode (PR gcov-profile/77698).
authorMartin Liska <mliska@suse.cz>
Mon, 5 Nov 2018 07:32:48 +0000 (08:32 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 5 Nov 2018 07:32:48 +0000 (07:32 +0000)
2018-11-05  Martin Liska  <mliska@suse.cz>

PR gcov-profile/77698
* ipa-profile.c (ipa_profile): Adjust hotness threshold
only in LTO mode.
2018-11-05  Martin Liska  <mliska@suse.cz>

PR gcov-profile/77698
* gcc.dg/tree-prof/pr77698.c: New test.

From-SVN: r265784

gcc/ChangeLog
gcc/ipa-profile.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/pr77698.c [new file with mode: 0644]

index ac121a8366018e374d2a6ba5da52d88246b6f891..3ef29c58cbbf7c8e0dd7d526e111eb73a8d0d7ba 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-05  Martin Liska  <mliska@suse.cz>
+
+       PR gcov-profile/77698
+       * ipa-profile.c (ipa_profile): Adjust hotness threshold
+       only in LTO mode.
+
 2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        PR tree-optimization/86572
index c74f4a4a41df7dc9b29a20b6fe48ab2ef8f3b8f1..7065af59ba9fc382cea9be9b695578bf515ec155 100644 (file)
@@ -533,11 +533,10 @@ ipa_profile (void)
                   cumulated_size * 100.0 / overall_size);
        }
 
-      if (threshold > get_hot_bb_threshold ()
-         || in_lto_p)
+      if (in_lto_p)
        {
          if (dump_file)
-           fprintf (dump_file, "Threshold updated.\n");
+           fprintf (dump_file, "Setting hotness threshold in LTO mode.\n");
           set_hot_bb_threshold (threshold);
        }
     }
index a28d9a043eb109947ae1ff2258378fafcbc1e1d9..8f5bb2abb1ccd122f21835f0a80d6ecae07eab43 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-05  Martin Liska  <mliska@suse.cz>
+
+       PR gcov-profile/77698
+       * gcc.dg/tree-prof/pr77698.c: New test.
+
 2018-11-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        PR tree-optimization/86572
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr77698.c b/gcc/testsuite/gcc.dg/tree-prof/pr77698.c
new file mode 100644 (file)
index 0000000..201bfc7
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-options "-O2 -fno-tree-vectorize -funroll-loops --param max-unroll-times=4 -fno-inline -fdump-rtl-alignments" } */
+
+volatile long int g;
+volatile long int j = 0;
+
+void foo(long int *a, long int *b, long int n)
+{
+  long int i;
+
+  for (i = 0; i < n; i++)
+    a[j] = *b;
+}
+
+long int a, b;
+int main()
+{
+  a = 1; b = 2;
+  foo(&a, &b, 1000000);
+  g = a+b;
+  return 0;
+}
+
+/* { dg-final-use-not-autofdo { scan-rtl-dump-times "internal loop alignment added" 1 "alignments"} } */