]> git.ipfire.org Git - thirdparty/gcc.git/commit
Handle OPAQUE_TYPE specially in verify_type [PR106833]
authorKewen Lin <linkw@linux.ibm.com>
Fri, 9 Sep 2022 13:17:21 +0000 (08:17 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Fri, 9 Sep 2022 13:17:21 +0000 (08:17 -0500)
commite230f11e9784eefed316df7dbc5df6ac999841b2
treec7f2407f148538c7fe4305e29d2d4839a0255b35
parenteff73c104a3db882f3bc7f567f322e40470c7571
Handle OPAQUE_TYPE specially in verify_type [PR106833]

As PR106833 shows, cv-qualified opaque type can cause ICE
during LTO.  It exposes that we missd to handle OPAQUE_TYPE
well in type verification.  As Richi pointed out, also
assuming that target will always define TYPE_MAIN_VARIANT
TYPE_CANONICAL for opaque type, this patch is to check
both are OPAQUE_TYPE_P and their modes are of MODE_OPAQUE
class.  Besides, it also checks the only available size
and alignment information.

PR middle-end/106833

gcc/ChangeLog:

* tree.cc (verify_opaque_type): New function.
(verify_type): Call verify_opaque_type for OPAQUE_TYPE.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr106833.c: New test.
gcc/testsuite/gcc.target/powerpc/pr106833.c [new file with mode: 0644]
gcc/tree.cc