profile-count.c (profile_count::combine_with_ipa_count): Handle zeros correctly.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 30 Jan 2018 12:46:19 +0000 (13:46 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 30 Jan 2018 12:46:19 +0000 (12:46 +0000)
* profile-count.c (profile_count::combine_with_ipa_count): Handle
zeros correctly.

From-SVN: r257182

gcc/ChangeLog
gcc/profile-count.c

index 7be83e9930d4d62803fdff2f58df87ef079cf6a9..f20ec74acbdac426ee8746399e8cdb3b9401bbed 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-30  Jan Hubicka  <hubicka@ucw.cz>
+
+       * profile-count.c (profile_count::combine_with_ipa_count): Handle
+       zeros correctly.
+
 2018-01-30  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/83008
index c3b115f0b81c96b4456af77ff24cb1043a95dcbb..3d411cfbfb366914a0a189b1ccbe5f353cf78567 100644 (file)
@@ -321,7 +321,7 @@ profile_count::combine_with_ipa_count (profile_count ipa)
   ipa = ipa.ipa ();
   if (ipa.nonzero_p ())
     return ipa;
-  if (!ipa.initialized_p ())
+  if (!ipa.initialized_p () || *this == profile_count::zero ())
     return *this;
   if (ipa == profile_count::zero ())
     return this->global0 ();