Skip to content

Commit 268b5c8

Browse files
committed
profile-count: fix /= and *= operators
PR middle-end/106059 gcc/ChangeLog: * profile-count.h: *= and /= operators need to modify this object.
1 parent 3b87943 commit 268b5c8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

gcc/profile-count.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,19 +605,21 @@ class GTY((user)) profile_probability
605605
return apply_scale (num, 1);
606606
}
607607

608-
profile_probability operator*= (int64_t den) const
608+
profile_probability operator*= (int64_t num)
609609
{
610-
return *this * den;
610+
*this = apply_scale (num, 1);
611+
return *this;
611612
}
612613

613614
profile_probability operator/ (int64_t den) const
614615
{
615616
return apply_scale (1, den);
616617
}
617618

618-
profile_probability operator/= (int64_t den) const
619+
profile_probability operator/= (int64_t den)
619620
{
620-
return *this / den;
621+
*this = apply_scale (1, den);
622+
return *this;
621623
}
622624

623625
/* Get the value of the count. */
@@ -1017,19 +1019,21 @@ struct GTY(()) profile_count
10171019
return apply_scale (num, 1);
10181020
}
10191021

1020-
profile_count operator*= (int64_t den) const
1022+
profile_count operator*= (int64_t num)
10211023
{
1022-
return *this * den;
1024+
*this = apply_scale (num, 1);
1025+
return *this;
10231026
}
10241027

10251028
profile_count operator/ (int64_t den) const
10261029
{
10271030
return apply_scale (1, den);
10281031
}
10291032

1030-
profile_count operator/= (int64_t den) const
1033+
profile_count operator/= (int64_t den)
10311034
{
1032-
return *this / den;
1035+
*this = apply_scale (1, den);
1036+
return *this;
10331037
}
10341038

10351039
/* Return true when value is not zero and can be used for scaling.

0 commit comments

Comments
 (0)