This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: trivial print-rtl fix


On Thu, Sep 10, 2009 at 02:49:16PM -0700, Richard Henderson wrote:
> Self-explanitory.

> commit 4ae4dd43507ea5b9a5d277bc5b344851539c2319
> Author: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
> Date:   Thu Sep 10 21:46:31 2009 +0000
> 
>     * print-rtl.c (print_rtx): Fix JUMP_LABEL index.
>     
> diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
> index cb09597..7652cf6 100644
> --- a/gcc/print-rtl.c
> +++ b/gcc/print-rtl.c
> @@ -305,7 +305,7 @@ print_rtx (const_rtx in_rtx)
>  		break;
>  	      }
>  	  }
> -	else if (i == 9 && JUMP_P (in_rtx) && XEXP (in_rtx, i) != NULL)
> +	else if (i == 8 && JUMP_P (in_rtx) && XEXP (in_rtx, i) != NULL)
>  	  /* Output the JUMP_LABEL reference.  */
>  	  fprintf (outfile, "\n -> %d", INSN_UID (XEXP (in_rtx, i)));
>  	else if (i == 0 && GET_CODE (in_rtx) == VALUE)

Unfortunately this patch broke --enable-checking=yes,rtl bootstraps:
XEXP verifies that the field is 'e', but in this case it is '0'.
Fixed thusly, bootstrapped/regtested with --enable-checking=yes,rtl
on x86_64-linux and i686-linux.  Ok for trunk?

2009-09-11  Jakub Jelinek  <jakub@redhat.com>

	* print-rtl.c (print_rtx): Use JUMP_LABEL (in_rtx) instead of
	XEXP (in_rtx, 8).

--- gcc/print-rtl.c.jj	2009-09-11 11:10:43.000000000 +0200
+++ gcc/print-rtl.c	2009-09-11 19:41:21.000000000 +0200
@@ -305,9 +305,9 @@ print_rtx (const_rtx in_rtx)
 		break;
 	      }
 	  }
-	else if (i == 8 && JUMP_P (in_rtx) && XEXP (in_rtx, i) != NULL)
+	else if (i == 8 && JUMP_P (in_rtx) && JUMP_LABEL (in_rtx) != NULL)
 	  /* Output the JUMP_LABEL reference.  */
-	  fprintf (outfile, "\n -> %d", INSN_UID (XEXP (in_rtx, i)));
+	  fprintf (outfile, "\n -> %d", INSN_UID (JUMP_LABEL (in_rtx)));
 	else if (i == 0 && GET_CODE (in_rtx) == VALUE)
 	  {
 #ifndef GENERATOR_FILE


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]