[LLVMbugs] [Bug 1745] New: Variable-sized allocation in loop blows out stack

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Oct 26 14:26:27 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1745

           Summary: Variable-sized allocation in loop blows out stack
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dalej at apple.com
                CC: llvmbugs at cs.uiuc.edu


OK, let's try this again.  The following (reduced from a gcc test) repeatedly
allocates a variable-sized object.  The intent is that each should be
deallocated before the next is allocated, to avoid blowing out the stack. 
llvm-gcc generates code to do this, but the optimizer decides the deallocation
can be deleted (fails with -O2).

I can't get it to fail with any of the standard looping constructs, which
diminishes the importance considerably IMO.  

void *volatile p;
int main (void)
{
  int n = 0;
 lab:;
  int x[n % 47 + 1];
  x[0] = 1;
  p = x;
  if (++n < 1000000)
    goto lab;
  return 0;
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list