Commit 1653a865 by Marek Polacek Committed by Marek Polacek

re PR middle-end/81737 (164.gzip in SPEC CPU 2000 failed to build)

	PR middle-end/81737
	* fold-const.c (fold_indirect_ref_1): Check type_domain.

	* gcc.dg/pr81737.c: New test.

From-SVN: r250912
parent 577eec56
2017-08-07 Marek Polacek <polacek@redhat.com>
PR middle-end/81737
* fold-const.c (fold_indirect_ref_1): Check type_domain.
2017-08-07 Martin Liska <mliska@suse.cz> 2017-08-07 Martin Liska <mliska@suse.cz>
* attribs.h (canonicalize_attr_name): New function. * attribs.h (canonicalize_attr_name): New function.
......
...@@ -14107,8 +14107,10 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0) ...@@ -14107,8 +14107,10 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
&& type == TREE_TYPE (op00type)) && type == TREE_TYPE (op00type))
{ {
tree type_domain = TYPE_DOMAIN (op00type); tree type_domain = TYPE_DOMAIN (op00type);
tree min = TYPE_MIN_VALUE (type_domain); tree min;
if (min && TREE_CODE (min) == INTEGER_CST) if (type_domain != NULL_TREE
&& (min = TYPE_MIN_VALUE (type_domain))
&& TREE_CODE (min) == INTEGER_CST)
{ {
offset_int off = wi::to_offset (op01); offset_int off = wi::to_offset (op01);
offset_int el_sz = wi::to_offset (TYPE_SIZE_UNIT (type)); offset_int el_sz = wi::to_offset (TYPE_SIZE_UNIT (type));
......
2017-08-07 Marek Polacek <polacek@redhat.com>
PR middle-end/81737
* gcc.dg/pr81737.c: New test.
2017-08-07 Martin Liska <mliska@suse.cz> 2017-08-07 Martin Liska <mliska@suse.cz>
* g++.dg/cpp0x/pr65558.C: Update scanned pattern. * g++.dg/cpp0x/pr65558.C: Update scanned pattern.
......
/* PR middle-end/81737 */
/* { dg-do compile } */
/* { dg-options "" } */
extern int a[];
void fn1() { (a + 0)[1]; }
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