public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite] fix loop index for gcc.dg/webizer.c
@ 2013-01-15 21:55 Janis Johnson
  2013-01-15 22:02 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Janis Johnson @ 2013-01-15 21:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

Execution of test gcc.dg/webizer.c fails with a segfault for
powerpc-eabi with the GNU simulator.  The test has an array of size 2
and accesses that array with indices of 1 and 2.  This patch fixes the
bounds of the loop index.

Tested on powerpc-none-eabi; OK for trunk?

Janis

[-- Attachment #2: gcc-20130115-2 --]
[-- Type: text/plain, Size: 506 bytes --]

2013-01-15  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.dg/webizer.c: Adjust loop variable.

Index: testsuite/gcc.dg/webizer.c
===================================================================
--- testsuite/gcc.dg/webizer.c	(revision 195216)
+++ testsuite/gcc.dg/webizer.c	(working copy)
@@ -21,7 +21,7 @@
 configure2()
 {
   block = 0 ;
-  for( row = 1 ; row <= numRows ; row++ ) {
+  for( row = 0 ; row < numRows ; row++ ) {
       block++ ;
     if( rowArray[row].endx1 > 0 ) {
       block++ ;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-15 22:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 21:55 [testsuite] fix loop index for gcc.dg/webizer.c Janis Johnson
2013-01-15 22:02 ` Jeff Law
2013-01-15 22:06   ` Janis Johnson
2013-01-15 22:16     ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).