OSDN Git Service

Fix moxie tramponline alignment problem
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Feb 2010 11:36:30 +0000 (11:36 +0000)
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Feb 2010 11:36:30 +0000 (11:36 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156465 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/moxie/moxie.c
gcc/config/moxie/moxie.h

index 0119d35..d36c7cf 100644 (file)
@@ -1,3 +1,14 @@
+2010-02-03  Anthony Green  <green@moxielogic.com>
+
+       * config/moxie/moxie.c (moxie_asm_trampoline_template): Introduce
+       nop padding in order to maintain alignment of storage location of
+       target function address.
+       (moxie_trampoline_init): Store target function address at newly
+       aligned location.
+       * config/moxie/moxie.h (TRAMPOLINE_ALIGNMENT): Increase alignment
+       to 32.
+       (TRAMPOLINE_SIZE): Increase size by 2 bytes for alignment padding.
+
 2010-02-03  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/42927
index 7515fa2..b1cefb6 100644 (file)
@@ -1,5 +1,5 @@
 /* Target Code for moxie
-   Copyright (C) 2008, 2009  Free Software Foundation
+   Copyright (C) 2008, 2009, 2010  Free Software Foundation
    Contributed by Anthony Green.
 
    This file is part of GCC.
@@ -483,6 +483,7 @@ moxie_asm_trampoline_template (FILE *f)
   fprintf (f, "\tldi.l $r0, 0x0\n");
   fprintf (f, "\tsto.l 0x8($fp), $r0\n");
   fprintf (f, "\tpop   $sp, $r0\n");
+  fprintf (f, "\tnop\n");
   fprintf (f, "\tjmpa  0x0\n");
 }
 
@@ -498,7 +499,7 @@ moxie_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
 
   mem = adjust_address (m_tramp, SImode, 4);
   emit_move_insn (mem, chain_value);
-  mem = adjust_address (m_tramp, SImode, 18);
+  mem = adjust_address (m_tramp, SImode, 20);
   emit_move_insn (mem, fnaddr);
 }
 
index 384bce4..928ca88 100644 (file)
@@ -1,5 +1,5 @@
 /* Target Definitions for moxie.
-   Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010  Free Software Foundation, Inc.
    Contributed by Anthony Green.
 
    This file is part of GCC.
@@ -386,10 +386,10 @@ enum reg_class
 #define FUNCTION_PROFILER(FILE,LABELNO) (abort (), 0)
 
 /* Trampolines for Nested Functions.  */
-#define TRAMPOLINE_SIZE (2 + 6 + 6 + 2 + 6)
+#define TRAMPOLINE_SIZE (2 + 6 + 6 + 2 + 2 + 6)
 
 /* Alignment required for trampolines, in bits.  */
-#define TRAMPOLINE_ALIGNMENT 16
+#define TRAMPOLINE_ALIGNMENT 32
 
 /* An alias for the machine mode for pointers.  */
 #define Pmode         SImode