build_range_check explicitly allows LOW and HIGH to be a different type
from EXP, so we need to use w::to_widest when comparing a value based on
HIGH with a value based on EXP's type.
2017-10-04 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/82413
* fold-const.c (build_range_check): Use widest_int when comparing
the maximum ETYPE value with HIGH.
gcc/testsuite/
PR tree-optimization/82413
* g++.dg/pr82413.C: New test.
From-SVN: r253401
+2017-10-04 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/82413
+ * fold-const.c (build_range_check): Use widest_int when comparing
+ the maximum ETYPE value with HIGH.
+
2017-10-04 Wilco Dijkstra <wdijkstr@arm.com>
PR rtl-optimization/82396
{
int prec = TYPE_PRECISION (etype);
- if (wi::mask (prec - 1, false, prec) == high)
+ if (wi::mask <widest_int> (prec - 1, false) == wi::to_widest (high))
{
if (TYPE_UNSIGNED (etype))
{
+2017-10-04 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/82413
+ * g++.dg/pr82413.C: New test.
+
2017-10-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/77296
--- /dev/null
+bool a;
+int b;
+void c() { b &&a <= 0; }