PR middle-end/81737
* fold-const.c (fold_indirect_ref_1): Check type_domain.
* gcc.dg/pr81737.c: New test.
From-SVN: r250912
+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>
* attribs.h (canonicalize_attr_name): New function.
&& type == TREE_TYPE (op00type))
{
tree type_domain = TYPE_DOMAIN (op00type);
- tree min = TYPE_MIN_VALUE (type_domain);
- if (min && TREE_CODE (min) == INTEGER_CST)
+ tree min;
+ 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 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>
* g++.dg/cpp0x/pr65558.C: Update scanned pattern.
--- /dev/null
+/* PR middle-end/81737 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern int a[];
+void fn1() { (a + 0)[1]; }