diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-05 19:32:25 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-05 19:32:25 +0000 |
commit | aab01f6632b7a68b9a1d5e769582fb879568a12e (patch) | |
tree | 06dfa885f9390ffac7111b08d8e1b00586f69dfb /gcc/tree-ssa-ccp.c | |
parent | afcada6efe0e14683e087749cc108f06f4a1b7c1 (diff) | |
download | gcc-aab01f6632b7a68b9a1d5e769582fb879568a12e.tar.gz |
2009-09-05 Richard Guenther <rguenther@suse.de>
PR middle-end/41181
* tree-ssa-ccp.c (maybe_fold_stmt_addition): Use the correct type.
* gcc.c-torture/compile/pr41181.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151455 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 949c4b5ce77..14ffdfeb62b 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2214,16 +2214,16 @@ maybe_fold_stmt_addition (location_t loc, tree res_type, tree op0, tree op1) && TREE_CODE (gimple_assign_rhs2 (offset_def)) == INTEGER_CST && tree_int_cst_equal (gimple_assign_rhs2 (offset_def), TYPE_SIZE_UNIT (TREE_TYPE (op0)))) - return build1 (ADDR_EXPR, res_type, - build4 (ARRAY_REF, TREE_TYPE (op0), + return build_fold_addr_expr + (build4 (ARRAY_REF, TREE_TYPE (op0), TREE_OPERAND (op0, 0), gimple_assign_rhs1 (offset_def), TREE_OPERAND (op0, 2), TREE_OPERAND (op0, 3))); else if (integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (op0))) && gimple_assign_rhs_code (offset_def) != MULT_EXPR) - return build1 (ADDR_EXPR, res_type, - build4 (ARRAY_REF, TREE_TYPE (op0), + return build_fold_addr_expr + (build4 (ARRAY_REF, TREE_TYPE (op0), TREE_OPERAND (op0, 0), op1, TREE_OPERAND (op0, 2), |