This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to allow Ada to work with tree-ssa
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Jul 2004 00:08:28 -0400
- Subject: Re: Patch to allow Ada to work with tree-ssa
- Organization: Red Hat Canada
- References: <10407290335.AA06668@vlsi1.ultra.nyu.edu>
On Wed, 2004-07-28 at 23:35, Richard Kenner wrote:
> Given a volatile variable 'x', '&x' is not marked TREE_CONSTANT,
>
> Why? That seems wrong. The address of a volatile variable is still
> constant. recompute_tree_invarant_for_addr_expr correctly knows that
> the address of a volatile decl is constant and invariant.
>
To check whether an ADDR_EXPR is invariant, you should use
TREE_INVARIANT. TREE_CONSTANT is a superset of TREE_INVARIANT.
TREE_CONSTANT means that it is constant across different function
calls. The FE ought to set TREE_INVARIANT on ADDR_EXPRs, when
appropriate.
Perhaps one of the FE folks can elaborate a little more. We use
is_gimple_min_invariant() everywhere we want a "constant".
Diego.