[GSoC] Interest in project ideas and request for a small patch

2023-03-15 Thread Benjamin Priour via Gcc
Hi, I'm Benjamin and I have been looking around the mail list and the code base since last December, where I had to write a simple Deca compiler within a month as a team. Next paragraph is me introducing myself -ranting really- for too long. I am from France, in my Computer science master's first

Re: [GSoC] Discussion of warnings and of a first patch (name-hiding)

2023-03-22 Thread Benjamin Priour via Gcc
Hi Jason, Sorry for the delayed answer, I was in my exam period! I've almost finished the patch (PR12341 ), and wrote a testcase to compare it against. In it I use dejaGNU instructions of the format: /* { dg-warning "'C::bbb' might shadow 'B::b

[GSoC] A bunch of questions about sm-malloc behavior, and proposition of a GSoC subject.

2023-03-29 Thread Benjamin Priour via Gcc
Hi David, I've been playing around with sm-malloc on C++ samples. I've noticed double delete don't go under -Wanalyzer-double-free but within -Wanalyzer-use-after-free scope. With the reproducer ... > struct A {}; > > int main() { > A* a = new A(); > delete a; > delete a; > return

[GSoC][analyzer-c++] Enable enough C++ support for self-analysis

2023-03-31 Thread Benjamin Priour via Gcc
Hi David, On Thu, Mar 30, 2023 at 2:04 AM David Malcolm wrote: > Note that the analyzer doesn't properly work yet on C++; see: > https://gcc.gnu.org/bugzilla/showdependencytree.cgi?id=97110 > I'm hoping to address much of this in GCC 14. > > Other notes inline below... > > I'm guessing that t

Re: [GSoC][analyzer-c++] Submission of a draft proposal

2023-04-03 Thread Benjamin Priour via Gcc
Hi David, On Mon, Apr 3, 2023 at 12:38 AM David Malcolm wrote: > > To be fair, C ones can be as well; the analyzer's exploded graphs tend > to get very big on anything but the most trivial examples. > > > [...snip...] > > Indeed - you'll have to do a lot of looking at gimple IR dumps, what > t

Re: [GSoC][analyzer-c++] Submission of a draft proposal

2023-04-03 Thread Benjamin Priour via Gcc
Following last mail, a classic I forgot to link my draft ! https://docs.google.com/document/d/1MaLDo-Rt8yrJIvC1MO8SmFc6fp4eRQM_JeSdv-1kbsc/edit?usp=sharing Best, Benjamin. On Mon, Apr 3, 2023 at 6:44 PM Benjamin Priour wrote: > Hi David, > > On Mon, Apr 3, 2023 at 12:38 AM David Malcolm wrote:

-Wanalyzer-use-of-uninitialized-value always shadows -Wanalyzer-out-of-bounds

2023-04-05 Thread Benjamin Priour via Gcc
Hi David, I used the below code snippet to experiment with out-of-bounds (OOB) on trunk. Three things occurred that I believe could see some improvement. See https://godbolt.org/z/57n459cEs for the warnings. int consecutive_oob_in_frame () { int arr[] = {1,2,3,4,5,6,7}; int y1 = arr[9]; /

Re: -Wanalyzer-use-of-uninitialized-value always shadows -Wanalyzer-out-of-bounds

2023-04-06 Thread Benjamin Priour via Gcc
Hi David, I haven't yet looked into your suggestions, probably won't have time until tomorrow actually :/ Still, here are some updates On Thu, Apr 6, 2023 at 2:32 AM David Malcolm wrote: > On Wed, 2023-04-05 at 19:50 +0200, Benjamin Priour wrote: > > Hi David, > > > > I used the below code snipp

PR109439 - Terminate analysis path when OOB detected

2023-05-01 Thread Benjamin Priour via Gcc
Hi David, Sorry for not being active these past two weeks I've been overwhelmed at my university with creating a new club and other uni stuff. I just went back to solving these 3 bugs we discussed last time. PR109439

Testing a patch

2023-05-29 Thread Benjamin Priour via Gcc
Hi, Regstrapping finally done for PR109439 - Spurious -Wanalyzer-use-of-uninitialized-value tagging along -Wanalyzer-out-of-bounds. Now only a OOB warning is reported when necessary instead of OOB + Use of uninitialized value. Some tests in analyzer (out-of-bounds-*, realloc-5, pr101962) were che

Moving analyzer tests to c-c++-common

2023-06-06 Thread Benjamin Priour via Gcc
Hi David, Sorry I didn't answer you earlier, I was busy concluding my term. Finally finished yesterday, I now have 100% of my time for GCC. I build yesterday the analyzer with -fanalyzer enabled. Globally there are not many coherent warnings, and a common issue are the thesis-long warnings. Below

An overview of the analyzer support of the operator new

2023-06-07 Thread Benjamin Priour via Gcc
Hi, I've been mapping where the analyzer is lacking support of the operator new different variants. I've written a bunch of test cases already to demonstrate it, you can find them below. They are not yet formatted for a patch submission, and as some of them may require new warnings, I didn't use d

Re: Inquiry about Getting Started with GCC Projects as a Beginner

2023-06-30 Thread Benjamin Priour via Gcc
Hi, I am a current GSoC student on GCC, so I'll let some of your questions to more veteran contributors. However, feel free to also reach out to me if you got any questions as to where to start, as I consider myself just out of this phase. Programming Languages: Which programming languages are co

analyzer: New state machine should be C++ only

2023-07-12 Thread Benjamin Priour via Gcc
Hi David, Lately I've been working on adding a new state machine to keep track of ownership transfers and misuses, e.g. to warn about use-after-move, partial or shallow copy/move. I'm trying to stay abstracted from heap allocated regions, and to rather work with "resources", so that the state

Re: analyzer: New state machine should be C++ only

2023-07-13 Thread Benjamin Priour via Gcc
Hi, On 13/07/2023 10:48, David Malcolm wrote: (apologies for top-posting; I'm on vacation and don't have my usual email setup) Sounds interesting, but I'm having difficulty imagining exactly what you have in mind. Can you post one or more concrete examples of buggy code that would be caught by s

analyzer: Weekly update and questions on extending c++ support.

2023-07-31 Thread Benjamin Priour via Gcc
Hi David, (subject's line totally stolen inspired from Eric's) Last week as you know had some special circumstances therefore not much has been done. I've changed my in-progress patch about trimming the system headers event to fit your suggestions from https://gcc.gnu.org/pipermail/gcc-patches/20

analyzer: Weekly update on extending C++ support (2)

2023-08-07 Thread Benjamin Priour via Gcc
Hi Dave, I made some more progress on moving tests from gcc.dg/analyzer/ to c-c++-common/analyzer. I'll only detail the most noteworthy tests I encountered. gcc.dg/analyzer/pr103892.c troubled me with an Excess error when compiled with g++ analysis bailed out early (91 'after-snode' enodes; 314 e

analyzer: How to recognize builtins

2023-08-23 Thread Benjamin Priour via Gcc
Hi David, A quick update on transitioning the analyzer tests from gcc.dg to c-c++-common. As discussed previously, C builtins are not C++ builtins, therefore I had to add recognition of the builtins by their name rather than with the predicate fndecl_built_in_p. Do you know why this happens? I s

Re: How can I run xg++ from its build location?

2023-08-26 Thread Benjamin Priour via Gcc
Hi, If you further have issues with loading required libraries, you could try running a test intended for g++ (make check-c++ from under BUILDDIR/gcc/) You may find examples at https://gcc-newbies-guide.readthedocs.io/en/latest/working-with-the-testsuite.html#running-just-one-test-or-just-a-few

analyzer: Weekly update on extending C++ support (3)

2023-08-26 Thread Benjamin Priour via Gcc
Hi David, Sorry I missed out on your answer about the operator new patch on the IRC. Should I submit the first bit of the operator new patch ? Putting aside for now fixing the "uninitialized value" that accompanies "null deref" of nothrow new variants ? About generalizing tests to C++, I'll soon

Re: analyzer: Weekly update on extending C++ support (3)

2023-08-28 Thread Benjamin Priour via Gcc
Hi, Test gcc.dg/analyzer/pr94362-1.c actually has an additional null_deref > warning in C++, which is not affected by exceptions > or optimizations. I will keep updated on that one. Note that no warnings > are emitted for this test in C. > > analyzer/pr94362-1.c: In function ‘const EVP_PKEY_ASN1_M

Re: analyzer: Weekly update on extending C++ support (3)

2023-08-31 Thread Benjamin Priour via Gcc
Hi David, On Wed, Aug 30, 2023 at 1:01 AM David Malcolm wrote: > > > ? > > Yes; please submit it, so that we can work towards getting what you > have into trunk. > > Given that we don't properly support C++ yet, improvements to C++ > support don't have to be perfect. > > It is next in queue for

GCC workshop at university

2023-09-27 Thread Benjamin Priour via Gcc
Hi everyone, I'm in my final MSc year and figured after this weekend's Q&A that I could replicate David's workshop on a smaller scale within my university. Would that be doable/acceptable ? Is there any need for special licensing ? What about uploading the session's recording afterwards ? To Dav