From 56517dda83af315590448610b4b6cd9d4f4d7527 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Fri, 30 Oct 2015 13:27:10 +0000 Subject: [PATCH] [Trivial] tree-sra.c: A few comment fixes/additions. * tree-sra.c (scalarizable_type_p): Comment variable-length arrays. (completely_scalarize): Comment zero-length arrays. (get_access_replacement): Correct comment re. precondition. From-SVN: r229577 --- gcc/ChangeLog | 6 ++++++ gcc/tree-sra.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e6b8b27bc6f..7178c5aeec3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-30 Alan Lawrence + + * tree-sra.c (scalarizable_type_p): Comment variable-length arrays. + (completely_scalarize): Comment zero-length arrays. + (get_access_replacement): Correct comment re. precondition. + 2015-10-30 Venkataramanan Kumar * config/i386/i386.c (get_builtin_code_for_version): Set priority diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index b6172cd220c..82c58f0ae3a 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -956,6 +956,7 @@ scalarizable_type_p (tree type) ; else if ((tree_to_shwi (TYPE_SIZE (type)) <= 0) || !tree_fits_shwi_p (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))) + /* Variable-length array, do not allow scalarization. */ return false; tree elem = TREE_TYPE (type); @@ -1005,6 +1006,7 @@ completely_scalarize (tree base, tree decl_type, HOST_WIDE_INT offset, tree ref) tree minidx = TYPE_MIN_VALUE (TYPE_DOMAIN (decl_type)); gcc_assert (TREE_CODE (minidx) == INTEGER_CST); tree maxidx = TYPE_MAX_VALUE (TYPE_DOMAIN (decl_type)); + /* Skip (some) zero-length arrays; others have MAXIDX == MINIDX - 1. */ if (maxidx) { gcc_assert (TREE_CODE (maxidx) == INTEGER_CST); @@ -2146,7 +2148,7 @@ create_access_replacement (struct access *access) return repl; } -/* Return ACCESS scalar replacement, create it if it does not exist yet. */ +/* Return ACCESS scalar replacement, which must exist. */ static inline tree get_access_replacement (struct access *access) -- 2.30.2