2017-08-03 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/81655
+ PR tree-optimization/81588
+ * tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle also
+ the case when ranges[i].low and high are 1 for unsigned type with
+ precision 1.
+
PR middle-end/81052
* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.
(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.
for (i = 0; i < length; i++)
{
+ bool in_p = ranges[i].in_p;
if (ranges[i].low == NULL_TREE
- || ranges[i].high == NULL_TREE
- || !integer_zerop (ranges[i].low)
- || !integer_zerop (ranges[i].high))
+ || ranges[i].high == NULL_TREE)
continue;
+ if (!integer_zerop (ranges[i].low)
+ || !integer_zerop (ranges[i].high))
+ {
+ if (ranges[i].exp
+ && TYPE_PRECISION (TREE_TYPE (ranges[i].exp)) == 1
+ && TYPE_UNSIGNED (TREE_TYPE (ranges[i].exp))
+ && integer_onep (ranges[i].low)
+ && integer_onep (ranges[i].high))
+ in_p = !in_p;
+ else
+ continue;
+ }
gimple *stmt;
tree_code ccode;
default:
continue;
}
- if (ranges[i].in_p)
+ if (in_p)
ccode = invert_tree_comparison (ccode, false);
switch (ccode)
{