Bug 47403 - [x32] TLS doesn't work
Summary: [x32] TLS doesn't work
Status: RESOLVED DUPLICATE of bug 47715
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-21 17:25 UTC by H.J. Lu
Modified: 2011-02-25 21:23 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-01-21 17:25:00 UTC
[hjl@gnu-6 ilp32-15]$ cat x.c
extern __thread int __libc_errno __attribute__ ((tls_model ("initial-exec")));
;
int *
__errno_location (void)
{
  return &__libc_errno;
}
[hjl@gnu-6 ilp32-15]$ make
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -o x.s -mx32 -O2 -dp  x.c
x.c: In function ‘__errno_location’:
x.c:7:1: error: unrecognizable insn:
(insn 8 7 9 3 (set (reg:SI 59 [ <retval> ])
        (reg:DI 63)) x.c:5 -1
     (expr_list:REG_EQUAL (symbol_ref:SI ("__libc_errno") [flags 0x60] <var_decl 0x7f7cc21c8000 __libc_errno>)
        (nil)))
x.c:7:1: internal compiler error: in extract_insn, at recog.c:2109
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [x.s] Error 1
[hjl@gnu-6 ilp32-15]$
Comment 1 hjl@gcc.gnu.org 2011-01-21 18:05:59 UTC
Author: hjl
Date: Fri Jan 21 18:05:55 2011
New Revision: 169097

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169097
Log:
Call convert_to_mode on legitimize_tls_address retuen if needed.

gcc/

2011-01-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/47403
	* config/i386/i386.c (ix86_expand_move): Call convert_to_mode
	on legitimize_tls_address retuen if needed.

gcc/testsuite/

2011-01-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/47403
	* gcc.target/i386/pr47403-1.c: New.

Added:
    branches/x32/gcc/testsuite/gcc.target/i386/pr47403-1.c
Modified:
    branches/x32/gcc/ChangeLog.x32
    branches/x32/gcc/config/i386/i386.c
    branches/x32/gcc/testsuite/ChangeLog.x32
Comment 2 H.J. Lu 2011-02-25 21:23:10 UTC
Dup.

*** This bug has been marked as a duplicate of bug 47715 ***