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 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.


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