diff options
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 3f10423..4486269 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3068,6 +3068,13 @@ get_access_for_expr (tree expr) || !DECL_P (base)) return NULL; + if (tree basesize = DECL_SIZE (base)) + { + poly_int64 sz = tree_to_poly_int64 (basesize); + if (offset < 0 || known_le (sz, offset)) + return NULL; + } + if (!bitmap_bit_p (candidate_bitmap, DECL_UID (base))) return NULL; |