tree-optimization/97812 - fix range query in VRP assert discovery
authorRichard Biener <rguenther@suse.de>
Fri, 13 Nov 2020 10:31:22 +0000 (11:31 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 13 Nov 2020 11:24:54 +0000 (12:24 +0100)
commitdcfd302a79a5e2ea3bb16fc4fc45a5ee31cc0eab
treebe85f1a2cea59235fefe077bbd5125b1664fa19f
parent3793ecc10fd4f8be8abd65ba41824f3cc91238e7
tree-optimization/97812 - fix range query in VRP assert discovery

This makes sure to properly extend the input range before seeing
whether it fits the target.

2020-11-13  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97812
* tree-vrp.c (register_edge_assert_for_2): Extend the range
according to its sign before seeing whether it fits.

* gcc.dg/torture/pr97812.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr97812.c [new file with mode: 0644]
gcc/tree-vrp.c