diff options
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 93345a99ccc..8f2868301d5 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1053,8 +1053,10 @@ fold_const_aggregate_ref (tree t) == MODE_INT) && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1 && compare_tree_int (idx, TREE_STRING_LENGTH (ctor)) < 0) - return build_int_cst (TREE_TYPE (t), (TREE_STRING_POINTER (ctor) - [TREE_INT_CST_LOW (idx)])); + return fold_convert (TREE_TYPE (t), + build_int_cst (NULL, + (TREE_STRING_POINTER (ctor) + [TREE_INT_CST_LOW (idx)]))); return NULL_TREE; } |