On Tue, Jun 27, 2023 at 11:45:33AM +0200, Richard Biener 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. > > Bootstrapped and tested on x86_64-unknown-linux-gnu with all > languages enabled. > > OK for trunk? There is definitely going to be fallout but it > should be straight-forward to fix with quick fixes using > TYPE_PRECISION_RAW possible. > > 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. > > gcc/lto/ > * lto-common.cc (compare_tree_sccs_1): Use TYPE_PRECISION_RAW.
LGTM. Jakub