struct S { int x[10]; }; extern __thread struct S s; int *foo() { return &s.x[2]; }
$ ./cc1 -quiet -O2 -fPIC zz.c zz.c: In function ‘foo’: zz.c:3: internal compiler error: Segmentation fault It looks like rs6000_emit_move is only prepared for a tls symbol_ref, and not a (const (plus (symbol_ref) (const_int))). -- Summary: [PowerPC] ICE loading TLS address Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: powerpc*-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21412