profile-count.c (profile_count::combine_with_ipa_count): Return uninitialized count...
authorJan Hubicka <hubicka@ucw.cz>
Thu, 28 Nov 2019 17:04:41 +0000 (18:04 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 28 Nov 2019 17:04:41 +0000 (17:04 +0000)
* profile-count.c (profile_count::combine_with_ipa_count): Return
uninitialized count if called on ininitialized count.

From-SVN: r278815

gcc/ChangeLog
gcc/profile-count.c

index 87732c84850c54c2cc89c9971c18a7682d20f7de..b85bda2c02a44beb4e219ecd64bd2d3d5d9c880b 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-28  Jan Hubicka  <hubicka@ucw.cz>
+
+       * profile-count.c (profile_count::combine_with_ipa_count): Return
+       uninitialized count if called on ininitialized count.
+
 2019-11-28  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-inline-transform.c (inline_transform): Scale profile before
index e91f9cbd26dcd1f6d6915b5aad8271755eb7a7bc..fb978c634fde8152c1484f1e25b281c66e65baf3 100644 (file)
@@ -373,6 +373,8 @@ profile_count::adjust_for_ipa_scaling (profile_count *num,
 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;