Commit be742eb4 by Richard Biener Committed by Richard Biener

re PR tree-optimization/84933 (ICE in set_value_range, at tree-vrp.c:288 since r257852)

2018-03-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84933
	* tree-vrp.c (set_and_canonicalize_value_range): Treat out-of-bound
	values as -INF/INF when canonicalizing an ANTI_RANGE to a RANGE.

	* g++.dg/pr84933.C: New testcase.

From-SVN: r258646
parent 68d93a19
2018-03-19 Richard Biener <rguenther@suse.de> 2018-03-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/84933
* tree-vrp.c (set_and_canonicalize_value_range): Treat out-of-bound
values as -INF/INF when canonicalizing an ANTI_RANGE to a RANGE.
2018-03-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/84859 PR tree-optimization/84859
* tree-ssa-phiopt.c (single_trailing_store_in_bb): New function. * tree-ssa-phiopt.c (single_trailing_store_in_bb): New function.
(cond_if_else_store_replacement): Perform sinking operation on (cond_if_else_store_replacement): Perform sinking operation on
......
2018-03-19 Richard Biener <rguenther@suse.de> 2018-03-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/84933
* g++.dg/pr84933.C: New testcase.
2018-03-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/84859 PR tree-optimization/84859
* gcc.dg/tree-ssa/pr84859.c: New testcase. * gcc.dg/tree-ssa/pr84859.c: New testcase.
* gcc.dg/tree-ssa/pr35286.c: Disable cselim. * gcc.dg/tree-ssa/pr35286.c: Disable cselim.
......
/* { dg-do compile } */
/* { dg-options "-O3 -fstrict-enums -fno-inline" } */
enum a {};
int *d;
int b, e, f;
a c, g;
class h {
virtual unsigned i();
};
class j : h {
unsigned i() {
for (;;) {
b = c <= 0;
if (b)
e = *d;
b = g && c;
if (b)
f = *d;
}
}
};
void k() { new j; }
...@@ -386,8 +386,13 @@ set_and_canonicalize_value_range (value_range *vr, enum value_range_type t, ...@@ -386,8 +386,13 @@ set_and_canonicalize_value_range (value_range *vr, enum value_range_type t,
/* Anti-ranges that can be represented as ranges should be so. */ /* Anti-ranges that can be represented as ranges should be so. */
if (t == VR_ANTI_RANGE) if (t == VR_ANTI_RANGE)
{ {
bool is_min = vrp_val_is_min (min); /* For -fstrict-enums we may receive out-of-range ranges so consider
bool is_max = vrp_val_is_max (max); values < -INF and values > INF as -INF/INF as well. */
tree type = TREE_TYPE (min);
bool is_min = (INTEGRAL_TYPE_P (type)
&& tree_int_cst_compare (min, TYPE_MIN_VALUE (type)) <= 0);
bool is_max = (INTEGRAL_TYPE_P (type)
&& tree_int_cst_compare (max, TYPE_MAX_VALUE (type)) >= 0);
if (is_min && is_max) if (is_min && is_max)
{ {
......
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