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]

dwarf2out.c rtl checking failure -> assertion failure


I noticed this lack of an assertion while writing
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00015.html but didn't
commit.  Now we have an independent bug report.  I'm applying the
following as obvious to trunk.

	PR rtl-optimization 25197
	* dwarf2out.c (dwarf2out_frame_debug_expr <rule 12>): Assert we
	have a reg.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 107991)
+++ gcc/dwarf2out.c	(working copy)
@@ -1771,11 +1771,12 @@ dwarf2out_frame_debug_expr (rtx expr, co
 	case MINUS:
 	case LO_SUM:
 	  {
 	    int regno;
 
-	    gcc_assert (GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT);
+	    gcc_assert (GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT
+			&& REG_P (XEXP (XEXP (dest, 0), 0)));
 	    offset = INTVAL (XEXP (XEXP (dest, 0), 1));
 	    if (GET_CODE (XEXP (dest, 0)) == MINUS)
 	      offset = -offset;
 
 	    regno = REGNO (XEXP (XEXP (dest, 0), 0));

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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