From 6a12956780befeb93b3b126e62704c2f78f19a8a Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sat, 5 Sep 2009 19:32:25 +0000 Subject: [PATCH] re PR tree-optimization/41181 (internal compiler error when using x86_64-w64-mingw32-gcc to build ffmpeg ac3enc.c) 2009-09-05 Richard Guenther PR middle-end/41181 * tree-ssa-ccp.c (maybe_fold_stmt_addition): Use the correct type. * gcc.c-torture/compile/pr41181.c: New testcase. From-SVN: r151455 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr41181.c | 10 ++++++++++ gcc/tree-ssa-ccp.c | 8 ++++---- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr41181.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f2b7488a751..6edcba28b1c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-09-05 Richard Guenther + + PR middle-end/41181 + * tree-ssa-ccp.c (maybe_fold_stmt_addition): Use the correct type. + 2009-09-05 Richard Guenther PR debug/41273 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3373d071499f..7258ffaac56f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-09-05 Richard Guenther + + PR middle-end/41181 + * gcc.c-torture/compile/pr41181.c: New testcase. + 2009-09-05 Richard Guenther PR debug/41273 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41181.c b/gcc/testsuite/gcc.c-torture/compile/pr41181.c new file mode 100644 index 000000000000..d0af52d912bf --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr41181.c @@ -0,0 +1,10 @@ +char paths[1024]; +static void x264_slicetype_path(char (*best_paths)[250], int n, int length) +{ + __builtin_memcpy (best_paths[n], paths, length); +} +void x264_slicetype_analyse(int n, int length) +{ + char best_paths[250][250]; + x264_slicetype_path (best_paths, n, length); +} diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 949c4b5ce776..14ffdfeb62b0 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), -- 2.47.2