re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins)
[gcc.git] / gcc / cse.c
index 88a15e4b39ba050c0ebc9249196ca2daa3bbcae8..100c9c83e769faf920d15c98bb614c35b80e8b5d 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -26,11 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "hard-reg-set.h"
 #include "regs.h"
 #include "predict.h"
-#include "vec.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "input.h"
 #include "function.h"
 #include "dominance.h"
 #include "cfg.h"
@@ -42,13 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "insn-config.h"
 #include "recog.h"
 #include "symtab.h"
-#include "statistics.h"
-#include "double-int.h"
-#include "real.h"
-#include "fixed-value.h"
 #include "alias.h"
-#include "wide-int.h"
-#include "inchash.h"
 #include "tree.h"
 #include "expmed.h"
 #include "dojump.h"
@@ -60,7 +49,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "expr.h"
 #include "diagnostic-core.h"
 #include "toplev.h"
-#include "ggc.h"
 #include "except.h"
 #include "target.h"
 #include "params.h"
@@ -1894,7 +1882,7 @@ invalidate (rtx x, machine_mode full_mode)
          {
            HOST_WIDE_INT in_table
              = TEST_HARD_REG_BIT (hard_regs_in_table, regno);
-           unsigned int endregno = END_HARD_REGNO (x);
+           unsigned int endregno = END_REGNO (x);
            unsigned int tregno, tendregno, rn;
            struct table_elt *p, *next;
 
@@ -1920,7 +1908,7 @@ invalidate (rtx x, machine_mode full_mode)
                      continue;
 
                    tregno = REGNO (p->exp);
-                   tendregno = END_HARD_REGNO (p->exp);
+                   tendregno = END_REGNO (p->exp);
                    if (tendregno > regno && tregno < endregno)
                      remove_from_table (p, hash);
                  }
@@ -2139,7 +2127,7 @@ invalidate_for_call (void)
            continue;
 
          regno = REGNO (p->exp);
-         endregno = END_HARD_REGNO (p->exp);
+         endregno = END_REGNO (p->exp);
 
          for (i = regno; i < endregno; i++)
            if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
@@ -3183,12 +3171,10 @@ fold_rtx (rtx x, rtx_insn *insn)
        }
       return x;
 
-#ifdef NO_FUNCTION_CSE
     case CALL:
-      if (CONSTANT_P (XEXP (XEXP (x, 0), 0)))
+      if (NO_FUNCTION_CSE && CONSTANT_P (XEXP (XEXP (x, 0), 0)))
        return x;
       break;
-#endif
 
     /* Anything else goes through the loop below.  */
     default:
@@ -5494,7 +5480,7 @@ cse_insn (rtx_insn *insn)
             and hope for the best.  */
          if (n_sets == 1)
            {
-             rtx_insn *new_rtx;
+             rtx_jump_insn *new_rtx;
              rtx note;
 
              new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
@@ -6852,7 +6838,7 @@ static bool
 set_live_p (rtx set, rtx_insn *insn ATTRIBUTE_UNUSED, /* Only used with HAVE_cc0.  */
            int *counts)
 {
-  rtx tem;
+  rtx_insn *tem;
 
   if (set_noop_p (set))
     ;
@@ -7133,7 +7119,7 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg)
 
 static void
 cse_change_cc_mode (subrtx_ptr_iterator::array_type &array,
-                   rtx *loc, rtx insn, rtx newreg)
+                   rtx *loc, rtx_insn *insn, rtx newreg)
 {
   FOR_EACH_SUBRTX_PTR (iter, array, loc, NONCONST)
     {