This is the mail archive of the 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: [Ada PATCH] Clean-up Ada front-end use of TREE_OVERFLOW

    Whilst I agree that using CONSTANT_CLASS_P would be consistent and
    therefore obviously safe, the explicit use of an explicit INTEGER_CST
    test is motivated by context.  IIUC the values being represented and
    manipulated by ada/utils.c's max_size function denote the size in
    bytes (or possibly bits) of data types and data structures.  These
    presumably should never be floating point, complex or vector constant
    values, i.e. REAL_CST, COMPLEX_CST or VECTOR_CST.

    Let me know if I'm overlooking something.

You're not.  I was just making an abstraction argument.  Suppose one day
there were two different tree codes for integer constants.  If this tested
INTEGER_CST, it would be yet another place to change, while if it were using
CONSTANT_CLASS_P, it would not.  It's the same reason tree_low_cst is better
than TREE_INT_CST_LOW: in addition to the checking, it's less dependent on
the underlying implementation.

However, not a huge deal and whatever you decide having read the above is OK
with me.

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