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: Fix processing of ADDR_EXPR in get_expr_operands


On Thu, 2004-07-29 at 21:56, Richard Kenner wrote:

> I still haven't seen an answer to why we're not marking addresses of
> volatile as constant, which I think is the real bug here.
> 
Invariant addresses are supposed to be marked with TREE_INVARIANT, not
TREE_CONSTANT.  That's what I've been told by the FE folks and that's
why the tree optimizers almost always rely on is_gimple_min_invariant().

/* Value of expression is function invariant.  A strict subset of
   TREE_CONSTANT, such an expression is constant over any one function
   invocation, though not across different invocations.  May appear in
   any expression node.  */
#define TREE_INVARIANT(NODE) ((NODE)->common.invariant_flag)
                                                                                
> It's possible the bug my original change fixed is no longer relevant, but
> if this breaks something, I'll let you know.
>
Make your FE set TREE_INVARIANT on "constant" ADDR_EXPRs and it will all
work fine in get_expr_operands.


Diego.


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