Understand pointer deferences in GIMPLE

2020-07-14 Thread Shuai Wang via Gcc
Hello, I am trying to traverse the GIMPlE statements and identify all pointer differences (i.e., memory load and store). For instance, something like: **_4* = 0; ... _108 = (signed char *) _107; _109 = **_108*; After some quick searches in the GCC codebase, I am thinking to use the foll

Re: RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0'

2020-07-14 Thread Maciej W. Rozycki via Gcc
On Tue, 14 Jul 2020, Richard Biener wrote: > > > Arguably this might probably be called a deficiency in libgcc, however > > > the objects are built with `-fexceptions -fnon-call-exceptions' > > > > I consider that broken. It doesn't make any sense to build a lowlevel > > runtime library like lib

Re: Understand pointer deferences in GIMPLE

2020-07-14 Thread Richard Biener via Gcc
On Tue, Jul 14, 2020 at 9:17 AM Shuai Wang via Gcc wrote: > > Hello, > > I am trying to traverse the GIMPlE statements and identify all pointer > differences (i.e., memory load and store). For instance, something like: > > **_4* = 0; >... > _108 = (signed char *) _107; > _109 = **_108*;

Re: Understand pointer deferences in GIMPLE

2020-07-14 Thread Shuai Wang via Gcc
Thank you. Yes, I think gimple_store_p and gimple_assign_load_p should be what I am looking for. Best, Shuai On Tue, Jul 14, 2020 at 5:38 PM Richard Biener wrote: > On Tue, Jul 14, 2020 at 9:17 AM Shuai Wang via Gcc > wrote: > > > > Hello, > > > > I am trying to traverse the GIMPlE statements

Question about function body and function specialization

2020-07-14 Thread Erick Ochoa
Hello, I have a function foo defined on a source file. Sometimes, a function pointer pointing to foo is passed as a parameter to other functions where foo is called indirectly. This indirect call is specialized during link time. Still at link time, I analyze the function call the following wa

Re: Question about function body and function specialization

2020-07-14 Thread Erick Ochoa
Actually, another interesting hint is that the original foo function takes two parameters. The function I am seeing inside the FOR_EACH_FUNCTION_WITH_GIMPLE_BODY is a specialized function of foo with only 1 parameter. However, the indirect function call is a version of foo which has not been sp

GCC Plugin to insert new expressions/statements in the code

2020-07-14 Thread Masoud Gholami
Hi, I am writing a plugin that uses the PLUGIN_PRAGMAS event to register a custom pragma that is expected to be before a function call as follows: int main() { char *filename = “path/to/file”; #pragma inject_before_call File *f = fopen(filename, …); // marked

How to refine autovectorized loop

2020-07-14 Thread 夏 晋 via Gcc
Hi everyone, I'm trying to autovectorize the loop, and Thank you for the omnipotent macros, everything goes alright. But recently I need to further optimize the loop, I had some problems. As our vector instruction can process 16 numbers at the same time, if the for loop counter is equal or l