This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 3 pending patches from last year


Eric Botcazou wrote:
Cope with exception_receiver on Alpha/Tru64 5.x:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01448.html

What about a patch like this (untested), to make commit_edge_insertions fast if it will do no work? This way, we can call it unconditionally in except.c and possibly a few other places.


Index: cfgrtl.c
===================================================================
--- cfgrtl.c    (revision 121944)
+++ cfgrtl.c    (working copy)
@@ -1329,6 +1329,7 @@ insert_insn_on_edge (rtx pattern, edge e

   e->insns.r = get_insns ();
   end_sequence ();
+  pending_edge_inserts = true;
 }

 /* Update the CFG for the instructions queued on edge E.  */
@@ -1468,6 +1469,9 @@ commit_edge_insertions (void)
   sbitmap blocks;
   bool changed = false;

+  if (!pending_edge_inserts)
+    return;
+
 #ifdef ENABLE_CHECKING
   verify_flow_info ();
 #endif
@@ -1485,8 +1489,8 @@ commit_edge_insertions (void)
          }
     }

-  if (!changed)
-    return;
+  gcc_assert (changed);
+  pending_edge_inserts = false;

   /* In the old rtl CFG API, it was OK to insert control flow on an
      edge, apparently?  In cfglayout mode, this will *not* work, and
Index: basic-block.h
===================================================================
--- basic-block.h       (revision 121944)
+++ basic-block.h       (working copy)
@@ -378,6 +378,9 @@ struct control_flow_graph GTY(())
   /* The first free basic block number.  */
   int x_last_basic_block;

+  /* Whether edge insertions are waiting to be committed.  */
+  bool x_pending_edge_inserts;
+
   /* Mapping of labels to their associated blocks.  At present
      only used for the tree CFG.  */
   VEC(basic_block,gc) *x_label_to_block_map;
@@ -410,6 +413,7 @@ struct control_flow_graph GTY(())
 #define last_basic_block       (cfun->cfg->x_last_basic_block)
 #define label_to_block_map     (cfun->cfg->x_label_to_block_map)
 #define profile_status         (cfun->cfg->x_profile_status)
+#define pending_edge_inserts    (cfun->cfg->x_pending_edge_inserts)

#define BASIC_BLOCK(N) (VEC_index (basic_block, basic_block_info, (N)))
#define SET_BASIC_BLOCK(N,BB) (VEC_replace (basic_block, basic_block_info, (N), (BB)))



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]