Re: [Patch] Fix infinite loop/crash if array initializer index equals max value

2013-09-04 Thread Joseph S. Myers
On Wed, 4 Sep 2013, Senthil Kumar Selvaraj wrote: > Reattaching the patch with a testcase for the AVR target. I'm not sure > how to generalize the testcase for other targets - the constant is the > max value (unsigned) of the mode used to represent initialized array > indices. Logically that shou

Re: [Patch] Fix infinite loop/crash if array initializer index equals max value

2013-09-04 Thread Senthil Kumar Selvaraj
On Fri, Aug 23, 2013 at 09:49:55PM +, Joseph S. Myers wrote: > On Thu, 22 Aug 2013, Selvaraj, Senthil_Kumar wrote: > > > 2013-08-23 Senthil Kumar Selvaraj > > * c-typeck.c (output_pending_init_elements): Handle overflow of > > constructor_unfilled_index. > > This patch needs to add

Re: [Patch] Fix infinite loop/crash if array initializer index equals max value

2013-08-23 Thread Joseph S. Myers
On Thu, 22 Aug 2013, Selvaraj, Senthil_Kumar wrote: > 2013-08-23 Senthil Kumar Selvaraj > * c-typeck.c (output_pending_init_elements): Handle overflow of > constructor_unfilled_index. This patch needs to add include a testcase to the testsuite that fails before and passes after th

[Patch] Fix infinite loop/crash if array initializer index equals max value

2013-08-22 Thread Selvaraj, Senthil_Kumar
Hi, This line of code causes gcc for the AVR target to loop for a while and eventually crash after exhausting virtual memory. char x[] = { [0xFF] = 2 }; output_pending_init_elements in gcc/c/c-typeck.c ends up in an infinite loop if elt->purpose is a tree representing an integer const