[LLVMbugs] [Bug 691] NEW: llvm-gcc should save and restore the stack around C99 VLA's

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 12 18:07:14 PST 2006


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=691

           Summary: llvm-gcc should save and restore the stack around C99
                    VLA's
           Product: tools
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


Code like this is currently miscompiled:

  for (i = 0; i != 1000000; ++i) {
      int X[n];
      foo(X);
    }

Each alloca for X consumes more and more stack space.  This should run in a constant sized stack.  The 
front-end needs to emit llvm.stacksave/llvm.stackrestore intrinsics for the scope.

This is implemented by the new front-end.

-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list