This is the mail archive of the 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: [vta, trunk?] oops, one more: don't crash on ppc64's expr_lists in parallels

On Oct  7, 2008, Alexandre Oliva <> wrote:

> Almost forgot this one, it's needed for -fcompare-debug to pass on
> ppc64.

> rs6000 often uses expr_lists in parallels to represent the location of
> return values and arguments.  GCC insn dumpers often crash dumping
> such insns, because they assume the modes in the EXPR_LISTs must be
> REG_NOTES, and then they try to print the mode name dereferencing an
> array that doesn't cover the whole range.

> I implemented a minimal fix here, just to avoid crashing, printing a
> mode name if the mode of the expr_insn is not in the reg note range.
> I guess it would be possible to remember whether we're within a
> parallel, but I thought it was overkill.

> I'm installing this in the branch.  Ok for trunk?


for  gcc/ChangeLog
from  Alexandre Oliva  <>

	* print_rtl (print_rtx): Don't assume modes in EXPR_LISTs and
	INSN_LISTs must refer to REG_NOTEs.

Index: gcc/print-rtl.c
--- gcc/print-rtl.c.orig	2009-05-28 04:33:03.000000000 -0300
+++ gcc/print-rtl.c	2009-05-28 04:48:30.000000000 -0300
@@ -207,7 +207,9 @@ print_rtx (const_rtx in_rtx)
 	  if (GET_CODE (in_rtx) == EXPR_LIST
 	      || GET_CODE (in_rtx) == INSN_LIST)
 	    fprintf (outfile, ":%s",
-		     GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
+		     (int)GET_MODE (in_rtx) >= REG_NOTE_MAX
+		     ? GET_MODE_NAME (GET_MODE (in_rtx))
+		     : GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
 	  /* For other rtl, print the mode if it's not VOID.  */
 	  else if (GET_MODE (in_rtx) != VOIDmode)
Alexandre Oliva, freedom fighter
You must be the change you wish to see in the world. -- Gandhi
Be Free! --   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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