This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to allow Ada to work with tree-ssa


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]