tls_referenced_p shouldn't skip subrtxes of CONSTs, since it's supposed to be looking at all SYMBOL_REFs in the pattern. The patched version was what I'd meant to write originally, sorry that it slipped though.
Tested on powerpc64-linux-gnu and applied as obvious. Thanks, Richard gcc/ PR middle-end/63171 * rtlanal.c (tls_referenced_p): Don't skip constant subrtxes. Index: gcc/rtlanal.c =================================================================== --- gcc/rtlanal.c 2014-08-30 15:53:03.372153860 +0100 +++ gcc/rtlanal.c 2014-09-06 10:59:18.545268494 +0100 @@ -6073,7 +6073,7 @@ tls_referenced_p (const_rtx x) return false; subrtx_iterator::array_type array; - FOR_EACH_SUBRTX (iter, array, x, NONCONST) + FOR_EACH_SUBRTX (iter, array, x, ALL) if (GET_CODE (*iter) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (*iter) != 0) return true; return false;