diff options
author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-19 19:39:03 +0000 |
---|---|---|
committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-19 19:39:03 +0000 |
commit | 506664d9b6af3102693df8e81aee0d4bf8a1b1d6 (patch) | |
tree | c523219543d208885973dc6b623cfd240b175b14 /gcc/expr.c | |
parent | 1508f037000fa87a7da01253805d497b413602f7 (diff) | |
download | gcc-506664d9b6af3102693df8e81aee0d4bf8a1b1d6.tar.gz |
* expr.c (expand_expr): Sign-extend CONST_INT generated from
TREE_STRING_POINTER.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51033 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index f8a045a49fd..fd62a39b9c9 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6631,8 +6631,8 @@ expand_expr (exp, target, tmode, modifier) && GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1 && modifier != EXPAND_WRITE) - return - GEN_INT (TREE_STRING_POINTER (string)[TREE_INT_CST_LOW (index)]); + return gen_int_mode (TREE_STRING_POINTER (string) + [TREE_INT_CST_LOW (index)], mode); op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM); op0 = memory_address (mode, op0); @@ -6681,8 +6681,8 @@ expand_expr (exp, target, tmode, modifier) && compare_tree_int (index, TREE_STRING_LENGTH (array)) < 0 && GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1) - return - GEN_INT (TREE_STRING_POINTER (array)[TREE_INT_CST_LOW (index)]); + return gen_int_mode (TREE_STRING_POINTER (array) + [TREE_INT_CST_LOW (index)], mode); /* If this is a constant index into a constant array, just get the value from the array. Handle both the cases when @@ -6742,9 +6742,8 @@ expand_expr (exp, target, tmode, modifier) if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1) - return (GEN_INT - (TREE_STRING_POINTER - (init)[TREE_INT_CST_LOW (index)])); + return gen_int_mode (TREE_STRING_POINTER (init) + [TREE_INT_CST_LOW (index)], mode); } } } |