]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cfgcleanup.c (cleanup_cfg): Detect cfglayout mode and set
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2007 08:17:06 +0000 (08:17 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2007 08:17:06 +0000 (08:17 +0000)
the CLEANUP_CFGLAYOUT flag when in cfglayout mode.

* Makefile.c (GTFILES): Add cfglayout.h.
* gengtype.c (open_base_files): Likewise.
* cfglayout.c (cfg_layout_function_footer,
cfg_layout_function_header) Reindent to make gengtype happy.
* cfglayout.h (cfg_layout_function_footer,
cfg_layout_function_header): Add GTY(()) marker.

* ifcvt.c (noce_try_sign_mask): Make sure INSN_B is non-null.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120893 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/cfgcleanup.c
gcc/cfglayout.c
gcc/cfglayout.h
gcc/gengtype.c
gcc/ifcvt.c

index 81ffc51e3b47dc42b28b6cd2d1d43f169f1b7163..caaf93290d23ce857e04d21751154d8cebb43ac3 100644 (file)
@@ -1,3 +1,17 @@
+18-01-2007  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * cfgcleanup.c (cleanup_cfg): Detect cfglayout mode and set
+       the CLEANUP_CFGLAYOUT flag when in cfglayout mode.
+
+       * Makefile.c (GTFILES): Add cfglayout.h.
+       * gengtype.c (open_base_files): Likewise.
+       * cfglayout.c (cfg_layout_function_footer,
+       cfg_layout_function_header) Reindent to make gengtype happy.
+       * cfglayout.h (cfg_layout_function_footer,
+       cfg_layout_function_header): Add GTY(()) marker.
+
+       * ifcvt.c (noce_try_sign_mask): Make sure INSN_B is non-null.
+
 2007-01-18  Ben Elliston  <bje@au.ibm.com>
 
        * genautomata.c (write_automata): Include xstrerror output in the
index 33461161d917f14b4ee8619f055c25443e319dee..f27214241abdbb4a190bc044a199348d73e50f54 100644 (file)
@@ -2805,7 +2805,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(srcdir)/function.c $(srcdir)/except.h \
   $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
   $(srcdir)/profile.c $(srcdir)/regclass.c \
-  $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \
+  $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
   $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
   $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
   $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
index ad9ae4f8f3bf30cf88041c73b36ae8a31ac62f27..7f2abf1c117c28249a6e6cbf7d28900e3a55d730 100644 (file)
@@ -2220,6 +2220,12 @@ cleanup_cfg (int mode)
 {
   bool changed = false;
 
+  /* Set the cfglayout mode flag here.  We could update all the callers
+     but that is just inconvenient, especially given that we eventually
+     want to have cfglayout mode as the default.  */
+  if (current_ir_type () == IR_RTL_CFGLAYOUT)
+    mode |= CLEANUP_CFGLAYOUT;
+
   timevar_push (TV_CLEANUP_CFG);
   if (delete_unreachable_blocks ())
     {
index 15bde05de011ab363954c1611225c254ccf3581e..eacfd996224aa965cc01826f0a4ac4a00f1e02cc 100644 (file)
@@ -40,7 +40,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "vecprim.h"
 
 /* Holds the interesting trailing notes for the function.  */
-rtx cfg_layout_function_footer, cfg_layout_function_header;
+rtx cfg_layout_function_footer;
+rtx cfg_layout_function_header;
 
 static rtx skip_insns_after_block (basic_block);
 static void record_effective_endpoints (void);
index 4bc1e6759c8d98c029117d62ac6f2350ac813ee5..e2c00ad2ab38de9a99f531aba6c14aae213a11b4 100644 (file)
@@ -23,7 +23,8 @@
 
 #include "basic-block.h"
 
-extern rtx cfg_layout_function_footer;
+extern GTY(()) rtx cfg_layout_function_footer;
+extern GTY(()) rtx cfg_layout_function_header;
 
 extern void cfg_layout_initialize (unsigned int);
 extern void cfg_layout_finalize (void);
index f62659ada47a57d1271cf0b7609779319b324be7..1413d6fb4387b70c661590f8ec53b3c149eec343 100644 (file)
@@ -1107,7 +1107,7 @@ open_base_files (void)
       "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
       "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
       "tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
-      "except.h", "output.h", NULL
+      "cfglayout.h", "except.h", "output.h", NULL
     };
     const char *const *ifp;
     outf_p gtype_desc_c;
index 9e65a25bd7ba95eafc01684e69b218852906e76a..99228a8fa7e39e7fb2bbd36a3c575ce2a4a26955 100644 (file)
@@ -1866,6 +1866,7 @@ noce_try_sign_mask (struct noce_if_info *if_info)
   rtx cond, t, m, c, seq;
   enum machine_mode mode;
   enum rtx_code code;
+  bool b_unconditional;
 
   if (no_new_pseudos)
     return FALSE;
@@ -1899,9 +1900,12 @@ noce_try_sign_mask (struct noce_if_info *if_info)
 
   /* This is only profitable if T is cheap, or T is unconditionally
      executed/evaluated in the original insn sequence.  The latter
-     happens if INSN_B was taken from TEST_BB.  */
+     happens if INSN_B was taken from TEST_BB, or if there was no
+     INSN_B which can happen for e.g. conditional stores to memory.  */
+  b_unconditional = (if_info->insn_b == NULL_RTX
+                    || BLOCK_FOR_INSN (if_info->insn_b) == if_info->test_bb);
   if (rtx_cost (t, SET) >= COSTS_N_INSNS (2)
-      && (BLOCK_FOR_INSN (if_info->insn_b) != if_info->test_bb
+      && (!b_unconditional
           || t != if_info->b))
     return FALSE;