summaryrefslogtreecommitdiff
path: root/gcc/config/frv
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-09-29 17:57:06 +0000
committerNick Clifton <nickc@gcc.gnu.org>2011-09-29 17:57:06 +0000
commit0fad9ab91153a34b3a07d8defa76bf6fb72f9cae (patch)
tree7f9cae6b9e0d7f0d97a6b254f7353681123f8dad /gcc/config/frv
parentb24a9835613b24310676865c937f65f9c3c5da43 (diff)
downloadgcc-0fad9ab91153a34b3a07d8defa76bf6fb72f9cae.tar.gz
frvbegin.c: Fix location of unwind-dw2-fde.h header file.
* config/frv/frvbegin.c: Fix location of unwind-dw2-fde.h header file. * config/frv/frvend.c: Likewise. * config/frv/frv.c (frv_function_prologue): Move misplaced CALL_ARG_LOCATION notes back to their proper locations. Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com> From-SVN: r179363
Diffstat (limited to 'gcc/config/frv')
-rw-r--r--gcc/config/frv/frv.c28
-rw-r--r--gcc/config/frv/frvbegin.c2
-rw-r--r--gcc/config/frv/frvend.c2
3 files changed, 30 insertions, 2 deletions
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 7d8b47bb1dd..e7a3c7ae49d 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1424,6 +1424,8 @@ frv_function_contains_far_jump (void)
static void
frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
+ rtx insn, next, last_call;
+
/* If no frame was created, check whether the function uses a call
instruction to implement a far jump. If so, save the link in gr3 and
replace all returns to LR with returns to GR3. GR3 is used because it
@@ -1464,6 +1466,32 @@ frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
/* Allow the garbage collector to free the nops created by frv_reorg. */
memset (frv_nops, 0, sizeof (frv_nops));
+
+ /* Locate CALL_ARG_LOCATION notes that have been misplaced
+ and move them back to where they should be located. */
+ last_call = NULL_RTX;
+ for (insn = get_insns (); insn; insn = next)
+ {
+ next = NEXT_INSN (insn);
+ if (CALL_P (insn)
+ || (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE
+ && CALL_P (XVECEXP (PATTERN (insn), 0, 0))))
+ last_call = insn;
+
+ if (!NOTE_P (insn) || NOTE_KIND (insn) != NOTE_INSN_CALL_ARG_LOCATION)
+ continue;
+
+ if (NEXT_INSN (last_call) == insn)
+ continue;
+
+ NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
+ PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
+ PREV_INSN (insn) = last_call;
+ NEXT_INSN (insn) = NEXT_INSN (last_call);
+ PREV_INSN (NEXT_INSN (insn)) = insn;
+ NEXT_INSN (PREV_INSN (insn)) = insn;
+ last_call = insn;
+ }
}
diff --git a/gcc/config/frv/frvbegin.c b/gcc/config/frv/frvbegin.c
index 963ebd091cd..23cbf1ecc93 100644
--- a/gcc/config/frv/frvbegin.c
+++ b/gcc/config/frv/frvbegin.c
@@ -28,7 +28,7 @@
#include "defaults.h"
#include <stddef.h>
-#include "unwind-dw2-fde.h"
+#include "../libgcc/unwind-dw2-fde.h"
#include "gbl-ctors.h"
/* Declare a pointer to void function type. */
diff --git a/gcc/config/frv/frvend.c b/gcc/config/frv/frvend.c
index 04b880df32a..0bb07b56b4a 100644
--- a/gcc/config/frv/frvend.c
+++ b/gcc/config/frv/frvend.c
@@ -25,7 +25,7 @@
#include "defaults.h"
#include <stddef.h>
-#include "unwind-dw2-fde.h"
+#include "../libgcc/unwind-dw2-fde.h"
#ifdef __FRV_UNDERSCORE__
#define UNDERSCORE "_"