Don't inform about non-delegitimized TLS UNSPECs (PR target/45870)

Submitted by Jakub Jelinek on Nov. 18, 2010, 8:47 p.m.

Details

Message ID 20101118204756.GD29412@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 18, 2010, 8:47 p.m.
Hi!

While (at least on some targets) we try hard to delegitimize various
UNSPECS, including LE TLS UNSPECs, still other kinds of UNSPECs in some
cases can't be delegitimized.  While this is just an --enable-checking=yes
annoyance, people are reporting this and it sometimes breaks some tests
because of the unexpected diagnostics, I think it is best just not to
warn about TLS UNSPECs and only require that targets delegitimize other
UNPSECs that can ever make it into the dwarf2out code.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2010-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR target/45870
	* dwarf2out.c (const_ok_for_output_1): Don't complain about
	non-delegitimized TLS UNSPECs.


	Jakub

Comments

Richard Henderson Nov. 18, 2010, 11:48 p.m.
On 11/18/2010 12:47 PM, Jakub Jelinek wrote:
> +      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))))
> +	/* Don't complain about TLS UNSPECs, those are just too hard to
> +	   delegitimize.  */
> +	inform (current_function_decl
> +		? DECL_SOURCE_LOCATION (current_function_decl)
> +		: UNKNOWN_LOCATION,
> +		"non-delegitimized UNSPEC %d found in variable location",
> +		XINT (rtl, 1));

Ok, but put the comment before the IF.


r~

Patch hide | download patch | download mbox

--- gcc/dwarf2out.c.jj	2010-11-18 13:45:10.000000000 +0100
+++ gcc/dwarf2out.c	2010-11-18 19:42:08.032404913 +0100
@@ -13494,11 +13494,18 @@  const_ok_for_output_1 (rtx *rtlp, void *
       /* 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));
+      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))))
+	/* Don't complain about TLS UNSPECs, those are just too hard to
+	   delegitimize.  */
+	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");