re PR tree-optimization/41181 (internal compiler error when using x86_64-w64-mingw32...
authorRichard Guenther <rguenther@suse.de>
Sat, 5 Sep 2009 19:32:25 +0000 (19:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 5 Sep 2009 19:32:25 +0000 (19:32 +0000)
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.

From-SVN: r151455

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr41181.c [new file with mode: 0644]
gcc/tree-ssa-ccp.c

index 9f2b748..6edcba2 100644 (file)
@@ -1,5 +1,10 @@
 2009-09-05  Richard Guenther  <rguenther@suse.de>
 
+       PR middle-end/41181
+       * tree-ssa-ccp.c (maybe_fold_stmt_addition): Use the correct type.
+
+2009-09-05  Richard Guenther  <rguenther@suse.de>
+
        PR debug/41273
        * tree-ssa-operands.c (get_tmr_operands): Pass through opf_no_vops.
 
index 3373d07..7258ffa 100644 (file)
@@ -1,5 +1,10 @@
 2009-09-05  Richard Guenther  <rguenther@suse.de>
 
+       PR middle-end/41181
+       * gcc.c-torture/compile/pr41181.c: New testcase.
+
+2009-09-05  Richard Guenther  <rguenther@suse.de>
+
        PR debug/41273
        * g++.dg/torture/pr41273.C: New testcase.
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr41181.c b/gcc/testsuite/gcc.c-torture/compile/pr41181.c
new file mode 100644 (file)
index 0000000..d0af52d
--- /dev/null
@@ -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);
+}
index 949c4b5..14ffdfe 100644 (file)
@@ -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),