This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to add a new operand to an expression?
- From: law at redhat dot com
- To: Carlo Wood <carlo at alinoe dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 12 Oct 2003 11:04:57 -0600
- Subject: Re: How to add a new operand to an expression?
- Reply-to: law at redhat dot com
In message <20031009160715.GA29347@alinoe.com>, Carlo Wood writes:
>On Thu, Oct 09, 2003 at 11:16:49AM -0400, Diego Novillo wrote:
>> On Thu, 2003-10-09 at 11:05, Carlo Wood wrote:
>>
>> > Can you be more specific? I see nothing in make_node that
>> > seems to need adjustment, gives me a clue or is even related
>> > to CALL_EXPR :/.
>
>> You may have missed the call to tree_size inside make_node. From the
>> debug dump you sent, it seems that you're losing track of how much
>> memory was allocated to CALL_EXPR. You'll have to debug from there.
>
>tree_size() is automatically returning the correct size
>after updating tree.def, of course.
>
>tree_size() returns:
>
> return (sizeof (struct tree_exp)
> + TREE_CODE_LENGTH (code) * sizeof (char *) - sizeof (char *));
>
>The TREE_CODE_LENGTH is changed as a result of
>changing the tree.def.
>
>
>I am still clueless of why it doesn't work
>the way I am doing this.
Well, you also have to find all the places that call "build" to build
nodes of the specified type and have them pass in an additional argument.
Otherwise the additional arguments get garbage off the stack. See
tree.c::build.
jeff