]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
emit-rtl.c (copy_delay_slot_insn): New function.
authorJoern Rennecke <joern.rennecke@embecosm.com>
Sat, 20 Oct 2012 11:37:27 +0000 (11:37 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Sat, 20 Oct 2012 11:37:27 +0000 (12:37 +0100)
2012-10-20  Joern Rennecke  <joern.rennecke@embecosm.com>
            Richard Sandiford  <rdsandiford@googlemail.com>

        * emit-rtl.c (copy_delay_slot_insn): New function.
        * emit-rtl.h (copy_delay_slot_insn): Declare.
        * reorg.c: Include "emit-rtl.h".
        (steal_delay_list_from_target): Use copy_delay_slot_insn.
        (fill_slots_from_thread, fill_simple_delay_slots): Likewise.

Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>
From-SVN: r192633

gcc/ChangeLog
gcc/emit-rtl.c
gcc/emit-rtl.h
gcc/reorg.c

index 6ddffd5e543d602b43ec6072a96a943370fb1655..44141a1c73607375c2e2122c7ee37779728fa4ab 100644 (file)
@@ -1,3 +1,12 @@
+2012-10-20  Joern Rennecke  <joern.rennecke@embecosm.com>
+           Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * emit-rtl.c (copy_delay_slot_insn): New function.
+       * emit-rtl.h (copy_delay_slot_insn): Declare.
+       * reorg.c: Include "emit-rtl.h".
+       (steal_delay_list_from_target): Use copy_delay_slot_insn.
+       (fill_slots_from_thread, fill_simple_delay_slots): Likewise.
+
 2012-10-19  Jan Hubicka  <jh@suse.cz>
 
        * builtins.def (BUILT_IN_UNREACHABLE): Make ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST.
index ee6ae226e23f77ba5ce53c8bf8bfc9740f04d45e..7d7b1dfb0a132133a586aa160a7ccb832e0091d0 100644 (file)
@@ -1,8 +1,5 @@
 /* Emit RTL for the GCC expander.
-   Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-   2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1992-2012 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -5378,6 +5375,18 @@ copy_insn (rtx insn)
   return copy_insn_1 (insn);
 }
 
+/* Return a copy of INSN that can be used in a SEQUENCE delay slot,
+   on that assumption that INSN itself remains in its original place.  */
+
+rtx
+copy_delay_slot_insn (rtx insn)
+{
+  /* Copy INSN with its rtx_code, all its notes, location etc.  */
+  insn = copy_rtx (insn);
+  INSN_UID (insn) = cur_insn_uid++;
+  return insn;
+}
+
 /* Initialize data structures and variables in this file
    before generating rtl for each function.  */
 
index 715d4dd69840729ac428416ddb8c2f7c632048cf..cd0cbd0049bee75f14b18569ab3b161642dd64e4 100644 (file)
@@ -1,5 +1,5 @@
 /* Exported functions from emit-rtl.c
-   Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007, 2008, 2010, 2012 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -61,6 +61,7 @@ extern rtx gen_blockage (void);
 extern rtvec gen_rtvec (int, ...);
 extern rtx copy_insn_1 (rtx);
 extern rtx copy_insn (rtx);
+extern rtx copy_delay_slot_insn (rtx);
 extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
 extern rtx emit_copy_of_insn_after (rtx, rtx);
 extern void set_reg_attrs_from_value (rtx, rtx);
index 89442e395aa4bb55e7dd8c7e9e706ef832789e7a..e07b8341ed4fbf7ffd91b030308831ac1d14035d 100644 (file)
@@ -1,6 +1,6 @@
 /* Perform instruction reorganizations for delay slot filling.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
    Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
    Hacked by Michael Tiemann (tiemann@cygnus.com).
@@ -134,6 +134,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "params.h"
 #include "target.h"
 #include "tree-pass.h"
+#include "emit-rtl.h"
 
 #ifdef DELAY_SLOTS
 
@@ -1297,7 +1298,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
        {
          if (must_annul)
            used_annul = 1;
-         temp = copy_rtx (trial);
+         temp = copy_delay_slot_insn (trial);
          INSN_FROM_TARGET_P (temp) = 1;
          new_delay_list = add_to_delay_list (temp, new_delay_list);
          total_slots_filled++;
@@ -2369,7 +2370,8 @@ fill_simple_delay_slots (int non_jumps_p)
              if (new_label)
                {
                  delay_list
-                   = add_to_delay_list (copy_rtx (next_trial), delay_list);
+                   = add_to_delay_list (copy_delay_slot_insn (next_trial),
+                                        delay_list);
                  slots_filled++;
                  reorg_redirect_jump (trial, new_label);
 
@@ -2793,7 +2795,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
                  else
                    new_thread = next_active_insn (trial);
 
-                 temp = own_thread ? trial : copy_rtx (trial);
+                 temp = own_thread ? trial : copy_delay_slot_insn (trial);
                  if (thread_if_true)
                    INSN_FROM_TARGET_P (temp) = 1;
 
@@ -2974,7 +2976,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
          else
            new_thread = next_active_insn (trial);
 
-         ninsn = own_thread ? trial : copy_rtx (trial);
+         ninsn = own_thread ? trial : copy_delay_slot_insn (trial);
          if (thread_if_true)
            INSN_FROM_TARGET_P (ninsn) = 1;