Commit acc25807 by Richard Biener Committed by Richard Biener

re PR tree-optimization/86988 (ICE: tree check: expected integer_cst, have…

re PR tree-optimization/86988 (ICE: tree check: expected integer_cst, have var_decl in get_len, at tree.h:5563)

2018-08-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86988
	* tree-vrp.c (vrp_prop::check_mem_ref): Bail out on VLAs.

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

From-SVN: r263762
parent 66c4f4d8
2018-08-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/86988
* tree-vrp.c (vrp_prop::check_mem_ref): Bail out on VLAs.
2018-08-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/86945
* tree-cfg.c (generate_range_test): Use unsigned arithmetic.
......
2018-08-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/86988
* g++.dg/pr86988.C: New testcase.
2018-08-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/86945
* tree-cfg.c (generate_range_test): Use unsigned arithmetic.
......
// { dg-do compile }
// { dg-options "-O2 -Warray-bounds" }
struct R { int r; };
void baz (char *, char *, char *, char *);
void
foo ()
{
const R a = { 12 };
char b[1][a.r] = { { "12345678901" } };
char c[a.r] = { "12345678901" };
char d[1][a.r] = { { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '\0' } };
char e[a.r] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '\0' };
baz (b[0], c, d[0], e);
}
......@@ -4581,6 +4581,7 @@ vrp_prop::check_mem_ref (location_t location, tree ref,
tree reftype = TREE_TYPE (arg);
if (POINTER_TYPE_P (reftype)
|| !COMPLETE_TYPE_P (reftype)
|| TREE_CODE (TYPE_SIZE_UNIT (reftype)) != INTEGER_CST
|| RECORD_OR_UNION_TYPE_P (reftype))
return;
......
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