PR tree-optimization/92452
* tree-vrp.c (vrp_prop::check_array_ref): If TRUNC_DIV_EXPR folds
into NULL_TREE, set up_bound to NULL_TREE instead of computing
MINUS_EXPR on it.
* c-c++-common/pr92452.c: New test.
From-SVN: r278080
+2019-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/92452
+ * tree-vrp.c (vrp_prop::check_array_ref): If TRUNC_DIV_EXPR folds
+ into NULL_TREE, set up_bound to NULL_TREE instead of computing
+ MINUS_EXPR on it.
+
2019-11-12 Andre Vieira <andre.simoesdiasvieira@arm.com>
* tree-vect-loop.c (vect_transform_loop): Don't overwrite epilogues
+2019-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/92452
+ * c-c++-common/pr92452.c: New test.
+
2019-11-12 Andre Vieira <andre.simoesdiasvieira@arm.com>
* gcc.dg/vect/pr92347.c: New test.
--- /dev/null
+/* PR tree-optimization/92452 */
+/* { dg-do compile } */
+/* { dg-options "-Os -Warray-bounds=1" } */
+
+#include "pr60101.c"
up_bound_p1 = int_const_binop (TRUNC_DIV_EXPR, maxbound, eltsize);
- up_bound = int_const_binop (MINUS_EXPR, up_bound_p1,
- build_int_cst (ptrdiff_type_node, 1));
+ if (up_bound_p1 != NULL_TREE)
+ up_bound = int_const_binop (MINUS_EXPR, up_bound_p1,
+ build_int_cst (ptrdiff_type_node, 1));
+ else
+ up_bound = NULL_TREE;
}
}
else