]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix profile_probability quality of switch
authorJan Hubicka <hubicka@ucw.cz>
Wed, 28 May 2025 10:23:48 +0000 (12:23 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Wed, 28 May 2025 10:23:48 +0000 (12:23 +0200)
This fixes ages old bug I noticed only now where switch cases, in situation
prediction is completely missing, gets all equal probability that should be
GUESSED instead of ADJUSTED.

gcc/ChangeLog:

* predict.cc (set_even_probabilities): Set quality to guessed.

gcc/predict.cc

index ef31c48bfe258064466190a8797da9d5f39e36fa..16dd9b01112b9973ae7209483962bd9756f88f4f 100644 (file)
@@ -961,7 +961,7 @@ set_even_probabilities (basic_block bb,
            if (unlikely_edges != NULL && unlikely_edges->contains (e))
              e->probability = profile_probability::very_unlikely ();
            else
-             e->probability = all / scale;
+             e->probability = (all / scale).guessed ();
          }
        else
          e->probability = profile_probability::never ();