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: Diable TLS on Itanium HP-UX


This patch disables TLS on Itanium HP-UX.

The ia64.c logic incorrectly assumed that an assembler that supports
TLS indicated that the system as a whole supports TLS.  On Itanium
HP-UX we use GAS -- which supports TLS -- but HP-UX does not have TLS
support.  So, we were building a compiler that tried to support
__thread -- which the result that we get spurious TLS failures in the
DejaGNU testsuite.

In my opinion, the idea of using HAVE_AS_TLS to enable TLS isn't
correct; instead, we should be an explicit --enable-tls, or key off of
the --target options, since it is impossible to determine this
property of the target system at configure-time.  However, I didn't
try to change that...

Tested on ia64-hp-hpux11.23, applied on the mainline and on the
branch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-12-03  Mark Mitchell  <mark@codesourcery.com>

	* config/ia64/hpux.h (TARGET_HAVE_TLS): Define it to false.
	* config/ia64/ia64.h (TARGET_HAVE_TLS): Define it to true if
	HAVE_AS_TLS is true.
	* config/ia64/ia64.c (TARGET_HAVE_TLS): Do not define it.

Index: hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/hpux.h,v
retrieving revision 1.20.2.5
retrieving revision 1.20.2.6
diff -c -5 -p -r1.20.2.5 -r1.20.2.6
*** hpux.h	26 Aug 2003 06:50:30 -0000	1.20.2.5
--- hpux.h	4 Dec 2003 04:47:15 -0000	1.20.2.6
*************** do {								\
*** 186,190 ****
--- 186,194 ----
  #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
  #undef  TARGET_ASM_SELECT_RTX_SECTION
  #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section
  #undef  TARGET_SECTION_TYPE_FLAGS
  #define TARGET_SECTION_TYPE_FLAGS  ia64_rwreloc_section_type_flags
+ 
+ /* HP-UX does not support thread-local storage.  */
+ #undef TARGET_HAVE_TLS
+ #define TARGET_HAVE_TLS false
Index: ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.135.2.5
retrieving revision 1.135.2.6
diff -c -5 -p -r1.135.2.5 -r1.135.2.6
*** ia64.h	8 Aug 2003 22:07:14 -0000	1.135.2.5
--- ia64.h	4 Dec 2003 04:47:17 -0000	1.135.2.6
*************** extern int target_flags;
*** 131,140 ****
--- 131,149 ----
  #define TARGET_INLINE_INT_DIV \
    (target_flags & (MASK_INLINE_INT_DIV_LAT | MASK_INLINE_INT_DIV_THR))
  
  #define TARGET_DWARF2_ASM	(target_flags & MASK_DWARF2_ASM)
  
  extern int ia64_tls_size;
  #define TARGET_TLS14		(ia64_tls_size == 14)
  #define TARGET_TLS22		(ia64_tls_size == 22)
  #define TARGET_TLS64		(ia64_tls_size == 64)
  
Index: ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.198.2.16
retrieving revision 1.198.2.17
diff -c -5 -p -r1.198.2.16 -r1.198.2.17
*** ia64.c	3 Dec 2003 19:58:38 -0000	1.198.2.16
--- ia64.c	4 Dec 2003 04:47:15 -0000	1.198.2.17
*************** static const struct attribute_spec ia64_
*** 278,292 ****
  #undef TARGET_SCHED_REORDER
  #define TARGET_SCHED_REORDER ia64_sched_reorder
  #undef TARGET_SCHED_REORDER2
  #define TARGET_SCHED_REORDER2 ia64_sched_reorder2
  
- #ifdef HAVE_AS_TLS
- #undef TARGET_HAVE_TLS
- #define TARGET_HAVE_TLS true
- #endif
- 
  #undef TARGET_ASM_OUTPUT_MI_THUNK
  #define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk
  #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
  #define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
  
--- 278,287 ----


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