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: Fri, 30 Jul 2004 09:18:18 -0400
- Subject: Re: Fix processing of ADDR_EXPR in get_expr_operands
- Organization: Red Hat Canada
- References: <10407300327.AA14969@vlsi1.ultra.nyu.edu>
On Thu, 2004-07-29 at 23:27, Richard Kenner wrote:
> I don't know *why* ADDR_EXPR of a volatile is not TREE_CONSTANT. I
> don't really care.
>
> Well, I do. It sounds like a bug to me. Indeed it sounds like the central
> bug in what you're trying to fix.
>
No. It is not a bug. I don't know how else to tell you the same
thing. Address constness is checked with TREE_INVARIANT. The address
of a variable may be invariant in one invocation to a function, but have
different values from call to call.
> All I know, and always use, is that constness of ADDR_EXPRs is tested
> with TREE_INVARIANT. Hence the call to is_gimple_min_invariant. Even
> TREE_CONSTANT is not always right, you have to check for overflow as
> well.
>
> Overflow?
>
Yes. Overflow.
> Which you will notice sets both TREE_CONSTANT and TREE_INVARIANT, not
> necessarily with the same value.
>
> Right, I know it does. Indeed I made some changes to that code.
>
Then why are we having this conversation? You should know why we set
TREE_INVARIANT instead of TREE_CONSTANT, then.
Diego.