This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix processing of ADDR_EXPR in get_expr_operands
- 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 22:02:45 -0400
- Subject: Re: Fix processing of ADDR_EXPR in get_expr_operands
- Organization: Red Hat Canada
- References: <10407300156.AA13423@vlsi1.ultra.nyu.edu>
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.