This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
dwarf2out.c rtl checking failure -> assertion failure
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 3 Dec 2005 14:56:08 +1030
- Subject: 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