public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [GIMPLE] Can't retrieve function declaration with call (using ld.gold)
@ 2011-08-26  8:03 Mateusz Grabowski
  0 siblings, 0 replies; only message in thread
From: Mateusz Grabowski @ 2011-08-26  8:03 UTC (permalink / raw)
  To: gcc-help


I'm reposting following thread, because I previously chose wrong mailing-list
(gcc-patches):

http://old.nabble.com/GIMPLE-and-intent-of-variables-to32275433.html
http://old.nabble.com/GIMPLE-and-intent-of-variables-to32275433.html 


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--Can%27t-retrieve-function-declaration-with-call-%28using-ld.gold%29-tp32339989p32339989.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-26  8:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-26  8:03 [GIMPLE] Can't retrieve function declaration with call (using ld.gold) Mateusz Grabowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).