Minor fix for profile_count::combine_with_ipa_count

Message ID 20191128170605.uvkuipsxgusyhj3x@kam.mff.cuni.cz
State New
Headers show
Series
  • Minor fix for profile_count::combine_with_ipa_count
Related show

Commit Message

Jan Hubicka Nov. 28, 2019, 5:06 p.m.
Hi,
this patch makes combine_with_ipa_count to return uninitialized when
called on uninitialized count. Previously in some cases it returned
IPA, which is probably not a big deal but it should not do that for
consistency.

Bootstrapped/regtested x86_64-linux, comitted.

	* profile-count.c (profile_count::combine_with_ipa_count): Return
	uninitialized count if called on ininitialized count.

Patch

Index: profile-count.c
===================================================================
--- profile-count.c	(revision 278814)
+++ profile-count.c	(working copy)
@@ -373,6 +376,8 @@  profile_count::adjust_for_ipa_scaling (p
 profile_count
 profile_count::combine_with_ipa_count (profile_count ipa)
 {
+  if (!initialized_p ())
+    return *this;
   ipa = ipa.ipa ();
   if (ipa.nonzero_p ())
     return ipa;