PR middle-end/89655
PR bootstrap/89656
* vr-values.c (vr_values::update_value_range): If
old_vr->varying_p (), don't update it, make new_vr also VARYING
and return false.
* gcc.c-torture/compile/pr89655.c: New test.
From-SVN: r269597
+2019-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89655
+ PR bootstrap/89656
+ * vr-values.c (vr_values::update_value_range): If
+ old_vr->varying_p (), don't update it, make new_vr also VARYING
+ and return false.
+
2019-03-11 Martin Liska <mliska@suse.cz>
* config/aarch64/aarch64.c (aarch64_override_options_internal):
+2019-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89655
+ PR bootstrap/89656
+ * gcc.c-torture/compile/pr89655.c: New test.
+
2019-03-11 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/arm/f16_f64_conv_no_dp.c: Add arm_fp16_ok effective
--- /dev/null
+/* PR middle-end/89655 */
+
+int a, b, d;
+char *c;
+
+void
+foo (void)
+{
+ int f = a;
+ for (;;)
+ {
+ for (f = 0; f < (a > 3 ? : a); f++)
+ b = c[f] ? c[(f + 2 > a - 1 ? a - 1 : 2) * d] : 0;
+ }
+}
because VR_RANGE and VR_ANTI_RANGE need to be considered
the same. We may not have is_new when transitioning to
UNDEFINED. If old_vr->type is VARYING, we shouldn't be
- called. */
- if (new_vr->undefined_p ())
+ called, if we are anyway, keep it VARYING. */
+ if (old_vr->varying_p ())
+ {
+ new_vr->set_varying ();
+ is_new = false;
+ }
+ else if (new_vr->undefined_p ())
{
old_vr->set_varying ();
new_vr->set_varying ();