On Mon, Dec 10, 2012 at 7:32 PM, Steve Ellcey <sell...@mips.com> wrote: > The tests gcc.dg/torture/pr35634.c and g++.dg/torture/pr35634.C fail for > me on the mips-mti-elf target. At first I thought it was because 'n' > was not initialized but then I realized it was because 'char' on this > target defaults to 'unsigned char', not 'signed char'. Since I think > initializing 'n' is still a good idea I made that change as well as making > 'c' an explicitly signed char. This now passes on mips-mti-elf.
statics are zero-initialized according to C89. > OK for checkin? Ok minus the initialization. Thanks, Richard. > Steve Ellcey > sell...@mips.com > > > 2012-12-10 Steve Ellcey <sell...@mips.com> > > * gcc.dg/torture/pr35634.c: Initialize n, make c signed. > * g++.dg/torgure/pr35634.C: Ditto. > > diff --git a/gcc/testsuite/g++.dg/torture/pr35634.C > b/gcc/testsuite/g++.dg/torture/pr35634.C > index 00848e3..1f03bb1 100644 > --- a/gcc/testsuite/g++.dg/torture/pr35634.C > +++ b/gcc/testsuite/g++.dg/torture/pr35634.C > @@ -5,7 +5,7 @@ extern "C" void exit (int); > > void foo (int i) > { > - static int n; > + static int n = 0; > if (i < -128 || i > 127) > abort (); > if (++n > 1000) > @@ -14,6 +14,6 @@ void foo (int i) > > int main () > { > - char c; > + signed char c; > for (c = 0; ; c++) foo (c); > } > diff --git a/gcc/testsuite/gcc.dg/torture/pr35634.c > b/gcc/testsuite/gcc.dg/torture/pr35634.c > index 32df7d4..f8876a4 100644 > --- a/gcc/testsuite/gcc.dg/torture/pr35634.c > +++ b/gcc/testsuite/gcc.dg/torture/pr35634.c > @@ -5,7 +5,7 @@ void exit (int); > > void foo (int i) > { > - static int n; > + static int n = 0; > if (i < -128 || i > 127) > abort (); > if (++n > 1000) > @@ -14,6 +14,6 @@ void foo (int i) > > int main () > { > - char c; > + signed char c; > for (c = 0; ; c++) foo (c); > }