public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/20216] New: Simple loop runs out of stack at -O1
@ 2005-02-26 14:26 fjahanian at apple dot com
  2005-02-26 15:28 ` [Bug tree-optimization/20216] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: fjahanian at apple dot com @ 2005-02-26 14:26 UTC (permalink / raw)
  To: gcc-bugs

Following test case runs out of stack space when
gcc tries to compute factorial (1599999). I have a patch which does two simple things. 1) it rewrites 
tree_fold_factorial
function into its non-recursive version, and 2) it sets a limit before deciding to call chrec_evaluate. This 
limit is arbitrary in this
patch. Author of the algorithm may want to decide when to stop evaluating feasibility of this 
optimization. Note that even with this limit,
the computed factorial overflows. So, even a much smaller limit is needed if this value is significant.

/* bad.c */
static unsigned int *buffer;

void FUNC (void)
{
 unsigned int *base;
 int i, j;

 for (i = 0; i < 4; i++)
  for (j = 0; j < 1600000; j++)
   *base++ = buffer[j];
}

% mygccm5 -c -O1 bad.c
Out of stack space.
Try running 'limit stacksize unlimited' in the shell to raise its limit.

-- 
           Summary: Simple loop runs out of stack at -O1
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fjahanian at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin
  GCC host triplet: powerpc-apple-darwin
GCC target triplet: powerpc-apple-darwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20216


^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <bug-20216-7508@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2007-06-26  1:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-26 14:26 [Bug tree-optimization/20216] New: Simple loop runs out of stack at -O1 fjahanian at apple dot com
2005-02-26 15:28 ` [Bug tree-optimization/20216] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-02-26 16:13 ` fjahanian at apple dot com
2005-02-26 16:25 ` pinskia at gcc dot gnu dot org
2005-02-27  4:32 ` hp at gcc dot gnu dot org
2005-02-27  4:37 ` hp at gcc dot gnu dot org
2005-02-27  8:45 ` dberlin at gcc dot gnu dot org
2005-02-27 13:06 ` fjahanian at apple dot com
2005-02-27 13:21 ` dberlin at dberlin dot org
2005-02-27 21:03 ` pinskia at gcc dot gnu dot org
2005-03-01  2:44 ` cvs-commit at gcc dot gnu dot org
2005-03-01 15:13 ` [Bug tree-optimization/20216] [4.0 " pinskia at gcc dot gnu dot org
2005-03-01 16:23 ` cvs-commit at gcc dot gnu dot org
2005-03-01 16:28 ` cvs-commit at gcc dot gnu dot org
2005-03-01 17:06 ` pinskia at gcc dot gnu dot org
     [not found] <bug-20216-7508@http.gcc.gnu.org/bugzilla/>
2007-06-26  1:18 ` geoffk at gcc dot gnu dot org

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