public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] dwarf2out: Print the name of the unspec as part of the warning
@ 2011-03-21 10:26 Andreas Krebbel
  2011-03-22 21:39 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Krebbel @ 2011-03-21 10:26 UTC (permalink / raw)
  To: gcc-patches

Hi,

with the attached patch dwarf2out tries to print the name of the
unspec together with the numeric value in case the back end uses
define_c_enum for the unspec constants.

Ok for mainline?

Bye,

-Andreas-


2011-03-21  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* dwarf2out.c (const_ok_for_output_1): Print the unspec enum name
	if possible.


Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c.orig
--- gcc/dwarf2out.c
*************** const_ok_for_output_1 (rtx *rtlp, void *
*** 13612,13620 ****
--- 13612,13627 ----
  	inform (current_function_decl
  		? DECL_SOURCE_LOCATION (current_function_decl)
  		: UNKNOWN_LOCATION,
+ #if NUM_UNSPEC_VALUES > 0
+ 		"non-delegitimized UNSPEC %s (%d) found in variable location",
+ 		(XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
+ 		? unspec_strings[XINT (rtl, 1)] : "unkown",
+ 		XINT (rtl, 1));
+ #else
  		"non-delegitimized UNSPEC %d found in variable location",
  		XINT (rtl, 1));
  #endif
+ #endif
        expansion_failed (NULL_TREE, rtl,
  			"UNSPEC hasn't been delegitimized.\n");
        return 1;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dwarf2out: Print the name of the unspec as part of the warning
  2011-03-21 10:26 [PATCH] dwarf2out: Print the name of the unspec as part of the warning Andreas Krebbel
@ 2011-03-22 21:39 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2011-03-22 21:39 UTC (permalink / raw)
  To: Andreas Krebbel; +Cc: gcc-patches

On 03/21/2011 03:26 AM, Andreas Krebbel wrote:
> + 		(XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
> + 		? unspec_strings[XINT (rtl, 1)] : "unkown",
> + 		XINT (rtl, 1));

The parentheses ought to be enclosing the entire ternary expression
for clarity.  Also, typo in "unkown".

Ok with that change.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-22 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21 10:26 [PATCH] dwarf2out: Print the name of the unspec as part of the warning Andreas Krebbel
2011-03-22 21:39 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).