diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2016390b60e5..66ca88442eec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 Jack Howarth Ian Lance Taylor diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ea3852e172f4..3285dacdc6f1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -13503,11 +13503,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");