diff options
author | David Edelsohn <edelsohn@gnu.org> | 2002-03-19 19:39:03 +0000 |
---|---|---|
committer | David Edelsohn <dje@gcc.gnu.org> | 2002-03-19 14:39:03 -0500 |
commit | 21ef78aa2e68118fc25d53e17e33388b6083ef12 (patch) | |
tree | c523219543d208885973dc6b623cfd240b175b14 /gcc/expr.c | |
parent | 91d4b3fd9a4b06ebd6ae324713f8c05bce15a43e (diff) | |
download | gcc-21ef78aa2e68118fc25d53e17e33388b6083ef12.zip gcc-21ef78aa2e68118fc25d53e17e33388b6083ef12.tar.gz gcc-21ef78aa2e68118fc25d53e17e33388b6083ef12.tar.bz2 |
expr.c (expand_expr): Sign-extend CONST_INT generated from TREE_STRING_POINTER.
* expr.c (expand_expr): Sign-extend CONST_INT generated from
TREE_STRING_POINTER.
From-SVN: r51033
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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); } } } |