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: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dnovillo at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 29 Jul 04 23:27:13 EDT
- Subject: Re: Fix processing of ADDR_EXPR in get_expr_operands
It's rather obvious. You cannot rely on TREE_CONSTANT to determine
constness of ADDR_EXPRs.
You lost me. I thought we took a lot of care to make sure it *does*
determine precisely that?
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.
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?
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.