build_x_binary_op (ARRAY_REF ?!

Daniel Berlin dberlin@dberlin.org
Thu Apr 20 05:31:00 GMT 2006


>
> make_node does memset, but the loop above is after the call to  
> make_node.
>
> I guess we didn't hit the problem just because tsubst_copy_and_build()
> (where build_x_binary_op (ARRAY_REF is) is never called for  
> array_ref when processing_template_decl is non zero.

Probably.
Unfortunately, TREE_OPERAND checks the static lookup table for how  
many operands the tree code is supposed to have, *not* how many  
operands were actually allocated to the thing.

My suggestion would be to simply add some gcc_asserts that we don't  
ever get ARRAY_REF there :)

>
> I guess that sort of assertions need at least a comment or  
> gcc_assert().
>
> Alex.
>



More information about the Gcc mailing list