This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with recompute_tree_invarant_for_addr_expr
- From: Richard Henderson <rth at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 13 Jun 2005 10:51:49 -0700
- Subject: Re: Problem with recompute_tree_invarant_for_addr_expr
- References: <20050613173933.GA30558@atrey.karlin.mff.cuni.cz>
On Mon, Jun 13, 2005 at 07:39:33PM +0200, Zdenek Dvorak wrote:
> This has a small flaw -- in case NODE has variable size, it gets
> allocated on stack dynamically, it may be allocated and deallocated
> several times, and its address is no longer an invariant.
>
> So I tried to fix the code as follows:
>
> if (decl_function_context (node) == current_function_decl
> && TREE_CONSTANT (DECL_SIZE (node))
> ... /* set TREE_INVARIANT */
Such nodes should never be seen having their address taken. They
should be completely removed during gimplification. So I think we
should stop here and figure out why you care about such nodes.
r~