public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/10349: sparc64-sun-solaris2.7 testsuite failure in g++.dg/parse/stack1.C
@ 2003-04-08 15:56 ghazi
  0 siblings, 0 replies; only message in thread
From: ghazi @ 2003-04-08 15:56 UTC (permalink / raw)
  To: gcc-gnats; +Cc: rth, davem, jakub


>Number:         10349
>Category:       target
>Synopsis:       sparc64-sun-solaris2.7 testsuite failure in g++.dg/parse/stack1.C
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 08 15:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Kaveh Ghazi
>Release:        gcc version 3.3 20030408 (prerelease)
>Organization:
>Environment:
sparc64-sun-solaris2.7
>Description:
As noted here:
http://gcc.gnu.org/ml/gcc-testresults/2003-04/msg00483.html
I'm getting testsuite failures in gcc-3.3 on sparc64-sun-solaris2.7 for g++.dg/parse/stack1.C.

The compiler crashes with a segmentation fault compiling the testcase.  After some investigation I determined that the problem is that it is running out of stack space.

Solaris2.7 (and 2.8) seem to come configured with stacksize set to 8192K.  When I raise it to 16384K the testcase compiles.  That seems like an excessively large amount of stack space consumption, given that the regular v7 sparc compiles it in as low as 2048K stack.  

It's not affected by the GC tuning parameters, i.e. large and small RAM systems get the same crash at stacksize 8192K.

A fix for the original problem was applied (see PR2161) but I'm getting failures in this configuration.

>How-To-Repeat:
The original PR fix involved bison to some degree.  I'm using bison 1.75 if that matters.  

I cannot get the testcase to fail in a 32->64 cross compiler.  A native sparc64-sun-solaris2.7 build with stacksize set to 8192 (the default I believe on solaris2.7) seems to be required.  You might be able to get it to fail on other sparc64 platforms with limited stacksize, I can't say for sure.

Simply compile stack1.C with -S and note the compiler crash.  Change stacksize to 16384K and it succeeds.

/* PR c/2161: parser stack overflow.  */
/* { dg-do compile } */

#define ONE     else if (0) { }
#define TEN     ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
#define HUN     TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
#define THOU    HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN

void foo()
{
  if (0) { }
  /* 11,000 else if's.  */
  THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-08 15:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 15:56 target/10349: sparc64-sun-solaris2.7 testsuite failure in g++.dg/parse/stack1.C ghazi

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