OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / df-problems.c
index f9b0bc1..4afdd6f 100644 (file)
@@ -1,6 +1,6 @@
 /* Standard problems for dataflow support routines.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-   2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
    Originally contributed by Michael P. Hayes
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
    Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
@@ -2814,8 +2814,10 @@ df_kill_notes (rtx insn, bitmap live)
              {
                df_ref use = *use_rec;
                if (DF_REF_REGNO (use) > FIRST_PSEUDO_REGISTER
+                   && DF_REF_LOC (use)
                    && (DF_REF_FLAGS (use) & DF_REF_IN_NOTE)
-                   && ! bitmap_bit_p (live, DF_REF_REGNO (use)))
+                   && ! bitmap_bit_p (live, DF_REF_REGNO (use))
+                   && loc_mentioned_in_p (DF_REF_LOC (use), XEXP (link, 0)))
                  {
                    deleted = true;
                    break;
@@ -3959,6 +3961,19 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to,
 
   for (insn = across_to; ; insn = next)
     {
+      if (CALL_P (insn))
+       {
+         if (RTL_CONST_OR_PURE_CALL_P (insn))
+           /* Pure functions can read from memory.  Const functions can
+              read from arguments that the ABI has forced onto the stack.
+              Neither sort of read can be volatile.  */
+           memrefs_in_across |= MEMREF_NORMAL;
+         else
+           {
+             memrefs_in_across |= MEMREF_VOLATILE;
+             mem_sets_in_across |= MEMREF_VOLATILE;
+           }
+       }
       if (NONDEBUG_INSN_P (insn))
        {
          memrefs_in_across |= for_each_rtx (&PATTERN (insn), find_memory,