On Tue, May 14, 2013 at 6:45 PM, Leif Ekblad <l...@rdos.net> wrote:
> I've made a patch along these lines  (enclosed).
>
> Change log:
> * gcc/config/i386/i386.c: Use DEFAULT_TLS_SEG_REG to access TLS
> * gcc/config/i386/i386.h: Define default segment register for TLS
> * gcc/config/i386/rdos.h: Added TLS configuration for RDOS

*** gcc-4.9-20130512/gcc/config/i386/i386.h    2013-04-29
13:00:10.000000000 +0200
--- gcc-work/gcc/config/i386/i386.h    2013-05-14 13:36:19.041020400 +0200

+ /* The default TLS segment register used by target.  */
+ #define DEFAULT_TLS_SEG_REG TARGET_64BIT ? SEG_FS : SEG_GS

Precedence is a bit tricky with "?" ternary operand. Please put the
expression in braces...

*** gcc-4.9-20130512/gcc/config/i386/i386.c    2013-05-06
16:53:03.000000000 +0200
--- gcc-work/gcc/config/i386/i386.c    2013-05-14 13:37:14.338020400 +0200

!       || addr.seg != (DEFAULT_TLS_SEG_REG)

... and remove them there.

*** gcc-4.9-20130512/gcc/config/i386/rdos.h    2013-01-28
21:42:55.000000000 +0100
--- gcc-work/gcc/config/i386/rdos.h    2013-05-14 13:36:17.940020400 +0200

+ #undef TARGET_TLS_DIRECT_SEG_REFS
+ #define TARGET_TLS_DIRECT_SEG_REFS 1

TARGET_TLS_DIRECT_SEG_REFS_DEFAULT

! #define TARGET_OS_CPP_BUILTINS()                \
!   do                                            \
!     {                                           \
!       builtin_define ("__RDOS__");              \
!       builtin_assert ("system=rdos");           \
!     }                                           \

This looks like unwanted change to me.

The patch is OK for mainline with above changes, if tested on x86_64-linux-gnu.

Thanks,
Uros.

Reply via email to