re PR rtl-optimization/39938 (build broke for cris-elf with dbr_schedule change)
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 29 Apr 2009 21:44:26 +0000 (21:44 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 29 Apr 2009 21:44:26 +0000 (21:44 +0000)
PR rtl-optimization/39938
* Makefile.in (cfgrtl.o): Add $(INSN_ATTR_H).
* cfgrtl.c: Include insn-attr.h.
(rest_of_pass_free_cfg): New function.
(pass_free_cfg): Use rest_of_pass_free_cfg as execute function.
* resource.c (init_resource_info): Remove call to df_analyze.

Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r146988

gcc/ChangeLog
gcc/Makefile.in
gcc/cfgrtl.c
gcc/resource.c

index c7a97dd..888a769 100644 (file)
@@ -1,3 +1,13 @@
+2009-04-29  Eric Botcazou  <ebotcazou@adacore.com>
+            Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR rtl-optimization/39938
+       * Makefile.in (cfgrtl.o): Add $(INSN_ATTR_H).
+       * cfgrtl.c: Include insn-attr.h.
+       (rest_of_pass_free_cfg): New function.
+       (pass_free_cfg): Use rest_of_pass_free_cfg as execute function.
+       * resource.c (init_resource_info): Remove call to df_analyze.
+
 2009-04-29  Richard Guenther  <rguenther@suse.de>
 
        PR target/39943
index 2283138..1a25348 100644 (file)
@@ -2802,7 +2802,8 @@ cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
    value-prof.h $(TREE_INLINE_H) $(TARGET_H) $(SSAEXPAND_H)
 cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \
-   output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(TM_P_H) insn-config.h $(EXPR_H) \
+   output.h $(TOPLEV_H) $(FUNCTION_H) $(EXCEPT_H) $(TM_P_H) $(INSN_ATTR_H) \
+   insn-config.h $(EXPR_H) \
    $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \
    $(TREE_PASS_H) $(DF_H) $(GGC_H)
 cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
index 36bc865..a2c0e0f 100644 (file)
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "tm_p.h"
 #include "obstack.h"
+#include "insn-attr.h"
 #include "insn-config.h"
 #include "cfglayout.h"
 #include "expr.h"
@@ -408,13 +409,27 @@ free_bb_for_insn (void)
   return 0;
 }
 
+static unsigned int
+rest_of_pass_free_cfg (void)
+{
+#ifdef DELAY_SLOTS
+  /* The resource.c machinery uses DF but the CFG isn't guaranteed to be
+     valid at that point so it would be too late to call df_analyze.  */
+  if (optimize > 0 && flag_delayed_branch)
+    df_analyze ();
+#endif
+
+  free_bb_for_insn ();
+  return 0;
+}
+
 struct rtl_opt_pass pass_free_cfg =
 {
  {
   RTL_PASS,
   NULL,                                 /* name */
   NULL,                                 /* gate */
-  free_bb_for_insn,                     /* execute */
+  rest_of_pass_free_cfg,                /* execute */
   NULL,                                 /* sub */
   NULL,                                 /* next */
   0,                                    /* static_pass_number */
index be76f68..91b86c9 100644 (file)
@@ -1200,8 +1200,6 @@ init_resource_info (rtx epilogue_insn)
   FOR_EACH_BB (bb)
     if (LABEL_P (BB_HEAD (bb)))
       BLOCK_FOR_INSN (BB_HEAD (bb)) = bb;
-
-  df_analyze ();
 }
 \f
 /* Free up the resources allocated to mark_target_live_regs ().  This