aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1996-06-07 12:11:44 -0700
committerPer Bothner <bothner@gcc.gnu.org>1996-06-07 12:11:44 -0700
commit8f6562d026def4d1010e5beb0d4b5afaf0703a9c (patch)
tree8c1e02659f2c61d5fbbb3f15767a3b1643324dfa
parent03cad97d1eeb7acb2d5be6d8e3cba7b27ae7bef4 (diff)
downloadgcc-8f6562d026def4d1010e5beb0d4b5afaf0703a9c.zip
gcc-8f6562d026def4d1010e5beb0d4b5afaf0703a9c.tar.gz
gcc-8f6562d026def4d1010e5beb0d4b5afaf0703a9c.tar.bz2
* expr.c (safe_from_p): Allow Chill-style variable-sized arrays.
From-SVN: r12213
-rw-r--r--gcc/expr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index c39c190..9bda758 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4466,12 +4466,17 @@ safe_from_p (x, exp)
if (x == 0
/* If EXP has varying size, we MUST use a target since we currently
- have no way of allocating temporaries of variable size. So we
- assume here that something at a higher level has prevented a
+ have no way of allocating temporaries of variable size
+ (except for arrays that have TYPE_ARRAY_MAX_SIZE set).
+ So we assume here that something at a higher level has prevented a
clash. This is somewhat bogus, but the best we can do. Only
do this when X is BLKmode. */
|| (TREE_TYPE (exp) != 0 && TYPE_SIZE (TREE_TYPE (exp)) != 0
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) != INTEGER_CST
+ && (TREE_CODE (TREE_TYPE (exp)) != ARRAY_TYPE
+ || TYPE_ARRAY_MAX_SIZE (TREE_TYPE (exp)) == NULL_TREE
+ || TREE_CODE (TYPE_ARRAY_MAX_SIZE (TREE_TYPE (exp)))
+ != INTEGER_CST)
&& GET_MODE (x) == BLKmode))
return 1;