Commit 90b72e84 by Richard Biener Committed by Richard Biener

re PR tree-optimization/71521 (Regression in GCC-7.0.0's optimizer)

2016-06-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71521
	* tree-vrp.c (extract_range_from_binary_expr_1): Guard
	division int_const_binop against zero divisor.

	* gcc.dg/tree-ssa/vrp101.c: New testcase.

From-SVN: r237425
parent 3db5773f
2016-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/71521
* tree-vrp.c (extract_range_from_binary_expr_1): Guard
division int_const_binop against zero divisor.
2016-06-13 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (signbittf2): New expander.
......
2016-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/71521
* tree-vrp.c (extract_range_from_binary_expr_1): Guard
division int_const_binop against zero divisor.
2016-06-13 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/71498
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
int x = 1;
int main ()
{
int t = (1/(1>=x))>>1;
if (t != 0) __builtin_abort();
return 0;
}
/* { dg-final { scan-tree-dump "<bb 2>:\[\n\r \]*return 0;" "optimized" } } */
......@@ -2938,7 +2938,8 @@ extract_range_from_binary_expr_1 (value_range *vr,
and divisor are available. */
if (vr1.type == VR_RANGE
&& !symbolic_range_p (&vr0)
&& !symbolic_range_p (&vr1))
&& !symbolic_range_p (&vr1)
&& compare_values (vr1.max, zero) != 0)
min = int_const_binop (code, vr0.min, vr1.max);
else
min = zero;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment