OSDN Git Service

2014-02-15 Jerry DeLisle <jvdelisle@gcc.gnu>
[pf3gnuchains/gcc-fork.git] / gcc / ira.c
index a632284..66a8a28 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1,5 +1,5 @@
 /* Integrated Register Allocator (IRA) entry point.
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
    Contributed by Vladimir Makarov <vmakarov@redhat.com>.
 
@@ -2089,7 +2089,7 @@ check_allocation (void)
          int this_regno = hard_regno;
          if (n > 1)
            {
-             if (WORDS_BIG_ENDIAN)
+             if (REG_WORDS_BIG_ENDIAN)
                this_regno += n - i - 1;
              else
                this_regno += i;
@@ -2108,7 +2108,7 @@ check_allocation (void)
              if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1
                  && conflict_nregs == ALLOCNO_NUM_OBJECTS (conflict_a))
                {
-                 if (WORDS_BIG_ENDIAN)
+                 if (REG_WORDS_BIG_ENDIAN)
                    conflict_hard_regno += (ALLOCNO_NUM_OBJECTS (conflict_a)
                                            - OBJECT_SUBWORD (conflict_obj) - 1);
                  else
@@ -2335,7 +2335,7 @@ validate_equiv_mem_from_store (rtx dest, const_rtx set ATTRIBUTE_UNUSED,
   if ((REG_P (dest)
        && reg_overlap_mentioned_p (dest, equiv_mem))
       || (MEM_P (dest)
-         && true_dependence (dest, VOIDmode, equiv_mem, rtx_varies_p)))
+         && true_dependence (dest, VOIDmode, equiv_mem)))
     equiv_mem_modified = 1;
 }
 
@@ -2589,7 +2589,7 @@ memref_referenced_p (rtx memref, rtx x)
                                      reg_equiv[REGNO (x)].replacement));
 
     case MEM:
-      if (true_dependence (memref, VOIDmode, x, rtx_varies_p))
+      if (true_dependence (memref, VOIDmode, x))
        return 1;
       break;
 
@@ -3788,6 +3788,18 @@ do_reload (void)
   if (need_dce && optimize)
     run_fast_dce ();
 
+  /* Diagnose uses of the hard frame pointer when it is used as a global
+     register.  Often we can get away with letting the user appropriate
+     the frame pointer, but we should let them know when code generation
+     makes that impossible.  */
+  if (global_regs[HARD_FRAME_POINTER_REGNUM] && frame_pointer_needed)
+    {
+      tree decl = global_regs_decl[HARD_FRAME_POINTER_REGNUM];
+      error_at (DECL_SOURCE_LOCATION (current_function_decl),
+                "frame pointer required, but reserved");
+      inform (DECL_SOURCE_LOCATION (decl), "for %qD", decl);
+    }
+
   timevar_pop (TV_IRA);
 }
 \f