PR target/66112
* internal-fn.c (get_min_precision): Use UNSIGNED instead of
SIGNED to get precision of non-negative value.
* gcc.target/i386/pr66112-1.c: New test.
From-SVN: r223115
+2015-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/66112
+ * internal-fn.c (get_min_precision): Use UNSIGNED instead of
+ SIGNED to get precision of non-negative value.
+
2015-05-13 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/66048
}
else if (sign == UNSIGNED && !wi::neg_p (arg_min, SIGNED))
{
- int p = wi::min_precision (arg_max, SIGNED);
+ int p = wi::min_precision (arg_max, UNSIGNED);
prec = MIN (prec, p);
}
return prec + (orig_sign != sign);
+2015-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/66112
+ * gcc.target/i386/pr66112-1.c: New test.
+
2015-05-13 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/66048
--- /dev/null
+/* PR target/66112 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int
+foo (long long a, long long b)
+{
+ unsigned int res;
+ a &= ~0U;
+ b &= ~0U;
+ if (__builtin_mul_overflow (a, b, &res))
+ res = 0x123U;
+ return res;
+}
+
+/* { dg-final { scan-assembler "jn?o\[ \t\]" } } */