This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using mem_attrs to get the tree of a function being called?
- From: Alexandre Courbot <Alexandre dot Courbot at lifl dot fr>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 6 May 2003 10:25:33 +0200
- Subject: Re: Using mem_attrs to get the tree of a function being called?
- References: <200304301652.08784.Alexandre.Courbot@lifl.fr> <20030501000317.GN697@redhat.com>
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.