profile_count ret;
gcc_checking_assert (compatible_p (other));
- ret.m_val = m_val + other.m_val;
+ uint64_t ret_val = m_val + other.m_val;
+ ret.m_val = MIN (ret_val, max_count);
ret.m_quality = MIN (m_quality, other.m_quality);
return ret;
}
else
{
gcc_checking_assert (compatible_p (other));
- m_val += other.m_val;
+ uint64_t ret_val = m_val + other.m_val;
+ m_val = MIN (ret_val, max_count);
m_quality = MIN (m_quality, other.m_quality);
}
return *this;
else
{
gcc_checking_assert (compatible_p (other));
- m_val = m_val >= other.m_val ? m_val - other.m_val: 0;
+ m_val = m_val >= other.m_val ? m_val - other.m_val : 0;
m_quality = MIN (m_quality, other.m_quality);
}
return *this;
if (!initialized_p ())
return uninitialized ();
profile_count ret;
- ret.m_val = RDIV (m_val * prob, REG_BR_PROB_BASE);
+ uint64_t tmp;
+ safe_scale_64bit (m_val, prob, REG_BR_PROB_BASE, &tmp);
+ ret.m_val = tmp;
ret.m_quality = MIN (m_quality, ADJUSTED);
return ret;
}
--- /dev/null
+/* PR tree-optimization/112303 */
+
+int a, b, d, e, f, **g, h;
+char c;
+
+int *
+foo (void)
+{
+ for (int i = 0; i < 3; i++)
+ {
+ for (h = 0; h < 2; h++)
+ ;
+ if (!b)
+ break;
+ }
+ while (f)
+ while (e)
+ {
+ c = 0;
+ while (d)
+ while (a)
+ *g = foo ();
+ }
+ return 0;
+}