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

login
register
mail settings
Submitter Jakub Jelinek
Date June 6, 2011, 5:56 p.m.
Message ID <20110606175603.GW17079@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/98971/
State New
Headers show

Comments

Jakub Jelinek - June 6, 2011, 5:56 p.m.
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.


	Jakub

Patch

--- 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);