]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 9f2b7488a751015ba58d14fdcb1f88a804865a15..6edcba28b1c657db5ef12a2a1adc7b619625c7ac 100644 (file)
@@ -1,3 +1,8 @@
+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
index 3373d071499f421096c2efc45c298dc9d9a993d2..7258ffaac56ff6282ca6b5e52d89ee84e801029f 100644 (file)
@@ -1,3 +1,8 @@
+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
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 949c4b5ce7766ec9fd4c4a27275bbe0b428424cb..14ffdfeb62b014739987f4ef203f03a2f49b6987 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),