]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/37991 (excessive memory consumption - possible hang)
authorRichard Guenther <rguenther@suse.de>
Sun, 2 Nov 2008 13:34:58 +0000 (13:34 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 2 Nov 2008 13:34:58 +0000 (13:34 +0000)
2008-11-02  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/37991
* tree-ssa-sccvn.h (copy_vuses_from_stmt): Remove.
* tree-ssa-sccvn.c (copy_vuses_from_stmt): Make static.
(set_ssa_val_to): Print if the value changed.
(simplify_binary_expression): Strip useless conversions.

* gcc.c-torture/compile/pr37991.c: New testcase.

From-SVN: r141532

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr37991.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c
gcc/tree-ssa-sccvn.h

index 9e558d35b9c0657d8db972f9efc78ccb5ef898ca..90f6c9b214d6004946e9fbec260244c0c04f3d48 100644 (file)
@@ -1,3 +1,11 @@
+2008-11-02  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/37991
+       * tree-ssa-sccvn.h (copy_vuses_from_stmt): Remove.
+       * tree-ssa-sccvn.c (copy_vuses_from_stmt): Make static.
+       (set_ssa_val_to): Print if the value changed.
+       (simplify_binary_expression): Strip useless conversions.
+
 2008-11-01  Hans-Peter Nilsson  <hp@axis.com>
 
        PR target/37939
index d152f85a33a9dabaeb3dc5512e8b9a1878ae8056..90e0db5fb721393749cdbfbcee74d0e354035091 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-02  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/37991
+       * gcc.c-torture/compile/pr37991.c: New testcase.
+
 2008-11-01  Hans-Peter Nilsson  <hp@axis.com>
 
        PR target/37939
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37991.c b/gcc/testsuite/gcc.c-torture/compile/pr37991.c
new file mode 100644 (file)
index 0000000..f374ea9
--- /dev/null
@@ -0,0 +1,14 @@
+typedef int Int32;
+void use_it(int);
+void FindAndReadSignature(int processedSize)
+{
+  int numPrevBytes = 1;
+  for (;;)
+    {
+      int numBytesInBuffer = numPrevBytes + processedSize;
+      Int32 numTests = numBytesInBuffer - 1;
+      use_it (numTests);
+      numPrevBytes = numBytesInBuffer - numTests;
+    }
+}
+
index 082a2785ff7a5a30f69f05f716d8a3bc7825fff1..e255411fe6a8458efe7ee57302042bb4439a41a7 100644 (file)
@@ -498,7 +498,7 @@ vuses_to_vec (gimple stmt, VEC (tree, gc) **result)
 /* Copy the VUSE names in STMT into a vector, and return
    the vector.  */
 
-VEC (tree, gc) *
+static VEC (tree, gc) *
 copy_vuses_from_stmt (gimple stmt)
 {
   VEC (tree, gc) *vuses = NULL;
@@ -1579,7 +1579,6 @@ set_ssa_val_to (tree from, tree to)
       print_generic_expr (dump_file, from, 0);
       fprintf (dump_file, " to ");
       print_generic_expr (dump_file, to, 0);
-      fprintf (dump_file, "\n");
     }
 
   currval = SSA_VAL (from);
@@ -1587,8 +1586,12 @@ set_ssa_val_to (tree from, tree to)
   if (currval != to  && !operand_equal_p (currval, to, OEP_PURE_SAME))
     {
       SSA_VAL (from) = to;
+      if (dump_file && (dump_flags & TDF_DETAILS))
+       fprintf (dump_file, " (changed)\n");
       return true;
     }
+  if (dump_file && (dump_flags & TDF_DETAILS))
+    fprintf (dump_file, "\n");
   return false;
 }
 
@@ -2113,6 +2116,8 @@ simplify_binary_expression (gimple stmt)
 
   result = fold_binary (gimple_assign_rhs_code (stmt),
                        TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
+  if (result)
+    STRIP_USELESS_TYPE_CONVERSION (result);
 
   fold_undefer_overflow_warnings (result && valid_gimple_rhs_p (result),
                                  stmt, 0);
index 84f096ef2245318b56ffef493918c92d6909bfaa..cc74acce10da37aa2577c2f7d00bc9f7cf192fd7 100644 (file)
@@ -196,5 +196,4 @@ unsigned int get_constant_value_id (tree);
 unsigned int get_or_alloc_constant_value_id (tree);
 bool value_id_constant_p (unsigned int);
 VEC (tree, gc) *shared_vuses_from_stmt (gimple);
-VEC (tree, gc) *copy_vuses_from_stmt (gimple);
 #endif /* TREE_SSA_SCCVN_H  */
This page took 0.118594 seconds and 5 git commands to generate.