On 6/23/23 02:26, Richard Biener via Gcc-patches wrote:
The following makes sure that using TYPE_PRECISION on VECTOR_TYPE
ICEs when tree checking is enabled.  This should avoid wrong-code
in cases like PR110182 and instead ICE.

It also introduces a TYPE_PRECISION_RAW accessor and adjusts
places I found that are eligible to use that.

This patch requires (at least) the series of patches I will
followup this with.  I have to re-bootstrap / test to look
for further fallout (I've picked this up again after some weeks).

Opinions?

Thanks,
Richard.

        * tree.h (TYPE_PRECISION): Check for non-VECTOR_TYPE.
        (TYPE_PRECISION_RAW): Provide raw access to the precision
        field.
        * tree.cc (verify_type_variant): Compare TYPE_PRECISION_RAW.
        (gimple_canonical_types_compatible_p): Likewise.
        * tree-streamer-out.cc (pack_ts_type_common_value_fields):
        Stream TYPE_PRECISION_RAW.
        * tree-streamer-in.cc (unpack_ts_type_common_value_fields):
        Likewise.
        * lto-streamer-out.cc (hash_tree): Hash TYPE_PRECISION_RAW.
Given how easy it is to incorrectly use TYPE_PRECISION on VECTOR_TYPE, I'm all for it.

jeff

Reply via email to