Re: [gimple-ssa] result_decl and ssa_name

2024-04-08 Thread Pierrick Philippe
On 06/04/2024 14:53, Richard Biener wrote: > On Fri, Apr 5, 2024 at 3:44 PM Pierrick Philippe > wrote: >> On 05/04/2024 14:46, Richard Biener wrote: >> >> On Fri, Apr 5, 2024 at 1:59 PM Pierrick Philippe >> wrote: >> >> Hi all, >> >> I

Re: [gimple-ssa] result_decl and ssa_name

2024-04-05 Thread Pierrick Philippe
On 05/04/2024 14:46, Richard Biener wrote: > On Fri, Apr 5, 2024 at 1:59 PM Pierrick Philippe > wrote: >> Hi all, >> >> I do have a question regarding ssa_name and result_decl. >> >> For example on the following gimple function: >> >> int f

[gimple-ssa] result_decl and ssa_name

2024-04-05 Thread Pierrick Philippe
Hi all, I do have a question regarding ssa_name and result_decl. For example on the following gimple function: int f () {   int x;   int D.2747;   int _2;   :   x_1 = 42;   _2 = x_1;   : :   return _2; } On the above example, using the macro SSA_NAME_VAR() on _2 does not yield anything

Using std types and functions within GCC

2024-03-14 Thread Pierrick Philippe
Hi all, I was wondering, is there any conventions or guidelines regarding the usage of types and/or functions coming from the C++ std library within the compiler? To explicit a bit more, I am working on modification on the analyzer and might need to use a pair. Thank you for your time,

Re: [Tree][Static Analyzer] Tree representing types and svalues type

2024-01-18 Thread Pierrick Philippe
On 17/01/2024 23:52, David Malcolm wrote: > On Tue, 2024-01-16 at 15:44 +0100, Pierrick Philippe wrote: >> Hi David, hi all, > Hi Pierrick. First, thanks for you answer. [stripping] > I confess that I've been quite sloppy in places with types in the > analyzer, keeping track of t

[Tree][Static Analyzer] Tree representing types and svalues type

2024-01-16 Thread Pierrick Philippe
Hi David, hi all, I was playing along with APIs from the Static Analyzer and encountered a segfault in gcc/tree.cc:5068 (i.e. in function build2 and failure is due to a gcc_assert call), after a call to ana::region_model::get_representative_tree. >From my debugging of the problem, I realized

[Analyzer] Transform a region 't[i]' to its svalue form ' + (i * element_size)'

2023-11-16 Thread Pierrick Philippe
Hi all, hi David, I am trying to use the analyzer API to transform an element_region (such as 't[1]') to a binop_svalue with an inner region_svalue (such as ' + 4' in case of integers array) for analysis purpose. I managed to do it the other way around (i.e. from a binop_svalue to an

Re: [gimple-ssa] Get the gimple corresponding to the definition of a VAR_DECL

2023-06-27 Thread Pierrick Philippe
On 27/06/2023 11:42, Richard Biener wrote: On Tue, Jun 27, 2023 at 11:36 AM Pierrick Philippe wrote: Hi everyone, I'm trying to get the gimple * associated to the definition of a given var_decl. Basically, I am iterating over the locals of a function (through the local_decls member) and I

[gimple-ssa] Get the gimple corresponding to the definition of a VAR_DECL

2023-06-27 Thread Pierrick Philippe
Hi everyone, I'm trying to get the gimple * associated to the definition of a given var_decl. Basically, I am iterating over the locals of a function (through the local_decls member) and I need to be able to get the gimple * of its definition within the function's gimple_seq. Does any of

[analyzer] Comparing svalues

2023-06-01 Thread Pierrick Philippe
Hi David, hi all, I'm working on a plugin for the analyzer, and basically I've reached a point where I need to compare svalues. For the need of my analysis, I've modified the analyzer to be able to track for region in some specific cases, so I modified the implementation of the

[analyzer][tree] Get the adress of a specific tree

2023-05-24 Thread Pierrick Philippe
Hi all, I am working around array using a plugin to the analyzer. And I face a problem here, I would like to be able to build a transformed representation of an element of the array from its subscript representation to its address representation (vice versa). To image what I'm saying, I'm

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-23 Thread Pierrick Philippe
On 22/03/2023 19:19, David Malcolm wrote: On Tue, 2023-03-21 at 09:21 +0100, Pierrick Philippe wrote: [stripping] In fact, this could be done directly by the analyzer, and only calling state machine APIs for loop handling which still has not reached such a fixed point in their program state

Re: Static Analyzer: correlate state for different region/svalue for reporting

2023-03-21 Thread Pierrick Philippe
On 16/03/2023 14:44, David Malcolm wrote: On Thu, 2023-03-16 at 09:54 +0100, Pierrick Philippe wrote: On 15/03/2023 17:26, David Malcolm wrote: On Wed, 2023-03-15 at 16:24 +0100, Pierrick Philippe wrote: [stripping] So, first question: is there any way to associate and track the state

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-21 Thread Pierrick Philippe
On 21/03/2023 00:30, David Malcolm wrote: On Mon, 2023-03-20 at 13:28 +0100, Pierrick Philippe wrote: Hi everyone, I'm still playing around with the analyzer, and wanted to have a look at loop handling. I'm using a build from /trunk/ branch (/20230309/). Here is my analyzed code: ''' 1

[Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-20 Thread Pierrick Philippe
Hi everyone, I'm still playing around with the analyzer, and wanted to have a look at loop handling. I'm using a build from /trunk/ branch (/20230309/). Here is my analyzed code: ''' 1| #include 2| int main(void) { 3|    void * ptr = malloc(sizeof(int)); 4|    for (int i = 0; i < 10; i++) {

Re: [Tree-SSA] Question from observation, bogus SSA form?

2023-03-17 Thread Pierrick Philippe
On 16/03/2023 17:30, Martin Jambor wrote: Hello Pierrick, On Thu, Mar 16 2023, Pierrick Philippe wrote: Hi everyone, I was working around with the analyzer, but I usually dump the SSA-tree to get a view of the analyzed code. This is how I noticed something wrong, at least in the sense

[Tree-SSA] Question from observation, bogus SSA form?

2023-03-16 Thread Pierrick Philippe
Hi everyone, I was working around with the analyzer, but I usually dump the SSA-tree to get a view of the analyzed code. This is how I noticed something wrong, at least in the sense of the definition of SSA form. I'm using a version of gcc build from a /trunk/ branch (/20230309/). Here is

Re: Static Analyzer: correlate state for different region/svalue for reporting

2023-03-16 Thread Pierrick Philippe
On 15/03/2023 17:26, David Malcolm wrote: On Wed, 2023-03-15 at 16:24 +0100, Pierrick Philippe wrote: Hi everyone, Hi Pierrick I have some question regarding the analyzer. I'm currently working on an fully out-of-tree static analyzer plugin. I started development on commit tagged

Static Analyzer: correlate state for different region/svalue for reporting

2023-03-15 Thread Pierrick Philippe
Hi everyone, I have some question regarding the analyzer. I'm currently working on an fully out-of-tree static analyzer plugin. I started development on commit tagged as /basepoints/gcc-13/, but recently moved my code to a more recent /trunk/ branch (build /20230309/). From my different