[llvm-commits] [cfe-commits] [PATCH][Review Request] EarlyCSE stack overflow - bugzilla 11794
Lenny Maiorani
lenny at Colorado.EDU
Wed Jan 18 13:57:13 PST 2012
On Jan 18, 2012, at 2:34 PM, Eli Friedman wrote:
> On Wed, Jan 18, 2012 at 1:25 PM, Lenny Maiorani <lenny at colorado.edu> wrote:
>> Hi,
>>
>> I found a stack overflow in EarlyCSE caused by recursion when provided a very large function. More information in bugzilla - http://llvm.org/bugs/show_bug.cgi?id=11794
>>
>> Attached is a patch. Please review and I will commit once it is approved.
>>
>> The patch simply changes the algorithm from being a recursive pre-order depth-first traversal to the same traversal, but using a list as a stack of nodes to process.
>
> The idea looks like it's in the right direction. We generally try to avoid
> std::list in LLVM; see
> http://llvm.org/docs/ProgrammersManual.html#ds_sequential .
>
> In the future, please don't send patches that don't touch
> clang-specific code to cfe-commits.
>
> -Eli
Hi Eli,
The reason I chose to use std::list here is that it supports splice. Perhaps a std::stack implementation is preferred here?
Attached is a patch implementing that...
-Lenny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: earlycse-stack.diff
Type: application/octet-stream
Size: 2276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/068df332/attachment.obj>
-------------- next part --------------
More information about the llvm-commits
mailing list