http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55889
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-21
12:53:09 UTC ---
I've tried to reproduce this with a cross compiler (without cross binutils) on
x86_64-linux host, but it ICEs elsewhere:
../configure --target powerpc-ibm-aix5.3.1 --disable-bootstrap
--enable-languages=c
make
cd gcc
sed -i -e 's/^.*HAVE_AS_TLS.*$/#define HAVE_AS_TLS 1/' auto-host.h
make cc1
./cc1 -O -fschedule-insns -fselective-scheduling -fpic -fprofile-generate
pr50907.c -maix32
But this ICEs in:
#0 0x0000000000cca50b in get_pool_constant (addr=0x7ffff1aa7ee0) at
../../gcc/varasm.c:3631
#1 0x0000000000ce285c in rs6000_delegitimize_address (orig_x=0x7ffff1a7aa20)
at ../../gcc/config/rs6000/rs6000.c:5834
#2 0x0000000000a04b0e in avoid_constant_pool_reference (x=0x7ffff1a7aa38) at
../../gcc/simplify-rtx.c:220
#3 0x0000000000e7c211 in equiv_constant (x=0x7ffff1a7aa38) at
../../gcc/cse.c:3797
#4 0x0000000000e7a811 in fold_rtx (x=0x7ffff1a7aa38, insn=0x7ffff1aa6750) at
../../gcc/cse.c:3122
#5 0x0000000000e7dd3c in cse_insn (insn=0x7ffff1aa6750) at
../../gcc/cse.c:4573
#6 0x0000000000e833f1 in cse_extended_basic_block (ebb_data=0x7fffffffdf40) at
../../gcc/cse.c:6405
#7 0x0000000000e83990 in cse_main (f=0x7ffff1a89200, nregs=190) at
../../gcc/cse.c:6583
#8 0x0000000000e8569c in rest_of_handle_cse () at ../../gcc/cse.c:7433
on (symbol_ref:SI ("*LCM..0") [flags 0x2]) (note, not CONSTANT_POOL_ADDRESS_P)
created by
rs6000_legitimize_tls_address_aix:
5955 rtx modaddr = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (tlsname));
5956 SYMBOL_REF_FLAGS (modaddr) |= SYMBOL_FLAG_LOCAL;
and the ICE is on:
5830 #ifdef HAVE_AS_TLS
5831 /* Do not associate thread-local symbols with the original
5832 constant pool symbol. */
5833 if (TARGET_XCOFF
5834 && SYMBOL_REF_TLS_MODEL (get_pool_constant (y)) >=
TLS_MODEL_REAL)
5835 return orig_x;
5836 #endif
orig_x is
(unspec:SI [
(symbol_ref:SI ("*LCM..0") [flags 0x2])
(reg:SI 2 2)
] UNSPEC_TOCREL)
Am I missing something here? Why does it assume that y is a
CONSTANT_POOL_ADDRESS_P SYMBOL_REF?
Alternatively, can you please attach auto-host.h, perhaps there is something I
need to tweak further to reproduce.