Using mem_attrs to get the tree of a function being called?

Alexandre Courbot Alexandre.Courbot@lifl.fr
Tue May 6 08:26:00 GMT 2003


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.



More information about the Gcc mailing list