This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix incorrect function_boundary uses in alpha port


The commentary for TRAMPOLINE_TEMPLATE indicated the wrong-think
wrt trampoline alignment.  The preferred cacheline alignment for
unicos is taken care of in override_options.  The alpha_align_insns
bit results in spurious .align directives in the assembly output.


r~


        * config/alpha/alpha.c (alpha_align_insns): Use align_functions,
        not FUNCTION_BOUNDARY.
        * config/alpha/alpha.h (TRAMPOLINE_ALIGNMENT): New.
        * config/alpha/alpha32.h, config/alpha/vms.h: Likewise.
        * config/alpha/unicosmk.h (FUNCTION_BOUNDARY): Remove.

Index: alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.210
diff -c -p -d -r1.210 alpha.c
*** alpha.c	2001/12/07 20:13:34	1.210
--- alpha.c	2001/12/09 21:39:43
*************** alpha_align_insns (insns, max_align, nex
*** 7570,7577 ****
    /* Let shorten branches care for assigning alignments to code labels.  */
    shorten_branches (insns);
  
!   align = (FUNCTION_BOUNDARY / BITS_PER_UNIT < max_align
! 	   ? FUNCTION_BOUNDARY / BITS_PER_UNIT : max_align);
  
    ofs = prev_in_use = 0;
    i = insns;
--- 7570,7581 ----
    /* Let shorten branches care for assigning alignments to code labels.  */
    shorten_branches (insns);
  
!   if (align_functions < 4)
!     align = 4;
!   else if (align_functions < max_align)
!     align = align_functions;
!   else
!     align = max_align;
  
    ofs = prev_in_use = 0;
    i = insns;
Index: alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.142
diff -c -p -d -r1.142 alpha.h
*** alpha.h	2001/11/22 02:19:48	1.142
--- alpha.h	2001/12/09 21:39:45
*************** extern struct alpha_compare alpha_compar
*** 1317,1324 ****
     The trampoline should set the static chain pointer to value placed
     into the trampoline and should branch to the specified routine.  
     Note that $27 has been set to the address of the trampoline, so we can
!    use it for addressability of the two data items.  Trampolines are always
!    aligned to FUNCTION_BOUNDARY, which is 64 bits.  */
  
  #define TRAMPOLINE_TEMPLATE(FILE)		\
  do {						\
--- 1317,1323 ----
     The trampoline should set the static chain pointer to value placed
     into the trampoline and should branch to the specified routine.  
     Note that $27 has been set to the address of the trampoline, so we can
!    use it for addressability of the two data items.  */
  
  #define TRAMPOLINE_TEMPLATE(FILE)		\
  do {						\
*************** do {						\
*** 1337,1342 ****
--- 1336,1345 ----
  /* Length in units of the trampoline for entering a nested function.  */
  
  #define TRAMPOLINE_SIZE    32
+ 
+ /* The alignment of a trampoline, in bits.  */
+ 
+ #define TRAMPOLINE_ALIGNMENT  64
  
  /* Emit RTL insns to initialize the variable parts of a trampoline.
     FNADDR is an RTX for the address of the function's pure code.
Index: alpha32.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha32.h,v
retrieving revision 1.7
diff -c -p -d -r1.7 alpha32.h
*** alpha32.h	2001/11/12 15:29:46	1.7
--- alpha32.h	2001/12/09 21:39:45
*************** Boston, MA 02111-1307, USA.  */
*** 71,76 ****
--- 71,81 ----
  #undef TRAMPOLINE_SIZE
  #define TRAMPOLINE_SIZE    24
  
+ /* The alignment of a trampoline, in bits.  */
+ 
+ #undef TRAMPOLINE_ALIGNMENT
+ #define TRAMPOLINE_ALIGNMENT  32
+ 
  /* Emit RTL insns to initialize the variable parts of a trampoline.
     FNADDR is an RTX for the address of the function's pure code.
     CXT is an RTX for the static chain value for the function.  */
Index: unicosmk.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/unicosmk.h,v
retrieving revision 1.5
diff -c -p -d -r1.5 unicosmk.h
*** unicosmk.h	2001/11/12 15:29:46	1.5
--- unicosmk.h	2001/12/09 21:39:46
*************** Boston, MA 02111-1307, USA.  */
*** 73,84 ****
  #undef STRUCTURE_SIZE_BOUNDARY
  #define STRUCTURE_SIZE_BOUNDARY 64
  
- /* Allocation boundary (in *bits*) for the code of a function. Functions
-    should be cache-aligned on the T3E.  */
- 
- #undef FUNCTION_BOUNDARY
- #define FUNCTION_BOUNDARY 256
- 
  /* No data type wants to be aligned rounder than this.  */
  
  #undef BIGGEST_ALIGNMENT
--- 73,78 ----
Index: vms.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/vms.h,v
retrieving revision 1.45
diff -c -p -d -r1.45 vms.h
*** vms.h	2001/12/09 16:31:47	1.45
--- vms.h	2001/12/09 21:39:46
*************** do {									\
*** 351,358 ****
     The trampoline should set the static chain pointer to value placed
     into the trampoline and should branch to the specified routine.  
     Note that $27 has been set to the address of the trampoline, so we can
!    use it for addressability of the two data items.  Trampolines are always
!    aligned to FUNCTION_BOUNDARY, which is 64 bits.  */
  
  #undef TRAMPOLINE_TEMPLATE
  #define TRAMPOLINE_TEMPLATE(FILE)		\
--- 351,357 ----
     The trampoline should set the static chain pointer to value placed
     into the trampoline and should branch to the specified routine.  
     Note that $27 has been set to the address of the trampoline, so we can
!    use it for addressability of the two data items.  */
  
  #undef TRAMPOLINE_TEMPLATE
  #define TRAMPOLINE_TEMPLATE(FILE)		\
*************** do {									\
*** 366,371 ****
--- 365,375 ----
  
  #undef TRAMPOLINE_SIZE
  #define TRAMPOLINE_SIZE    32
+ 
+ /* The alignment of a trampoline, in bits.  */
+ 
+ #undef TRAMPOLINE_ALIGNMENT
+ #define TRAMPOLINE_ALIGNMENT  64
  
  /* Emit RTL insns to initialize the variable parts of a trampoline.
     FNADDR is an RTX for the address of the function's pure code.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]