]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/97323 - TYPE_CANONICAL vs. ARRAY_TYPE modes
authorRichard Biener <rguenther@suse.de>
Tue, 4 Mar 2025 15:13:09 +0000 (16:13 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 5 Mar 2025 10:05:38 +0000 (11:05 +0100)
commit556e25f0e9abc720c940994bd9a1491062933d49
treeec72265fff5dc26f96a57523070996e3f3754f71
parent2653d988e92bc9d70a3ac674d1b819610858e00a
middle-end/97323 - TYPE_CANONICAL vs. ARRAY_TYPE modes

For strict-alignment targets we can end up with BLKmode single-element
array types when the element type is unaligned.  This confuses
type checking since the canonical type would have an aligned
element type and a non-BLKmode mode.  The following simply ignores
the mode we assign to array types for this purpose, like we already
do for record and union types.

PR middle-end/97323
* tree.cc (gimple_canonical_types_compatible_p): Ignore
TYPE_MODE also for ARRAY_TYPE.
(verify_type): Likewise.

* gcc.dg/pr97323.c: New testcase.
gcc/testsuite/gcc.dg/pr97323.c [new file with mode: 0644]
gcc/tree.cc