> And tree expressions don't have TREE_BLOCK before gimple-low either.
> So IMNSHO it is gimple-low.c that should set TREE_BLOCK of all the gimple
> stmts as well as all expression in the operands.  It is not overwriting
> anything, no frontend sets TREE_BLOCK for any expression, the way frontends
> associate IL with BLOCKs is by putting them inside of BIND_EXPR/GIMPLE_BIND
> after gimplification, and it is gimple-low responsibility to set it.
>
> In 4.3 before tuples, it was solely gimple-low that set TREE_BLOCK
> initially.  Before the location_t changes, again it was gimple-low that
> was the first setter of TREE_BLOCK, which was valid for all
> IS_EXPR_CODE_CLASS.  So, IMNSHO gimple-low should merge location_t
> with block for all gimple stmts and all tree expressions used in its
> operands.  It shouldn't be set on trees that can be shared, so
> say decls etc. should keep using just location_t's without associated block.
> So perhaps the right test for gimple-low setting of block is
> CAN_HAVE_LOCATION_P (exp) && !tree_node_can_be_shared (exp).
>
>         Jakub

I Kind of like this idea. What do you guys think?

Thanks,
Dehao

Reply via email to