re PR fortran/88229 (ICE tree check: expected integer_cst, have nop_expr in get_len...
authorRichard Biener <rguenther@suse.de>
Wed, 28 Nov 2018 10:59:12 +0000 (10:59 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 28 Nov 2018 10:59:12 +0000 (10:59 +0000)
2018-11-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88229
* tree-ssa.c (non_rewritable_mem_ref_base): Check DECL_SIZE_UNIT
is an INTEGER_CST before accessing it so.

From-SVN: r266550

gcc/ChangeLog
gcc/tree-ssa.c

index 2e08f6dd2f4f13bdf7e0a75a89ff0d75a21c9423..93b35e87c5c526f1fd9c44b299fee8df70fa20a5 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88229
+       * tree-ssa.c (non_rewritable_mem_ref_base): Check DECL_SIZE_UNIT
+       is an INTEGER_CST before accessing it so.
+
 2018-11-28  Sam Tebbs  <sam.tebbs@arm.com>
 
        * doc/invoke.texi (-mtune=): Remove obsolete CPU names.
index bd8b91f8b4b1d6f43edde19e5f40d61c7c51a6c7..e3eb4b05130b8dc5748d25295dce09a3579b0336 100644 (file)
@@ -1446,6 +1446,7 @@ non_rewritable_mem_ref_base (tree ref)
        return NULL_TREE;
       /* For integral typed extracts we can use a BIT_FIELD_REF.  */
       if (DECL_SIZE (decl)
+         && TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST
          && (known_subrange_p
              (mem_ref_offset (base),
               wi::to_poly_offset (TYPE_SIZE_UNIT (TREE_TYPE (base))),