tree-ssa-ccp.c (fold_const_aggregate_ref): Use fold_convert.

* tree-ssa-ccp.c (fold_const_aggregate_ref): Use fold_convert.

	* gcc.c-torture/execute/20070724-1.c: New.

From-SVN: r126888
This commit is contained in:
Daniel Jacobowitz 2007-07-24 19:44:17 +00:00 committed by Daniel Jacobowitz
parent 30f9cd05c6
commit 7d0a07d0c6
4 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2007-07-24 Daniel Jacobowitz <dan@codesourcery.com>
* tree-ssa-ccp.c (fold_const_aggregate_ref): Use fold_convert.
2007-07-24 Jan Hubicka <jh@suse.cz>
* caller-save.c: Include ggc.h, gt-caller-save.h

View File

@ -1,3 +1,7 @@
2007-07-24 Daniel Jacobowitz <dan@codesourcery.com>
* gcc.c-torture/execute/20070724-1.c: New.
2007-07-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31205

View File

@ -0,0 +1,11 @@
void abort (void);
static unsigned char magic[] = "\235";
static unsigned char value = '\235';
int main()
{
if (value != magic[0])
abort ();
return 0;
}

View File

@ -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;
}