Fix processing of ADDR_EXPR in get_expr_operands

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Fri Jul 30 15:51:00 GMT 2004


    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.



More information about the Gcc-patches mailing list