]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/22550 (ICE in vrp_evaluate_conditional)
authorDiego Novillo <dnovillo@redhat.com>
Fri, 29 Jul 2005 16:32:00 +0000 (16:32 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Fri, 29 Jul 2005 16:32:00 +0000 (12:32 -0400)
PR 22550
* tree-cfgcleanup.c (cleanup_tree_cfg_1): Extract from ...
(cleanup_tree_cfg): ... here.
Call cleanup_tree_cfg_1 until there are no more cleanups to
do.

testsuite/ChangeLog

PR 22550
* g++.dg/tree-ssa/pr22550.C: New test.

From-SVN: r102559

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr22550.C [new file with mode: 0644]
gcc/tree-cfgcleanup.c

index 6ddd4325c68ccb19027303a5a95798cd106b54da..0acf31f32cf4a6af3ad2c90af7a63eaf1a9b30eb 100644 (file)
@@ -1,3 +1,11 @@
+2005-07-29  Diego Novillo  <dnovillo@redhat.com>
+
+       PR 22550
+       * tree-cfgcleanup.c (cleanup_tree_cfg_1): Extract from ...
+       (cleanup_tree_cfg): ... here.
+       Call cleanup_tree_cfg_1 until there are no more cleanups to
+       do.
+
 2005-07-29  James A. Morrison  <phython@gcc.gnu.org>
 
        * tree-vrp.c (compare_range_with_value): Return true or false
index cf45c8aef58b6bcbd25e191efc2d9fc011a67ee3..aa60bc1a194001904a109f1b61f3077815fa52bf 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-29  Diego Novillo  <dnovillo@redhat.com>
+
+       PR 22550
+       * g++.dg/tree-ssa/pr22550.C: New test.
+
 2005-07-29  James A. Morrison  <phython@gcc.gnu.org>
 
        * gcc.dg/tree-ssa/vrp19.c: New test.
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr22550.C b/gcc/testsuite/g++.dg/tree-ssa/pr22550.C
new file mode 100644 (file)
index 0000000..5f55776
--- /dev/null
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+class X {
+public:
+  int mfunc1 () {
+    return 1;
+  }
+  int mfunc2 () {
+    return 2;
+  }
+  X (int a, int b) { }
+};
+
+typedef int (X::*memfunc_p_t) ();
+
+memfunc_p_t mf_arr[2] = { &X::mfunc1, &X::mfunc2 };
+
+int
+main ()
+{
+  // Get pntr to the array of pointers to member-funcs
+  memfunc_p_t (*mf_arr_p)[2] = &mf_arr;
+  // Compare indirect against direct access to an array element
+  if ((*mf_arr_p)[0] != mf_arr[0])
+    return 1;
+  return 0;
+}
index 51b2fc59465f246526d1fb1e69f9e4da79f8fb41..f2454b0111917e7dcdb212a49d1b217a508e5c78 100644 (file)
@@ -489,14 +489,12 @@ cleanup_forwarder_blocks (void)
   return changed;
 }
 
-/* Remove unreachable blocks and other miscellaneous clean up work.  */
+/* Do one round of CFG cleanup.  */
 
-bool
-cleanup_tree_cfg (void)
+static bool
+cleanup_tree_cfg_1 (void)
 {
-  bool retval = false;
-
-  timevar_push (TV_TREE_CLEANUP_CFG);
+  bool retval;
 
   retval = cleanup_control_flow ();
   retval |= delete_unreachable_blocks ();
@@ -516,6 +514,28 @@ cleanup_tree_cfg (void)
       end_recording_case_labels ();
     }
 
+  /* Merging the blocks may create new opportunities for folding
+     conditional branches (due to the elimination of single-valued PHI
+     nodes).  */
+  retval |= merge_seq_blocks ();
+
+  return retval;
+}
+
+
+/* Remove unreachable blocks and other miscellaneous clean up work.  */
+
+bool
+cleanup_tree_cfg (void)
+{
+  bool retval;
+  int i;
+
+  timevar_push (TV_TREE_CLEANUP_CFG);
+
+  for (retval = true, i = 0; i < 5 && retval; i++)
+    retval = cleanup_tree_cfg_1 ();
+
 #ifdef ENABLE_CHECKING
   if (retval)
     {
@@ -526,16 +546,14 @@ cleanup_tree_cfg (void)
     }
 #endif
 
-  /* Merging the blocks creates no new opportunities for the other
-     optimizations, so do it here.  */
-  retval |= merge_seq_blocks ();
-
   compact_blocks ();
 
 #ifdef ENABLE_CHECKING
   verify_flow_info ();
 #endif
+
   timevar_pop (TV_TREE_CLEANUP_CFG);
+
   return retval;
 }
 
This page took 0.112836 seconds and 5 git commands to generate.