Patchwork [PR,50826,DF] no debug temps for artificial uses

login
register
mail settings
Submitter Alexandre Oliva
Date April 9, 2012, 6:29 a.m.
Message ID <orobr1e7v2.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/151407/
State New
Headers show

Comments

Alexandre Oliva - April 9, 2012, 6:29 a.m.
This patch is a small improvement to DF, for an issue I noticed while
investigating PR 50826.  We take note of, and may emit debug temps for,
REGs for which we won't emit REG_DEAD/REG_UNUSED notes.  This is a
waste, removed with this patch.

Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok to install?
Jakub Jelinek - April 9, 2012, 10:57 a.m.
On Mon, Apr 09, 2012 at 03:29:05AM -0300, Alexandre Oliva wrote:
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
> 	PR debug/50826
> 	* df-problems.c (df_note_bb_compute): Do not take note of
> 	debug uses for whose REGs we won't emit DEAD or UNUSED notes.

> Index: gcc/df-problems.c
> ===================================================================
> --- gcc/df-problems.c.orig	2012-04-08 01:50:45.379141149 -0300
> +++ gcc/df-problems.c	2012-04-08 02:05:13.406574358 -0300
> @@ -3528,7 +3528,12 @@ df_note_bb_compute (unsigned int bb_inde
>  		{
>  		  if (debug_insn > 0)
>  		    {
> -		      dead_debug_add (&debug, use, uregno);
> +		      /* We won't add REG_UNUSED or REG_DEAD notes for
> +			 these, so we don't have to mess with them in
> +			 debug insns either.  */
> +		      if (!bitmap_bit_p (artificial_uses, uregno)
> +			  && (!df_ignore_stack_reg (uregno)))

Please remove the extra () around this line,
			  && !df_ignore_stack_reg (uregno))
will be more readable.

> +			dead_debug_add (&debug, use, uregno);
>  		      continue;
>  		    }
>  		  break;

Ok for trunk with that change, thanks.

	Jakub

Patch

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/50826
	* df-problems.c (df_note_bb_compute): Do not take note of
	debug uses for whose REGs we won't emit DEAD or UNUSED notes.
	
Index: gcc/df-problems.c
===================================================================
--- gcc/df-problems.c.orig	2012-04-08 01:50:45.379141149 -0300
+++ gcc/df-problems.c	2012-04-08 02:05:13.406574358 -0300
@@ -3528,7 +3528,12 @@  df_note_bb_compute (unsigned int bb_inde
 		{
 		  if (debug_insn > 0)
 		    {
-		      dead_debug_add (&debug, use, uregno);
+		      /* We won't add REG_UNUSED or REG_DEAD notes for
+			 these, so we don't have to mess with them in
+			 debug insns either.  */
+		      if (!bitmap_bit_p (artificial_uses, uregno)
+			  && (!df_ignore_stack_reg (uregno)))
+			dead_debug_add (&debug, use, uregno);
 		      continue;
 		    }
 		  break;