[llvm-bugs] [Bug 30229] Clang generates stacksave/stackrestore incorrectly when a loop has VLA and alloca

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 1 07:37:32 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30229

Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |rnk at google.com
         Resolution|---                         |DUPLICATE

--- Comment #1 from Reid Kleckner <rnk at google.com> ---
This is a well-known issue that's basically infeasible to fix without seriously
violating user expectations in some way.

GCC's new behavior also seems surprising, and could easily lead to stack
overflow in your example.

The other way to fix this it to have alloca call malloc behind the scenes in
this situation. However, oftentimes users are using alloca because they are
trying to avoid malloc for async signal safety reasons.

If you don't mind, I'm going to dupe against the old bug. What's new is that
GCC has decided to make this code work.

*** This bug has been marked as a duplicate of bug 16099 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160901/1295910a/attachment.html>


More information about the llvm-bugs mailing list