diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-09 03:21:56 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-09 03:21:56 +0000 |
commit | 68b956aec6b292f374113dec0c1ee1fcf5ef54f4 (patch) | |
tree | 09f0b6ed28e40cc9846facf74e75892be87ef0f1 /gcc/expr.c | |
parent | e8e65fad8274ae621b1348b71c01a77b64d799fc (diff) | |
download | gcc-68b956aec6b292f374113dec0c1ee1fcf5ef54f4.tar.gz |
* expr.h (EXPAND_MEMORY): New.
* expr.c (expand_expr): Check it.
* stmt.c (expand_asm_operands): Provide it when the constraint
requires a memory. Warn for memory input constraints without
a memory operand.
* gcc.dg/20011029-2.c: Fix the array reference.
* gcc.dg/asm-7.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 7adaca00565..4bcd978d58f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7326,7 +7326,9 @@ expand_expr (exp, target, tmode, modifier) Don't fold if this is for wide characters since it's too difficult to do correctly and this is a very rare case. */ - if (modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER + if (modifier != EXPAND_CONST_ADDRESS + && modifier != EXPAND_INITIALIZER + && modifier != EXPAND_MEMORY && TREE_CODE (array) == STRING_CST && TREE_CODE (index) == INTEGER_CST && compare_tree_int (index, TREE_STRING_LENGTH (array)) < 0 @@ -7340,8 +7342,11 @@ expand_expr (exp, target, tmode, modifier) we have an explicit constructor and when our operand is a variable that was declared const. */ - if (modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER - && TREE_CODE (array) == CONSTRUCTOR && ! TREE_SIDE_EFFECTS (array) + if (modifier != EXPAND_CONST_ADDRESS + && modifier != EXPAND_INITIALIZER + && modifier != EXPAND_MEMORY + && TREE_CODE (array) == CONSTRUCTOR + && ! TREE_SIDE_EFFECTS (array) && TREE_CODE (index) == INTEGER_CST && 0 > compare_tree_int (index, list_length (CONSTRUCTOR_ELTS @@ -7362,6 +7367,7 @@ expand_expr (exp, target, tmode, modifier) else if (optimize >= 1 && modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER + && modifier != EXPAND_MEMORY && TREE_READONLY (array) && ! TREE_SIDE_EFFECTS (array) && TREE_CODE (array) == VAR_DECL && DECL_INITIAL (array) && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK) |