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]

[PATCH ARM] Make INITIALIZE_TRAMPOLINE always sync caches


This patch fixes a regression on arm-netbsdelf with trampolines.  

Having thought about it for a while, I've concluded that the benefits of 
avoiding the cache flush in a few environments are outweighed by the 
penalties for those where not doing it is fatal.

For example in a cross environment we can't be sure how to do the cache 
clean so the compiler does not define CLEAR_INSN_CACHE.  However, by 
calling __cache_flush anyway it is possible for the user to override the 
default library call with one that does work.  If the call isn't made then 
they are stuck.

Tested on arm-netbsdelf, fixes several regressions.

2005-05-13  Richard Earnshaw  <richard.earnshaw@arm.com>

	* arm.h (INITIALIZE_TRAMPOLINE): Make the call to __clear_cache
	unconditional.


Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.281
diff -p -p -r1.281 arm.h
*** config/arm/arm.h	11 May 2005 14:59:09 -0000	1.281
--- config/arm/arm.h	13 May 2005 21:55:25 -0000
*************** typedef struct
*** 1776,1790 ****
  /* Alignment required for a trampoline in bits.  */
  #define TRAMPOLINE_ALIGNMENT  32
  
- /* Call __clear_cache after setting up the trampoline unless this is a nop.  */
- #ifdef CLEAR_INSN_CACHE
- #define ARM_EMIT_TRAMPOLINE_CACHE_CLEAR(TRAMP)				\
-   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),	\
- 		     0, VOIDmode, 2, TRAMP, Pmode,			\
- 		     plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);
- #else
- #define ARM_EMIT_TRAMPOLINE_CACHE_CLEAR(TRAMP) do {} while (0)
- #endif
  
  /* Emit RTL insns to initialize the variable parts of a trampoline.
     FNADDR is an RTX for the address of the function's pure code.
--- 1776,1781 ----
*************** typedef struct
*** 1800,1806 ****
  			       plus_constant (TRAMP,			\
  					      TARGET_ARM ? 12 : 20)),	\
  		  FNADDR);						\
!   ARM_EMIT_TRAMPOLINE_CACHE_CLEAR (TRAMP);				\
  }
  #endif
  
--- 1791,1799 ----
  			       plus_constant (TRAMP,			\
  					      TARGET_ARM ? 12 : 20)),	\
  		  FNADDR);						\
!   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),	\
! 		     0, VOIDmode, 2, TRAMP, Pmode,			\
! 		     plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);	\
  }
  #endif
  

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