Makefile.in (reload1.o): Add dedendancy on except.h
authorJan Hubicka <jh@suse.cz>
Mon, 6 Aug 2001 06:39:21 +0000 (23:39 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 6 Aug 2001 06:39:21 +0000 (23:39 -0700)
        * Makefile.in (reload1.o): Add dedendancy on except.h
        * basic-block.h (purge_all_dead_edges, purge_dead_edges): Update
        prototypes.
        * flow.c (purge_dead_edges, purge_all_dead_edges): Return bool
        indicating wehther edges has been cleaned up.
        * reload1.c: Inlucde except.h
        (fixup_abnormal_edges): Accept deleted insns.
        * toplev.c (rest_of_compilation): Purge dead edges unconditionally
        after combine.

From-SVN: r44654

gcc/ChangeLog
gcc/Makefile.in
gcc/basic-block.h
gcc/flow.c
gcc/reload1.c
gcc/toplev.c

index d8ff3e3ac89f6c455caa63315e437aa5fa075bca..293b81df9509f5f8db30d3093b179761ad46ebea 100644 (file)
@@ -1,3 +1,15 @@
+2001-08-05  Jan Hubicka  <jh@suse.cz>
+
+       * Makefile.in (reload1.o): Add dedendancy on except.h
+       * basic-block.h (purge_all_dead_edges, purge_dead_edges): Update
+       prototypes.
+       * flow.c (purge_dead_edges, purge_all_dead_edges): Return bool
+       indicating wehther edges has been cleaned up.
+       * reload1.c: Inlucde except.h
+       (fixup_abnormal_edges): Accept deleted insns.
+       * toplev.c (rest_of_compilation): Purge dead edges unconditionally
+       after combine.
+
 2001-08-06  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * cpplib.c (do_line): Correct line number after pop_buffer.
@@ -333,7 +345,7 @@ Sat Aug  4 13:51:36 CEST 2001  Jan Hubicka  <jh@suse.cz>
        (__gthread_mutex_init_function): New function for mutex initialization.
 
 2001-08-03  Daniel Berlin  <dan@cgsoftware.com>
-        
+       
        * Makefile.in: Revert screwed up commit.
 
 2001-08-03  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
@@ -353,7 +365,7 @@ Sat Aug  4 13:51:36 CEST 2001  Jan Hubicka  <jh@suse.cz>
        (DTORS_SECTION_FUNCTION): Likewise for __do_global_dtors.
 
 2001-08-03  Daniel Berlin  <dan@cgsoftware.com>
-        
+       
        * ChangeLog: Fix date on previous ChangeLog entry for GCSE.
        
        * Makefile.in: Add df.h to gcse.c dependencies.
@@ -366,26 +378,26 @@ Sat Aug  4 13:51:36 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 2001-08-03  Daniel Berlin  <dan@cgsoftware.com>
 
-        * gcse.c: Include df.h for use as a dataflow analyzer.
-        Remove regvec.
-        Declaration of reg_set_info: gone.
-        New df_analyzer variable used by store motion.
-        (reg_set_info): Deleted.
-        (mark_mem_regs): New function, analyze regs used by a mem.
-        (store_ops_ok): Use dataflow analyzer results to determine if
-        necessary regs are changed in the block.
-        (find_moveable_store): Remove check for symbol ref, we can handle
-        much more complex expressions now.
-        (compute_store_table): Remove most of the code, it's unnecessary
-        now that the dataflow analyzer records the info for us.
-        (store_killed_after): Add parameter to say whether to do the
-        store_ops_okay test, used to speed up testing when we already know
-        the answer, and just want to know if the store itself was killed.
-        (build_store_vector): Largely rewritten to calculate the various
-        vectors properly, and somewhat optimized.
-        (store_motion): Init the df_analyzer, get REG_DEF chains. 
-        Also handle trapping expressions (since mems almost always trap)
-        (simple_mem): Redefine what a simple mem is.
+       * gcse.c: Include df.h for use as a dataflow analyzer.
+       Remove regvec.
+       Declaration of reg_set_info: gone.
+       New df_analyzer variable used by store motion.
+       (reg_set_info): Deleted.
+       (mark_mem_regs): New function, analyze regs used by a mem.
+       (store_ops_ok): Use dataflow analyzer results to determine if
+       necessary regs are changed in the block.
+       (find_moveable_store): Remove check for symbol ref, we can handle
+       much more complex expressions now.
+       (compute_store_table): Remove most of the code, it's unnecessary
+       now that the dataflow analyzer records the info for us.
+       (store_killed_after): Add parameter to say whether to do the
+       store_ops_okay test, used to speed up testing when we already know
+       the answer, and just want to know if the store itself was killed.
+       (build_store_vector): Largely rewritten to calculate the various
+       vectors properly, and somewhat optimized.
+       (store_motion): Init the df_analyzer, get REG_DEF chains. 
+       Also handle trapping expressions (since mems almost always trap)
+       (simple_mem): Redefine what a simple mem is.
 
 2001-08-03  DJ Delorie  <dj@redhat.com>
 
@@ -454,7 +466,7 @@ Sat Aug  4 13:51:36 CEST 2001  Jan Hubicka  <jh@suse.cz>
        cp/decl2.c, doc/contrib.texi, doc/cpp.texi, doc/gcc.texi,
        doc/install.texi, doc/invoke.texi, doc/md.texi, doc/rtl.texi,
        doc/tm.texi: consistently use "VAX", "VAXen", and "MicroVAX"
-        in comments and documentation.
+       in comments and documentation.
 
 2001-08-03  Neil Booth  <neil@cat.daikokuya.demon.co.uk>
 
@@ -566,7 +578,7 @@ Sat Aug  4 13:51:36 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 2001-08-01  Robert Lipe  <robertl@caldera.com>
 
-        * dwarfout.c: Remove reference to README.DWARF.
+       * dwarfout.c: Remove reference to README.DWARF.
 
 2001-08-01  Andrew MacLeod  <amacleod@redhat.com>
 
@@ -669,7 +681,7 @@ Wed Aug  1 20:02:12 CEST 2001 Graham Stott  <grahams@redhat.com>
 
 2001-08-01  Ziemowit Laski  <zlaski@apple.com>
 
-        * c-parse.in (OBJC_NEED_RAW_IDENTIFIER): Define macro and flag for
+       * c-parse.in (OBJC_NEED_RAW_IDENTIFIER): Define macro and flag for
        contextualizing Objective-C class name lookup by the lexer.
        (typespec_reserved_nonattr): Disable ObjC class name lookup after
        seeing a TYPESPEC.
@@ -731,7 +743,7 @@ Wed Aug  1 20:02:12 CEST 2001 Graham Stott  <grahams@redhat.com>
 
 2001-07-31  Jeff Sturm  <jsturm@one-point.com>
 
-        * except.c (duplicate_eh_regions): Test n_array[i] for NULL.
+       * except.c (duplicate_eh_regions): Test n_array[i] for NULL.
 
 2001-07-31  matthew green  <mrg@eterna.com.au>
 
@@ -814,10 +826,10 @@ Tue Jul 31 15:33:27 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 2001-07-31 Hartmut Penner <hpenner@de.ibm.com>
 
-        * doc/install.texi: Add s390 and s390x as new targets.
-        * doc/invoke.texi: Add documantation of S/390 and zSeries
-        target options.
-        * doc/md.texi: Add documantation of S/390 and zSeries constraints.
+       * doc/install.texi: Add s390 and s390x as new targets.
+       * doc/invoke.texi: Add documantation of S/390 and zSeries
+       target options.
+       * doc/md.texi: Add documantation of S/390 and zSeries constraints.
 
 2001-07-30  Roman Zippel  <zippel@linux-m68k.org>
 
@@ -827,7 +839,7 @@ Tue Jul 31 15:33:27 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 Mon Jul 30 23:20:34 EDT 2001  John Wehle  (john@feith.com)
 
-        * flow.c (merge_blocks): Return 1 if an extra jump is inserted.
+       * flow.c (merge_blocks): Return 1 if an extra jump is inserted.
 
 2001-07-30  Richard Henderson  <rth@redhat.com>
 
@@ -868,18 +880,18 @@ Mon Jul 30 22:16:08 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 2001-07-30  Andreas Jaeger  <aj@suse.de>
 
-        * jump.c: Add prototype for mark_modified_reg.
+       * jump.c: Add prototype for mark_modified_reg.
 
-        * cse.c (set_live_p): Add unused attribute.
+       * cse.c (set_live_p): Add unused attribute.
 
-        * gcov.c (calculate_branch_probs): Use gcov_type to avoid
-        overflow.
-        (scan_for_source_files): Use long for count to avoid overflow.
-        (output_data): Likewise.
-        (output_data): Don't use string concatatenation to silence gcc
-        -traditional.
+       * gcov.c (calculate_branch_probs): Use gcov_type to avoid
+       overflow.
+       (scan_for_source_files): Use long for count to avoid overflow.
+       (output_data): Likewise.
+       (output_data): Don't use string concatatenation to silence gcc
+       -traditional.
 
-        * predict.c: Fix typos and grammar.
+       * predict.c: Fix typos and grammar.
 
        * gcse.c (insert_insn_end_bb): Remove unused variables.
 
@@ -1122,7 +1134,7 @@ Fri Jul 27 17:53:00 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
 Fri Jul 27 00:33:35 EDT 2001  John Wehle  (john@feith.com)
 
-        * flow.c (redirect_edge_and_branch_force): Test
+       * flow.c (redirect_edge_and_branch_force): Test
        target->global_live_at_start.
 
 2001-07-26  Richard Henderson  <rth@redhat.com>
@@ -1168,8 +1180,8 @@ Thu Jul 26 14:04:03 EDT 2001  John Wehle  (john@feith.com)
 
 2001-07-26  Catherine Moore  <clm@redhat.com>
 
-        * config/v850/v850.h (ENCODE_SECTION_INFO):  Change order
-        of conditional to avoid tree checking errors.
+       * config/v850/v850.h (ENCODE_SECTION_INFO):  Change order
+       of conditional to avoid tree checking errors.
 
 2001-07-26  Kazu Hirata  <kazu@hxi.com>
 
@@ -1248,8 +1260,8 @@ Wed Jul 25 18:00:05 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
 2001-07-25  Catherine Moore  <clm@redhat.com>
 
-        * config/v850/v850.c (v850_va_arg):  Use addr
-        instead of valist to build incr.
+       * config/v850/v850.c (v850_va_arg):  Use addr
+       instead of valist to build incr.
 
 Wed Jul 25 22:48:59 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
@@ -1314,11 +1326,11 @@ Wed Jul 25 08:25:01 2001  Jeffrey A Law  (law@cygnus.com)
 
 2001-07-24  Joel Sherrill <joel@OARcorp.com>
 
-        * config/sparc/rtems.h (CPP_PREDEFINES): Remove redundant
+       * config/sparc/rtems.h (CPP_PREDEFINES): Remove redundant
        -Acpu and -Amachine.h.
-        * config/sparc/rtemself.h (CPP_PREDEFINES): Likewise.
-        Corrected header to say ELF not a.out.
-        * config/sparc/sparc.h (CPP_CPU_SPEC): Define _SOFT_FLOAT
+       * config/sparc/rtemself.h (CPP_PREDEFINES): Likewise.
+       Corrected header to say ELF not a.out.
+       * config/sparc/sparc.h (CPP_CPU_SPEC): Define _SOFT_FLOAT
        when given -msoft-float.
 
 2001-07-24  Joel Sherrill <joel@OARcorp.com>
index 9b8bc19f0a82fbb629c1ab6097af322410b8de5b..48dbd575f2c7862002ecc5256823a35e52798b79 100644 (file)
@@ -1510,7 +1510,8 @@ reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h $(EXPR_H)
    function.h real.h toplev.h $(TM_P_H)
 reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) real.h flags.h $(EXPR_H) \
    reload.h $(REGS_H) hard-reg-set.h insn-config.h \
-   $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H)
+   $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
+   except.h
 caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
    $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
    $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
index 810071509ceaf08f5ad3010cee34f47555e54735..dc2d1902cd9617269f2c00b72b791bdf2d64891a 100644 (file)
@@ -615,8 +615,8 @@ extern basic_block redirect_edge_and_branch_force PARAMS ((edge, basic_block));
 extern bool redirect_edge_and_branch   PARAMS ((edge, basic_block));
 extern rtx block_label                 PARAMS ((basic_block));
 extern bool forwarder_block_p          PARAMS ((basic_block));
-extern void purge_all_dead_edges       PARAMS ((void));
-extern void purge_dead_edges           PARAMS ((basic_block));
+extern bool purge_all_dead_edges       PARAMS ((void));
+extern bool purge_dead_edges           PARAMS ((basic_block));
 extern void find_sub_basic_blocks      PARAMS ((basic_block));
 
 
index c602fb179d01bc8e7034681b4d7497f49ed9eee1..c01d56ff47fffe815f118d95a2e19083d6b122a5 100644 (file)
@@ -10187,26 +10187,28 @@ init_flow ()
 }
 
 /* Assume that the preceeding pass has possibly eliminated jump instructions
-   or converted the unconditional jumps.  Eliminate the edges from CFG.  */
+   or converted the unconditional jumps.  Eliminate the edges from CFG.
+   Return true if any edges are eliminated.  */
 
-void
+bool
 purge_dead_edges (bb)
      basic_block bb;
 {
   edge e, next;
   rtx insn = bb->end;
+  bool purged = false;
+
   if (GET_CODE (insn) == JUMP_INSN && !simplejump_p (insn))
-    return;
+    return false;
   if (GET_CODE (insn) == JUMP_INSN)
     {
-      int removed = 0;
       rtx note;
       edge b,f;
       /* We do care only about conditional jumps and simplejumps.  */
       if (!any_condjump_p (insn)
          && !returnjump_p (insn)
          && !simplejump_p (insn))
-       return;
+       return false;
       for (e = bb->succ; e; e = next)
        {
          next = e->succ_next;
@@ -10221,15 +10223,15 @@ purge_dead_edges (bb)
          if (e->dest == EXIT_BLOCK_PTR
              && returnjump_p (insn))
            continue;
-         removed = 1;
+         purged = true;
          remove_edge (e);
        }
-      if (!bb->succ || !removed)
-       return;
+      if (!bb->succ || !purged)
+       return false;
       if (rtl_dump_file)
        fprintf (rtl_dump_file, "Purged edges from bb %i\n", bb->index);
       if (!optimize)
-       return;
+       return purged;
 
       /* Redistribute probabilities.  */
       if (!bb->succ->succ_next)
@@ -10241,7 +10243,7 @@ purge_dead_edges (bb)
        {
          note = find_reg_note (insn, REG_BR_PROB, NULL);
          if (!note)
-           return;
+           return purged;
          b = BRANCH_EDGE (bb);
          f = FALLTHRU_EDGE (bb);
          b->probability = INTVAL (XEXP (note, 0));
@@ -10249,8 +10251,22 @@ purge_dead_edges (bb)
          b->count = bb->count * b->probability / REG_BR_PROB_BASE;
          f->count = bb->count * f->probability / REG_BR_PROB_BASE;
        }
-      return;
+      return purged;
     }
+
+  /* Cleanup abnormal edges caused by throwing insns that have been
+     eliminated.  */
+  if (! can_throw_internal (bb->end))
+    for (e = bb->succ; e; e = next)
+      {
+       next = e->succ_next;
+       if (e->flags & EDGE_EH)
+         {
+           remove_edge (e);
+           purged = true;
+         }
+      }
+
   /* If we don't see a jump insn, we don't know exactly why the block would
      have been broken at this point.  Look for a simple, non-fallthru edge,
      as these are only created by conditional branches.  If we find such an
@@ -10259,12 +10275,12 @@ purge_dead_edges (bb)
   for (e = bb->succ; e && (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU));
        e = e->succ_next);
   if (!e)
-    return;
+    return purged;
   for (e = bb->succ; e; e = next)
     {
       next = e->succ_next;
       if (!(e->flags & EDGE_FALLTHRU))
-       remove_edge (e);
+       remove_edge (e), purged = true;
     }
   if (!bb->succ || bb->succ->succ_next)
     abort ();
@@ -10274,15 +10290,19 @@ purge_dead_edges (bb)
   if (rtl_dump_file)
     fprintf (rtl_dump_file, "Purged non-fallthru edges from bb %i\n",
             bb->index);
-  return;
+  return purged;
 }
 
-/* Search all basic blocks for potentionally dead edges and purge them.  */
+/* Search all basic blocks for potentionally dead edges and purge them.
+  
+   Return true ifif some edge has been elliminated.
+ */
 
-void
+bool
 purge_all_dead_edges ()
 {
-  int i;
+  int i, purged = false;
   for (i = 0; i < n_basic_blocks; i++)
-    purge_dead_edges (BASIC_BLOCK (i));
+    purged |= purge_dead_edges (BASIC_BLOCK (i));
+  return purged;
 }
index 09ef4ef99779f7456dcd97f85d96498f6e11f199..b2131de22e03af4127a4f47369f084dabb8aa208 100644 (file)
@@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA.  */
 #include "cselib.h"
 #include "real.h"
 #include "toplev.h"
+#include "except.h"
 
 #if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
@@ -9506,7 +9507,11 @@ fixup_abnormal_edges ()
          for (e = bb->succ; e; e = e->succ_next)
            if (e->flags & EDGE_FALLTHRU)
              break;
-         while (GET_CODE (insn) == INSN && !can_throw_internal (insn))
+         /* Get past the new insns generated. Allow notes, as the insns may
+            be already deleted.  */
+         while ((GET_CODE (insn) == INSN || GET_CODE (insn) == NOTE)
+                && !can_throw_internal (insn)
+                && insn != bb->head)
            insn = PREV_INSN (insn);
          if (GET_CODE (insn) != CALL_INSN && !can_throw_internal (insn))
            abort ();
index b69ea3f4fb539792054708fbcb42c5596a850b71..a2d489da8ff0fbc66ab017985aae4a382d863a60 100644 (file)
@@ -3267,6 +3267,10 @@ rest_of_compilation (decl)
       rebuild_jump_labels_after_combine
        = combine_instructions (insns, max_reg_num ());
 
+      /* Always purge dead edges, as we may eliminate an insn throwing
+         exception.  */
+      rebuild_jump_labels_after_combine |= purge_all_dead_edges ();
+
       /* Combining insns may have turned an indirect jump into a
         direct jump.  Rebuid the JUMP_LABEL fields of jumping
         instructions.  */
@@ -3277,7 +3281,6 @@ rest_of_compilation (decl)
          timevar_pop (TV_JUMP);
 
          timevar_push (TV_FLOW);
-         purge_all_dead_edges ();
          cleanup_cfg (CLEANUP_EXPENSIVE);
 
          /* Blimey.  We've got to have the CFG up to date for the call to