This is the mail archive of the gcc@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: Using mem_attrs to get the tree of a function being called?


On Thursday 01 May 2003 02:03, Richard Henderson wrote:
> On gcc mainline you can get back to the DECL for a direct
> function call via SYMBOL_REF_DECL.

Seems to perfectly suits what I need. Unfortunately, it segfaults as soon as I 
try to use the tree I get:

In the output pattern of call_value, I do:

tree fexpr = SYMBOL_REF_DECL(operands[1]);    

(operand[1] being the function that is called)

Then, right after:

printf("%d\n", TREE_CODE(fexpr));

Makes cc1 crash badly. fexpr seems to have a correct value for a pointer 
however, so I wonder if it could be that the tree memory has been freed for 
some reason... Or more likely I've missed something. Is there anything wrong 
in what I do?

Thanks for any hint,
Alex.


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