[committed] Fix endless loop in dwarf2out.c (PR debug/49262)

Jakub Jelinek jakub@redhat.com
Mon Jun 6 17:56:00 GMT 2011


Hi!

I forgot to decrement the counter, but given that nobody has hit it
until now it is possible that no frontend leaves RANGE_EXPR indexes in
CONSTRUCTORs around till late.  varasm.c seems to handle them though,
so fixed thusly, committed to trunk as obvious.

2011-06-06  Jakub Jelinek  <jakub@redhat.com>

	PR debug/49262
	* dwarf2out.c (native_encode_initializer): Decrement count in each
	iteration.

--- gcc/dwarf2out.c.jj	2011-06-06 10:30:05.000000000 +0200
+++ gcc/dwarf2out.c	2011-06-06 18:02:28.000000000 +0200
@@ -18065,7 +18065,7 @@ native_encode_initializer (tree init, un
 		{
 		  int count = tree_low_cst (TREE_OPERAND (index, 1), 0)
 			      - tree_low_cst (TREE_OPERAND (index, 0), 0);
-		  while (count > 0)
+		  while (count-- > 0)
 		    {
 		      if (val)
 			memcpy (array + curpos, array + pos, fieldsize);

	Jakub



More information about the Gcc-patches mailing list