This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GIMPLE and intent of variables



Mateusz Grabowski wrote:
> 
> 

> 
If a function calls another, the intent of variables should be passed to the
first one. But what if the callee is in the other compilation unit? Does
anyone have knowledge of using LTO mode? 
> 

> 

At this moment I have many compilation units. In my case the main program is
written in Fortran and it calls functions in C - I'm sure that this works
correctly.

My plugin runs after cplxlower0 pass. I use following flags to compile and
link each Fortran and C files:

 -flto -O0 -flto-partition=none -fwhole-program -fuse-linker-plugin

I use them in order to see whole program as a single compilation unit.
Object files are also compileted with -flto flags.
ld.gold linker (from gcc binutils) links object files (.o) thanks to that my
main .cplxlower0 file contains all needed functions in GIMPLE. My plugin
comes to every function.

But my problem is that I can't get some function definition when I'm
currently in the another one.

if(is_gimple_call(stmt)) {
    tree fndecl = gimple_call_fndecl(stmt);
    struct function *new_cfun = DECL_STRUCT_FUNCTION(fndecl);
    (...)
}

In this case new_cfun == NULL or equivalently gimple_has_body_p(fndecl) ==
NULL even if the function is in the same Fortran or C file.
-- 
View this message in context: http://old.nabble.com/GIMPLE-and-intent-of-variables-tp32275433p32337494.html
Sent from the gcc - patches mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]