Commit 0c4d4efb by Daniel Jacobowitz Committed by Daniel Jacobowitz

fold-const.c (fold_read_from_constant_string): Use build_int_cst_type.

	* fold-const.c (fold_read_from_constant_string): Use
	build_int_cst_type.
	* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.

From-SVN: r126952
parent 7e98624c
2007-07-26 Daniel Jacobowitz <dan@codesourcery.com>
* fold-const.c (fold_read_from_constant_string): Use
build_int_cst_type.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
2007-07-26 Nick Clifton <nickc@redhat.com> 2007-07-26 Nick Clifton <nickc@redhat.com>
* tree-ssa-operands.h: Change copyright header to refer to version * tree-ssa-operands.h: Change copyright header to refer to version
......
...@@ -14062,10 +14062,9 @@ fold_read_from_constant_string (tree exp) ...@@ -14062,10 +14062,9 @@ fold_read_from_constant_string (tree exp)
&& (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))) && (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (string))))
== MODE_INT) == MODE_INT)
&& (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))) == 1)) && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))) == 1))
return fold_convert (TREE_TYPE (exp), return build_int_cst_type (TREE_TYPE (exp),
build_int_cst (NULL_TREE, (TREE_STRING_POINTER (string)
(TREE_STRING_POINTER (string) [TREE_INT_CST_LOW (index)]));
[TREE_INT_CST_LOW (index)])));
} }
return NULL; return NULL;
} }
......
...@@ -1052,10 +1052,9 @@ fold_const_aggregate_ref (tree t) ...@@ -1052,10 +1052,9 @@ fold_const_aggregate_ref (tree t)
== MODE_INT) == MODE_INT)
&& GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1 && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1
&& compare_tree_int (idx, TREE_STRING_LENGTH (ctor)) < 0) && compare_tree_int (idx, TREE_STRING_LENGTH (ctor)) < 0)
return fold_convert (TREE_TYPE (t), return build_int_cst_type (TREE_TYPE (t),
build_int_cst (NULL, (TREE_STRING_POINTER (ctor)
(TREE_STRING_POINTER (ctor) [TREE_INT_CST_LOW (idx)]));
[TREE_INT_CST_LOW (idx)])));
return NULL_TREE; return NULL_TREE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment