instrument a funtion on RTL

2020-09-13 Thread via Gcc
hi, one of my work need to instrument a memset function (since the memset are inserted after pass_expand). I find inserting a function before memset directly will lead to segment fault. I think the inserted funtion destroy memset funtion arguments. I put the inserted funtion after memset, run

Re: about souce code location

2020-09-04 Thread via Gcc
how to check the location corresponding to a gimple statement? My instrument stmt include some memory access, I wish get right source code line. By context it is possible get wrong line. ---Original--- From: "Richard Biener"

about souce code location

2020-09-03 Thread via Gcc
I am working a instrumention tool, and need get the location info for a gimple statement. I use the location structure to get the info, and it can work when i use -O1. When I use -O2, sometimes the info seems to be lost and I get line num is zero. anyone can tell me how to get the info?

how to get TARGET_MEM_REF addr in gcc-7.3

2020-05-22 Thread via Gcc
hi, I work on a tool that need to get address of some memory access on ssa form. I call build_fold_addr_expr function to get address. I have finished it on gcc-9.3, and the tool can work correctly. When I port it to gcc-7.3, the expand pass report a corrupt. I find it is TARGET_MEM_REF not

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread via Gcc
There are some other cases that I cannot get right answer. case1: interproceduure func(int*arg) { return arg[0] + arg[1] } func2() { int a[10] return func(a); } here func cannot tell arg is local var. case 2: global array point to local int *array[3] int func(int x) { int sub1[10]; int sub2[10];

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread via Gcc
Thanks, I patch a version, it can give a heap variable info. Now the curious is the patch version cannot give right answer for variable length array. for example, int func(int m, int n) { int array[m][n]; ... } here array is allocated by alloca, obviously a local variable. But the original

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread via Gcc
now I am working on gcc-9.3, can you give the specific code location to check not escaped heap? I try to add a flag. ---Original--- From: "Richard Biener"

Re: how to find variable related to a virtual ssa name

2020-05-13 Thread via Gcc
Which pass computes the points-to info, maybe There are some details? Do you know it? ---Original--- From: "Richard Biener"

Re: how to find variable related to a virtual ssa name

2020-05-12 Thread via Gcc
thanks a lot. I will check your advice. Can you give some explaination about memory ssa, and how to use it. I check internal, cannot get it. Maybe you know some examples or some more materials. ---Original--- From: "Richard Biener"

how to find variable related to a virtual ssa name

2020-05-12 Thread via Gcc
hi, I am working on gcc ssa name. For each function, we can traverse all defined ssa name by macro FOR_EACH_SSA_NAME. If a ssa name is default definition for a symbol (check SSA_NAME_IS_DEFAULT_DEF) , I can get the symbol by SSA_NAME_VAR. But for a virtual DEFAULT DEF, I cannot get it,

where i should insert the finalize function for c++?

2020-04-26 Thread via Gcc
I am working a instrumentation tool based on gcc. I insert some intrumentation code into each function, including destructor functions. A finalize function will free memory resources after all work done. But I cannot find proper loacation calling my finalizing function since the destructor

Re: Help, Where I can find proper libtool version?

2020-04-15 Thread via Gcc
thank your reply. I think that should have a website put current working version tools. I have try to find each right versions for each tools. ---Original--- From: "Maciej W. Rozycki"ftp://sourceware.org/; or maybe

Help, Where I can find proper libtool version?

2020-04-15 Thread via Gcc
I am trying to add a library into gcc source code tree. The gcc source have used libtool 2.2.7a 1.1334. but I cannot find the version. So after runing autoreconf and make , I get "libtool: Versionmismatcherror.".It is a curious version, the gnu mirrors have no such version. Thanks a lot!