From: Jakub Jelinek Date: Tue, 7 Dec 2010 15:12:45 +0000 (+0100) Subject: backport: re PR target/45870 (note: non-delegitimized UNSPEC 5 found (-O1 -g)) X-Git-Tag: releases/gcc-4.5.2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73c4c7b85da05ffc21e2ecd8a7fc7a860a38a910;p=thirdparty%2Fgcc.git backport: re PR target/45870 (note: non-delegitimized UNSPEC 5 found (-O1 -g)) Backport from mainline 2010-11-19 Jakub Jelinek PR target/45870 * dwarf2out.c (const_ok_for_output_1): Don't complain about non-delegitimized TLS UNSPECs. From-SVN: r167541 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aac24f2a97f3..838677795a0c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2010-12-07 Jakub Jelinek Backport from mainline + 2010-11-19 Jakub Jelinek + + PR target/45870 + * dwarf2out.c (const_ok_for_output_1): Don't complain about + non-delegitimized TLS UNSPECs. + 2010-11-18 Jakub Jelinek PR middle-end/46534 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 802ba3d6d37c..2df1bd6aa9a3 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12888,11 +12888,18 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED) /* If delegitimize_address couldn't do anything with the UNSPEC, assume we can't express it in the debug info. */ #ifdef ENABLE_CHECKING - inform (current_function_decl - ? DECL_SOURCE_LOCATION (current_function_decl) - : UNKNOWN_LOCATION, - "non-delegitimized UNSPEC %d found in variable location", - XINT (rtl, 1)); + /* Don't complain about TLS UNSPECs, those are just too hard to + delegitimize. */ + if (XVECLEN (rtl, 0) != 1 + || GET_CODE (XVECEXP (rtl, 0, 0)) != SYMBOL_REF + || SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0)) == NULL + || TREE_CODE (SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0))) != VAR_DECL + || !DECL_THREAD_LOCAL_P (SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0)))) + inform (current_function_decl + ? DECL_SOURCE_LOCATION (current_function_decl) + : UNKNOWN_LOCATION, + "non-delegitimized UNSPEC %d found in variable location", + XINT (rtl, 1)); #endif expansion_failed (NULL_TREE, rtl, "UNSPEC hasn't been delegitimized.\n");