aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2007-07-24 19:44:17 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2007-07-24 19:44:17 +0000
commit015afd28353dd215a72b63c25ae117d3c2b7f8de (patch)
tree93863437ae6f2854cef23bca37840068378997ed /gcc/tree-ssa-ccp.c
parentddabfffb25652513572ed1842963488c88595aa8 (diff)
* tree-ssa-ccp.c (fold_const_aggregate_ref): Use fold_convert.
* gcc.c-torture/execute/20070724-1.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@126888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c6
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;
}