On Thu, 2021-03-25 at 14:52 +0530, Saloni Garg via Gcc wrote: > Hi all, > I am an undergraduate student in AMU, Aligarh. I am interested in the > project* `Extend the static analysis pass`. *I have followed this( > https://gcc.gnu.org/pipermail/gcc/2021-March/234941.html) and been > able to > successfully build and successfully ran and pass the test suite for C > and > C++. > > I found this sub-project `C++ support (new/delete checking, > exceptions, > etc)` interesting and may be the conservative code for this can be > made > along the lines of malloc/free implementation in C. I found here( > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94355) that some part of > it > has already been implemented . I would like to expand it further and > learn > about it, maybe start with writing some test cases, please let me > know. > > Further, I am inclined on this( > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97111). Let me know if > it is > still available. > > Looking forward to hearing from you guys. > Thanks, > Saloni Garg
Hi! I'm the author/maintainer of the static analysis pass, and would be the mentor for any GSoC project(s) involving it. I've already implemented most of the new/delete checking in GCC 11; the big missing component there is exception-handling. Implementing exception-handling in the analyzer could make a good GSoC project: it's non-trivial, but hopefully doable in one summer. I see you've already seen bug 97111, and there are some links in that bug to resources. Given that the analyzer runs on the gimple-ssa representation, by the time it sees the code, much of the exception- handling has already been translated into calls to various __cxa_- prefixed functions in the C++ runtime, so part of the work would involve "teaching" the analyzer about those functions. One way to make a start on this would be to create a collection of trivial C++ examples that use exceptions, and then look at analyzer dumps to see what IR is being "seen" by the analyzer for the various constructs. (I actually started this a long time ago and have a very crude barely-working prototype, but it was just the start, and I've forgotten almost all of it...) Hope this is helpful Dave