Re: Using GS for TLS on x86-64 for target RDOS

2013-05-15 Thread Leif Ekblad
I made the suggested changes, and enclose a new patch. 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 It's been tested with target RDOS, but

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-15 Thread Uros Bizjak
On Wed, May 15, 2013 at 9:00 PM, Leif Ekblad l...@rdos.net wrote: I made the suggested changes, and enclose a new patch. ... It's been tested with target RDOS, but not with target Linux. Uros, could you commit the patch if it is acceptable? I have committed attached patch with following

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-14 Thread Uros Bizjak
Hello! I would need a way to use GS segment register instead of FS for x86-64 for target RDOS since RDOS cannot use FS for TLS. It seems like the code related to this is concentrated to two different places: Especially the second reference would become hard-to-read if more conditionals

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-14 Thread Michael Matz
Hi, On Tue, 14 May 2013, Uros Bizjak wrote: I'd propose to introduce: a) #define DEFAULT_TLS_SEG_REG in i386.h to SEG_GS b) #undef and #define DEFAULT_TLS_SEG_REG in x86-64.h to SEG_FS This would break -m32. c) #undef and #define DEFAULT_TLS_SEG_REG in rdos.h to SEG_GS Then use

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-14 Thread Uros Bizjak
On Tue, May 14, 2013 at 11:13 AM, Michael Matz m...@suse.de wrote: On Tue, 14 May 2013, Uros Bizjak wrote: I'd propose to introduce: a) #define DEFAULT_TLS_SEG_REG in i386.h to SEG_GS b) #undef and #define DEFAULT_TLS_SEG_REG in x86-64.h to SEG_FS This would break -m32. Uh, yes. So

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-14 Thread Leif Ekblad
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 Regards, Leif Ekblad - Original Message

Re: Using GS for TLS on x86-64 for target RDOS

2013-05-14 Thread Uros Bizjak
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

Using GS for TLS on x86-64 for target RDOS

2013-05-13 Thread Leif Ekblad
I would need a way to use GS segment register instead of FS for x86-64 for target RDOS since RDOS cannot use FS for TLS. It seems like the code related to this is concentrated to two different places: The gcc/config/i386/i386.c: 11677:seg = TARGET_64BIT ? SEG_FS : SEG_GS;