From: Jakub Jelinek Date: Tue, 14 Nov 2023 08:24:34 +0000 (+0100) Subject: tree: Handle BITINT_TYPE in type_contains_placeholder_1 [PR112511] X-Git-Tag: basepoints/gcc-15~4708 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e5f318fc6480412569273c1a71c638c3d677607;p=thirdparty%2Fgcc.git tree: Handle BITINT_TYPE in type_contains_placeholder_1 [PR112511] The following testcase ICEs because BITINT_TYPE isn't handled in type_contains_placeholder_1. Given that Ada doesn't emit it, it doesn't matter that much where exactly we handle it as right now it should never contain a placeholder; I've picked the same spot as INTEGER_TYPE, but if you prefer e.g. the one with OFFSET_TYPE above, I can move it there too. 2023-11-14 Jakub Jelinek PR middle-end/112511 * tree.cc (type_contains_placeholder_1): Handle BITINT_TYPE like INTEGER_TYPE. * gcc.dg/pr112511.c: New test. --- diff --git a/gcc/testsuite/gcc.dg/pr112511.c b/gcc/testsuite/gcc.dg/pr112511.c new file mode 100644 index 000000000000..7d0b73f4776f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr112511.c @@ -0,0 +1,17 @@ +/* PR middle-end/112511 */ +/* { dg-do compile { target bitint } } */ +/* { dg-options "-O2" } */ + +struct T { _BitInt(22) a; }; + +void +bar (struct T t) +{ +} + +void +foo (void) +{ + struct T t; + bar (t); +} diff --git a/gcc/tree.cc b/gcc/tree.cc index 33ea1d2e2d07..a3d907a4ac0f 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -4210,6 +4210,7 @@ type_contains_placeholder_1 (const_tree type) return false; case INTEGER_TYPE: + case BITINT_TYPE: case REAL_TYPE: case FIXED_POINT_TYPE: /* Here we just check the bounds. */