]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/postreload-gcse.c
Update copyright years.
[thirdparty/gcc.git] / gcc / postreload-gcse.c
index 39c8c3959d1d4d46ab1ee7460e55193eb35329da..cbc0df2606cf3b0a956233d7ac6dedaab6ecc39b 100644 (file)
@@ -1,5 +1,5 @@
 /* Post reload partially redundant load elimination
-   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -20,42 +20,24 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
-#include "diagnostic-core.h"
-
+#include "backend.h"
+#include "target.h"
 #include "rtl.h"
-#include "alias.h"
-#include "symtab.h"
 #include "tree.h"
+#include "predict.h"
+#include "df.h"
+#include "memmodel.h"
 #include "tm_p.h"
-#include "regs.h"
-#include "hard-reg-set.h"
-#include "flags.h"
 #include "insn-config.h"
+#include "emit-rtl.h"
 #include "recog.h"
-#include "predict.h"
-#include "function.h"
-#include "dominance.h"
-#include "cfg.h"
+
 #include "cfgrtl.h"
-#include "basic-block.h"
 #include "profile.h"
-#include "expmed.h"
-#include "dojump.h"
-#include "explow.h"
-#include "calls.h"
-#include "emit-rtl.h"
-#include "varasm.h"
-#include "stmt.h"
 #include "expr.h"
-#include "except.h"
-#include "intl.h"
-#include "obstack.h"
 #include "params.h"
-#include "target.h"
 #include "tree-pass.h"
 #include "dbgcnt.h"
-#include "df.h"
 #include "gcse-common.h"
 
 /* The following code implements gcse after reload, the purpose of this
@@ -120,10 +102,8 @@ struct expr
 
 /* Hashtable helpers.  */
 
-struct expr_hasher : typed_noop_remove <expr>
+struct expr_hasher : nofree_ptr_hash <expr>
 {
-  typedef expr *value_type;
-  typedef expr *compare_type;
   static inline hashval_t hash (const expr *);
   static inline bool equal (const expr *, const expr *);
 };
@@ -369,6 +349,8 @@ free_mem (void)
   BITMAP_FREE (blocks_with_calls);
   BITMAP_FREE (modify_mem_list_set);
   free (reg_avail_info);
+  free (modify_mem_list);
+  free (canon_modify_mem_list);
 }
 \f
 
@@ -981,7 +963,9 @@ bb_has_well_behaved_predecessors (basic_block bb)
 
   FOR_EACH_EDGE (pred, ei, bb->preds)
     {
-      if ((pred->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (pred))
+      /* commit_one_edge_insertion refuses to insert on abnormal edges even if
+        the source has only one successor so EDGE_CRITICAL_P is too weak.  */
+      if ((pred->flags & EDGE_ABNORMAL) && !single_pred_p (pred->dest))
        return false;
 
       if ((pred->flags & EDGE_ABNORMAL_CALL) && cfun->has_nonlocal_label)