From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 3D1953858D38 for ; Wed, 6 Dec 2023 12:05:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D1953858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3D1953858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701864313; cv=none; b=WRPOGiqkzqWTGhtevHX5iqZuLEOBI3NZJ8XdHUU+9XPgVqqTaywuly9ifoIDB7FNmOjZ+RjMfQvy2qrN+Chh+80DkuD30NfmiepZe9s/WyfqMcfX7Zidnv8fKaB3tomW0d14c3xpVbYYPPIVwBTtQXilkLylK+n+++fgkadyon8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701864313; c=relaxed/simple; bh=zhLnJVUPnpm9Hrv8/kJpe2lCFtp1LwtgNlxm+xVmjeU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=qOBsfOb8VczrNVijDVm5RWfis9Z8bWafaQBjTqYsMz1BkC+lkUbLbIRSIgbp5weOIHEKbzw4BmCs6O5/kAH3n1fOnn+KeUbiRO7UhU/KhNyEI8QR8BwyG2bYbkmabCTHU38imOG/aSO+LRMj8i6f5jT1z6PFwd8Ck3gfy+gWxZY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33350fcb2c7so516408f8f.2 for ; Wed, 06 Dec 2023 04:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701864305; x=1702469105; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vYIsHVrTxTwJHBmix07FM6jPlaWlVmTZOl+boScprVE=; b=qyfLWBVOh6zy36YU7x5q2mLCu5iMCUE1nrd5G0lJhbzpTfiswDMTvcLg16G6whOhtT nRNxuqkRcwClszdYAhADB54yWten4PCD/X47ESsT7x3E+37pll4uOf17wJJrq+5abGZn WR/SBeXnOxMrYByoD/OomREX5UfKYRYNn2bxCp469hx6Fa00n86SMEQaN2xkh3TTJbv1 5970SbZZzq0SMIKf/vMVIk1U4/q4rcq4kVeRdcVxxlRIXQ/SMfSLkNuitMhi6QIbCQGi +skjdEsQmDT0avkZWeeHtQUvNP73bTctHyCvqhC58xO7mkML+MR3BNz1NF5VX8wwC5MX uMLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701864305; x=1702469105; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vYIsHVrTxTwJHBmix07FM6jPlaWlVmTZOl+boScprVE=; b=vwucjDYGSw3yWHNjB1UCSZ+fduxWDEzAt//iCovhUg8Pb8VQ0RumpBW7FWnWMsHgLq 5sD01NHaCZV/xAyP9akjSKPClFY4hyRfXVh9+/CHq1SUGOPa+yEfSdK0/Up3akoQO3jC MktJsA/5x7ext7hLTus5Me8smp64j9IF2uxmpsTW6egZ+ASHVNk0TdacsGj4O+PwQrOB jbBTqZ39Si4fW5xjERG1TVPrnX2cwf9B8Ov9ImahvZT3G0av/ALi3EbR+fypbyVbSftU g/iJ6kNGbEX2RP4VyC5wU2O/Wn/+xOCpsb4GYYYQkLMyaZIaKR84t4MHNI55JALqyzUo jjaA== X-Gm-Message-State: AOJu0YyPmyJUaVEn2/hn0v2QiRhjfHngmcgQiT2hOa55R2bzSHvsZaId DGdbJw+x2eVvEZwglqvz0oEfXSG5iiGJl8R6CEtxdY8VIgDlRC7r+B4= X-Google-Smtp-Source: AGHT+IFCJJSGUERK4hIe0D7j7pbrG/K+fFu78qZZ3KtHSIId4impPG/7EW50KJqZoPhO9yVJFstmowrh+GF/VhpYEYw= X-Received: by 2002:a05:6000:25c:b0:333:2fd2:812f with SMTP id m28-20020a056000025c00b003332fd2812fmr437103wrz.76.1701864304019; Wed, 06 Dec 2023 04:05:04 -0800 (PST) MIME-Version: 1.0 References: <9e40a64880a14cf27d788ecbaf23365b9a5ac069.1700473918.git.fweimer@redhat.com> In-Reply-To: <9e40a64880a14cf27d788ecbaf23365b9a5ac069.1700473918.git.fweimer@redhat.com> From: Prathamesh Kulkarni Date: Wed, 6 Dec 2023 17:34:29 +0530 Message-ID: Subject: Re: [PATCH v3 10/11] c: Turn -Wincompatible-pointer-types into a permerror To: Florian Weimer Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 20 Nov 2023 at 15:28, Florian Weimer wrote: > > The change to build_conditional_expr drops the downgrade > from a pedwarn to warning for builtins for C99 and later > language dialects. It remains a warning in C89 mode (not > a permerror), as the -std=gnu89 -fno-permissive test shows. Hi Florian, It seems this patch caused a fallout for gcc.dg/fixed-point/composite-type.c on arm, where the tests for warnings fail. For instance: FAIL: gcc.dg/fixed-point/composite-type.c (test for warnings, line 71) Excess errors: /home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/fixed-point/composite-type.c:71:3: error: passing argument 1 of 'f2_sf' from incompatible pointer type [-Wincompatible-pointer-types] /home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/fixed-point/composite-type.c:71:3: error: passing argument 1 of 'f2_sf' from incompatible pointer type [-Wincompatible-pointer-types] (snipped rest) Should these warnings be now upgraded to dg-error ? Thanks, Prathamesh > > gcc/ > > * doc/invoke.texi (Warning Options): Document changes. > > gcc/c/ > > PR c/96284 > * c-typeck.cc (build_conditional_expr): Upgrade most pointer > type mismatches to a permerror. > (convert_for_assignment): Use permerror_opt and > permerror_init for OPT_Wincompatible_pointer_types warnings. > > gcc/testsuite/ > > * gcc.dg/permerror-default.c (incompatible_pointer_types): > Expect new permerror. > * gcc.dg/permerror-gnu89-nopermissive.c > (incompatible_pointer_types): Likewise. > * gcc.dg/permerror-pedantic.c (incompatible_pointer_types): > Likewise. > * gcc.dg/permerror-system.c: Likewise. > * gcc.dg/Wincompatible-pointer-types-2.c: Compile with > -fpermissive due to expected errors. > * gcc.dg/Wincompatible-pointer-types-5.c: New test. Copied > from gcc.dg/Wincompatible-pointer-types-2.c. Expect errors. > * gcc.dg/anon-struct-11.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/anon-struct-11a.c: New test. Copied from > gcc.dg/anon-struct-11.c. Expect errors. > * gcc.dg/anon-struct-13.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/anon-struct-13a.c: New test. Copied from > gcc.dg/anon-struct-13.c. Expect errors. > * gcc.dg/builtin-arith-overflow-4.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/builtin-arith-overflow-4a.c: New test. Copied from > gcc.dg/builtin-arith-overflow-4.c. Expect errors. > * gcc.dg/c23-qual-4.c: Expect -Wincompatible-pointer-types errors. > * gcc.dg/dfp/composite-type.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/dfp/composite-type-2.c: New test. Copied from > gcc.dg/dfp/composite-type.c. Expect errors. > * gcc.dg/diag-aka-1.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/diag-aka-1a.c: New test. Copied from gcc.dg/diag-aka-1a.c. > Expect errors. > * gcc.dg/enum-compat-1.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/enum-compat-2.c: New test. Copied from > gcc.dg/enum-compat-1.c. Expect errors. > * gcc.dg/func-ptr-conv-1.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/func-ptr-conv-2.c: New test. Copied from > gcc.dg/func-ptr-conv-1.c. Expect errors. > * gcc.dg/init-bad-7.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/init-bad-7a.c: New test. Copied from gcc.dg/init-bad-7.c. > Expect errors. > * gcc.dg/noncompile/incomplete-3.c (foo): Expect > -Wincompatible-pointer-types error. > * gcc.dg/param-type-mismatch-2.c (test8): Likewise. > * gcc.dg/pointer-array-atomic.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/pointer-array-atomic-2.c: New test. Copied from > gcc.dg/pointer-array-atomic.c. Expect errors. > * gcc.dg/pointer-array-quals-1.c (test): Expect > -Wincompatible-pointer-types errors. > * gcc.dg/transparent-union-1.c: Compile with -fpermissive > due to expected errors. > * gcc.dg/transparent-union-1a.c: New test. Copied from > gcc.dg/transparent-union-1.c. Expect errors. > * gcc.target/aarch64/acle/memtag_2a.c > (test_memtag_warning_return_qualifier): Expect additional > errors. > * gcc.target/aarch64/sve/acle/general-c/load_2.c (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/sizeless-1.c (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/sizeless-2.c (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_1.c (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_2.c (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_scatter_index_restricted_1.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c > (f1): Likewise. > * gcc.target/aarch64/sve/acle/general/attributes_7.c > (f1): Likewise. > * gcc.target/i386/sse2-bfloat16-scalar-typecheck.c (footest): > Expect -Wincompatible-pointer-types errors. > * gcc.target/i386/vect-bfloat16-typecheck_1.c (footest): Likewise. > * gcc.target/i386/vect-bfloat16-typecheck_2.c (footest): Likewise. > --- > gcc/c/c-typeck.cc | 63 +++++----- > gcc/doc/invoke.texi | 6 + > .../gcc.dg/Wincompatible-pointer-types-2.c | 2 +- > .../gcc.dg/Wincompatible-pointer-types-5.c | 10 ++ > gcc/testsuite/gcc.dg/anon-struct-11.c | 5 +- > gcc/testsuite/gcc.dg/anon-struct-11a.c | 111 ++++++++++++++++++ > gcc/testsuite/gcc.dg/anon-struct-13.c | 2 +- > gcc/testsuite/gcc.dg/anon-struct-13a.c | 76 ++++++++++++ > .../gcc.dg/builtin-arith-overflow-4.c | 2 +- > .../gcc.dg/builtin-arith-overflow-4a.c | 43 +++++++ > gcc/testsuite/gcc.dg/c23-qual-4.c | 6 +- > gcc/testsuite/gcc.dg/dfp/composite-type-2.c | 58 +++++++++ > gcc/testsuite/gcc.dg/dfp/composite-type.c | 2 +- > gcc/testsuite/gcc.dg/diag-aka-1.c | 2 +- > gcc/testsuite/gcc.dg/diag-aka-1a.c | 29 +++++ > gcc/testsuite/gcc.dg/enum-compat-1.c | 2 +- > gcc/testsuite/gcc.dg/enum-compat-2.c | 32 +++++ > gcc/testsuite/gcc.dg/func-ptr-conv-1.c | 2 +- > gcc/testsuite/gcc.dg/func-ptr-conv-2.c | 56 +++++++++ > gcc/testsuite/gcc.dg/init-bad-7.c | 2 +- > gcc/testsuite/gcc.dg/init-bad-7a.c | 12 ++ > .../gcc.dg/noncompile/incomplete-3.c | 2 +- > gcc/testsuite/gcc.dg/param-type-mismatch-2.c | 2 +- > gcc/testsuite/gcc.dg/permerror-default.c | 20 ++-- > .../gcc.dg/permerror-gnu89-nopermissive.c | 18 +-- > gcc/testsuite/gcc.dg/permerror-pedantic.c | 2 +- > gcc/testsuite/gcc.dg/permerror-system.c | 11 ++ > gcc/testsuite/gcc.dg/pointer-array-atomic-2.c | 60 ++++++++++ > gcc/testsuite/gcc.dg/pointer-array-atomic.c | 2 +- > gcc/testsuite/gcc.dg/pointer-array-quals-1.c | 6 +- > gcc/testsuite/gcc.dg/transparent-union-1.c | 2 +- > gcc/testsuite/gcc.dg/transparent-union-1a.c | 85 ++++++++++++++ > .../gcc.target/aarch64/acle/memtag_2a.c | 6 +- > .../aarch64/sve/acle/general-c/load_2.c | 4 +- > .../acle/general-c/load_ext_gather_offset_1.c | 2 +- > .../acle/general-c/load_ext_gather_offset_2.c | 2 +- > .../acle/general-c/load_ext_gather_offset_3.c | 2 +- > .../acle/general-c/load_ext_gather_offset_4.c | 2 +- > .../acle/general-c/load_ext_gather_offset_5.c | 2 +- > .../load_ext_gather_offset_restricted_1.c | 2 +- > .../load_ext_gather_offset_restricted_2.c | 2 +- > .../load_ext_gather_offset_restricted_3.c | 2 +- > .../load_ext_gather_offset_restricted_4.c | 2 +- > .../aarch64/sve/acle/general-c/sizeless-1.c | 8 +- > .../aarch64/sve/acle/general-c/sizeless-2.c | 8 +- > .../aarch64/sve/acle/general-c/store_1.c | 8 +- > .../aarch64/sve/acle/general-c/store_2.c | 8 +- > .../acle/general-c/store_scatter_index_1.c | 6 +- > .../store_scatter_index_restricted_1.c | 6 +- > .../acle/general-c/store_scatter_offset_2.c | 6 +- > .../store_scatter_offset_restricted_1.c | 6 +- > .../aarch64/sve/acle/general/attributes_7.c | 28 ++--- > .../i386/sse2-bfloat16-scalar-typecheck.c | 4 +- > .../i386/vect-bfloat16-typecheck_1.c | 4 +- > .../i386/vect-bfloat16-typecheck_2.c | 4 +- > 55 files changed, 727 insertions(+), 130 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/Wincompatible-pointer-types-5.c > create mode 100644 gcc/testsuite/gcc.dg/anon-struct-11a.c > create mode 100644 gcc/testsuite/gcc.dg/anon-struct-13a.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-arith-overflow-4a.c > create mode 100644 gcc/testsuite/gcc.dg/dfp/composite-type-2.c > create mode 100644 gcc/testsuite/gcc.dg/diag-aka-1a.c > create mode 100644 gcc/testsuite/gcc.dg/enum-compat-2.c > create mode 100644 gcc/testsuite/gcc.dg/func-ptr-conv-2.c > create mode 100644 gcc/testsuite/gcc.dg/init-bad-7a.c > create mode 100644 gcc/testsuite/gcc.dg/pointer-array-atomic-2.c > create mode 100644 gcc/testsuite/gcc.dg/transparent-union-1a.c > > diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc > index f4b700117ff..39efb518835 100644 > --- a/gcc/c/c-typeck.cc > +++ b/gcc/c/c-typeck.cc > @@ -5434,8 +5434,15 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp, > else > { > int qual = ENCODE_QUAL_ADDR_SPACE (as_common); > - if (emit_diagnostic (bltin1 && bltin2 ? DK_WARNING : DK_PEDWARN, > - colon_loc, OPT_Wincompatible_pointer_types, > + diagnostic_t kind = DK_PERMERROR; > + if (!flag_isoc99) > + /* This downgrade to a warning ensures that -std=gnu89 > + -pedantic-errors does not flag these mismatches between > + builtins as errors (as DK_PERMERROR would). ISO C99 > + and later do not have implicit function declarations, > + so the mismatch cannot occur naturally there. */ > + kind = bltin1 && bltin2 ? DK_WARNING : DK_PEDWARN; > + if (emit_diagnostic (kind, colon_loc, OPT_Wincompatible_pointer_types, > "pointer type mismatch " > "in conditional expression")) > { > @@ -7573,46 +7580,48 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type, > auto_diagnostic_group d; > range_label_for_type_mismatch rhs_label (rhstype, type); > gcc_rich_location richloc (expr_loc, &rhs_label); > - if (pedwarn (&richloc, OPT_Wincompatible_pointer_types, > - "passing argument %d of %qE from incompatible " > - "pointer type", parmnum, rname)) > + if (permerror_opt (&richloc, OPT_Wincompatible_pointer_types, > + "passing argument %d of %qE from " > + "incompatible pointer type", > + parmnum, rname)) > inform_for_arg (fundecl, expr_loc, parmnum, type, rhstype); > } > break; > case ic_assign: > if (bltin) > - pedwarn (location, OPT_Wincompatible_pointer_types, > - "assignment to %qT from pointer to " > - "%qD with incompatible type %qT", > - type, bltin, rhstype); > + permerror_opt (location, OPT_Wincompatible_pointer_types, > + "assignment to %qT from pointer to " > + "%qD with incompatible type %qT", > + type, bltin, rhstype); > else > - pedwarn (location, OPT_Wincompatible_pointer_types, > - "assignment to %qT from incompatible pointer type %qT", > - type, rhstype); > + permerror_opt (location, OPT_Wincompatible_pointer_types, > + "assignment to %qT from incompatible pointer " > + "type %qT", > + type, rhstype); > break; > case ic_init: > case ic_init_const: > if (bltin) > - pedwarn_init (location, OPT_Wincompatible_pointer_types, > - "initialization of %qT from pointer to " > - "%qD with incompatible type %qT", > - type, bltin, rhstype); > + permerror_init (location, OPT_Wincompatible_pointer_types, > + "initialization of %qT from pointer to " > + "%qD with incompatible type %qT", > + type, bltin, rhstype); > else > - pedwarn_init (location, OPT_Wincompatible_pointer_types, > - "initialization of %qT from incompatible " > - "pointer type %qT", > - type, rhstype); > + permerror_init (location, OPT_Wincompatible_pointer_types, > + "initialization of %qT from incompatible " > + "pointer type %qT", > + type, rhstype); > break; > case ic_return: > if (bltin) > - pedwarn (location, OPT_Wincompatible_pointer_types, > - "returning pointer to %qD of type %qT from " > - "a function with incompatible type %qT", > - bltin, rhstype, type); > + permerror_opt (location, OPT_Wincompatible_pointer_types, > + "returning pointer to %qD of type %qT from " > + "a function with incompatible type %qT", > + bltin, rhstype, type); > else > - pedwarn (location, OPT_Wincompatible_pointer_types, > - "returning %qT from a function with incompatible " > - "return type %qT", rhstype, type); > + permerror_opt (location, OPT_Wincompatible_pointer_types, > + "returning %qT from a function with " > + "incompatible return type %qT", rhstype, type); > break; > default: > gcc_unreachable (); > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 831242d134b..be33da71c44 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -6183,6 +6183,7 @@ that have their own flag: > @gccoptlist{ > -Wimplicit-function-declaration @r{(C)} > -Wimplicit-int @r{(C)} > +-Wincompatible-pointer-types @r{(C)} > -Wint-conversion @r{(C)} > -Wnarrowing @r{(C++)} > -Wreturn-mismatch @r{(C)} > @@ -8549,6 +8550,11 @@ types. This warning is for cases not covered by @option{-Wno-pointer-sign}, > which warns for pointer argument passing or assignment with different > signedness. > > +By default, in C99 and later dialects of C, GCC treats this issue as an > +error. The error can be downgraded to a warning using > +@option{-fpermissive} (along with certain other errors), or for this > +error alone, with @option{-Wno-error=incompatible-pointer-types}. > + > This warning is upgraded to an error by @option{-pedantic-errors}. > > @opindex Wno-int-conversion > diff --git a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-2.c b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-2.c > index 19276bbcfba..bbf983c1536 100644 > --- a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-2.c > +++ b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-2.c > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "" } */ > +/* { dg-options "-fpermissive" } */ > > void * > f1 (int flag, int *a, long *b) > diff --git a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-5.c b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-5.c > new file mode 100644 > index 00000000000..dcbfa4767de > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-5.c > @@ -0,0 +1,10 @@ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +void * > +f1 (int flag, int *a, long *b) > +{ > + return flag ? a : b; /* { dg-error "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > + /* { dg-note "first expression has type 'int \\*'" "" { target *-*-* } .-1 } */ > + /* { dg-note "second expression has type 'long int \\*'" "" { target *-*-* } .-2 } */ > +} > diff --git a/gcc/testsuite/gcc.dg/anon-struct-11.c b/gcc/testsuite/gcc.dg/anon-struct-11.c > index c2f85fc24e4..622fb7cacc6 100644 > --- a/gcc/testsuite/gcc.dg/anon-struct-11.c > +++ b/gcc/testsuite/gcc.dg/anon-struct-11.c > @@ -1,8 +1,7 @@ > /* { dg-do compile } */ > > -/* No special options--in particular, turn off the default > - -pedantic-errors option. */ > -/* { dg-options "" } */ > +/* Also turn off the default -pedantic-errors option. */ > +/* { dg-options "-fpermissive" } */ > > /* When not using -fplan9-extensions, we don't support automatic > conversion of pointer types, and we don't support referring to a > diff --git a/gcc/testsuite/gcc.dg/anon-struct-11a.c b/gcc/testsuite/gcc.dg/anon-struct-11a.c > new file mode 100644 > index 00000000000..9ee3bb63ebf > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/anon-struct-11a.c > @@ -0,0 +1,111 @@ > +/* { dg-do compile } */ > + > +/* No special options--in particular, turn off the default > + -pedantic-errors option. */ > +/* { dg-options "" } */ > + > +/* When not using -fplan9-extensions, we don't support automatic > + conversion of pointer types, and we don't support referring to a > + typedef name directly. */ > + > +extern void exit (int); > +extern void abort (void); > + > +struct A { char a; }; > + > +struct B { > + char b; > + struct A; /* { dg-warning "does not declare anything" } */ > + char c; > +}; > + > +void > +f1 (struct A *p) /* { dg-message "expected" } */ > +{ > + p->a = 1; > +} > + > +void > +test1 (void) > +{ > + struct B b; > + struct A *p; > + > + b.b = 2; > + b.c = 3; > + f1 (&b); /* { dg-error "incompatible pointer type" } */ > + if (b.a != 1) /* { dg-error "no member" } */ > + abort (); > + if (b.b != 2 || b.c != 3) > + abort (); > + p = &b; /* { dg-error "incompatible pointer type" } */ > + if (p->a != 1) > + abort (); > +} > + > +typedef struct { char d; } D; > + > +struct E { > + char b; > + struct F { char f; }; /* { dg-warning "does not declare anything" } */ > + char c; > + union { > + D; /* { dg-warning "does not declare anything" } */ > + }; > + char e; > +}; > + > +void > +f2 (struct F *p) /* { dg-message "expected" } */ > +{ > + p->f = 6; > +} > + > +void > +f3 (D *p) /* { dg-message "expected" } */ > +{ > + p->d = 4; > +} > + > +void > +f4 (D d) > +{ > +} > + > +void > +test2 (void) > +{ > + struct E e; > + struct F *pf; > + D *pd; > + D d; > + > + e.b = 2; > + e.c = 3; > + e.e = 5; > + f2 (&e); /* { dg-error "incompatible pointer type" } */ > + f3 (&e); /* { dg-error "incompatible pointer type" } */ > + if (e.d != 4) /* { dg-error "no member" } */ > + abort (); > + if (e.f != 6) /* { dg-error "no member" } */ > + abort (); > + if (e.b != 2 || e.c != 3 || e.e != 5) > + abort (); > + pf = &e; /* { dg-error "incompatible pointer type" } */ > + if (pf->f != 6) > + abort (); > + pd = &e; /* { dg-error "incompatible pointer type" } */ > + if (pd->d != 4) > + abort (); > + d = e.D; /* { dg-error "no member" } */ > + f3 (&e.D); /* { dg-error "no member" } */ > + f4 (e.D); /* { dg-error "no member" } */ > +} > + > +int > +main () > +{ > + test1 (); > + test2 (); > + exit (0); > +} > diff --git a/gcc/testsuite/gcc.dg/anon-struct-13.c b/gcc/testsuite/gcc.dg/anon-struct-13.c > index 6a508141bac..de478b9684b 100644 > --- a/gcc/testsuite/gcc.dg/anon-struct-13.c > +++ b/gcc/testsuite/gcc.dg/anon-struct-13.c > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-fplan9-extensions" } */ > +/* { dg-options "-fpermissive -fplan9-extensions" } */ > > /* Test for ambiguity when using the Plan 9 extensions. */ > > diff --git a/gcc/testsuite/gcc.dg/anon-struct-13a.c b/gcc/testsuite/gcc.dg/anon-struct-13a.c > new file mode 100644 > index 00000000000..9e6c5d96595 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/anon-struct-13a.c > @@ -0,0 +1,76 @@ > +/* { dg-do compile } */ > +/* { dg-options "-fplan9-extensions" } */ > + > +/* Test for ambiguity when using the Plan 9 extensions. */ > + > +struct A { > + char a; /* { dg-error "duplicate member" } */ > +}; > + > +struct B > +{ > + struct A; > + struct A; > +}; > + > +char > +f1 (struct B *p) > +{ > + return p->a; /* { dg-error "no member" } */ > +} > + > +void > +f2 (struct A *p) /* { dg-message "expected" } */ > +{ > +} > + > +void > +f3 (struct B *p) > +{ > + f2 (p); /* { dg-error "incompatible pointer type" } */ > +} > + > +struct C > +{ > + char c; /* { dg-error "duplicate member" } */ > +}; > + > +struct D > +{ > + struct C; > +}; > + > +struct E > +{ > + struct C; > + struct D; > +}; > + > +char > +f4 (struct E *p) > +{ > + return p->c; /* { dg-error "no member" } */ > +} > + > +void > +f6 (struct C *p) /* { dg-message "expected" } */ > +{ > +} > + > +void > +f7 (struct E *p) > +{ > + f6 (p); /* { dg-error "incompatible pointer type" } */ > +} > + > +struct A > +f8 (struct B *p) > +{ > + return p->A; /* { dg-error "no member" } */ > +} > + > +struct C > +f9 (struct E *p) > +{ > + return p->C; /* { dg-error "no member" } */ > +} > diff --git a/gcc/testsuite/gcc.dg/builtin-arith-overflow-4.c b/gcc/testsuite/gcc.dg/builtin-arith-overflow-4.c > index ab7d82a8d83..4c2c89ff616 100644 > --- a/gcc/testsuite/gcc.dg/builtin-arith-overflow-4.c > +++ b/gcc/testsuite/gcc.dg/builtin-arith-overflow-4.c > @@ -1,6 +1,6 @@ > /* PR c/90628 */ > /* { dg-do compile } */ > -/* { dg-options "" } */ > +/* { dg-options "-fpermissive" } */ > > _Atomic int a = 1, b = 2, c = 3; > _Atomic long d = 4, e = 5, f = 6; > diff --git a/gcc/testsuite/gcc.dg/builtin-arith-overflow-4a.c b/gcc/testsuite/gcc.dg/builtin-arith-overflow-4a.c > new file mode 100644 > index 00000000000..c021cabdc24 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/builtin-arith-overflow-4a.c > @@ -0,0 +1,43 @@ > +/* PR c/90628 */ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +_Atomic int a = 1, b = 2, c = 3; > +_Atomic long d = 4, e = 5, f = 6; > +_Atomic long long g = 7, h = 8, i = 9; > + > +void > +f1 () > +{ > + __builtin_add_overflow (a, b, &c); /* { dg-error "argument 3 in call to function '__builtin_add_overflow' has pointer to '_Atomic' type" } */ > +} > + > +void > +f2 () > +{ > + __builtin_sub_overflow (d, e, &f); /* { dg-error "argument 3 in call to function '__builtin_sub_overflow' has pointer to '_Atomic' type" } */ > +} > + > +void > +f3 () > +{ > + __builtin_mul_overflow (g, h, &i); /* { dg-error "argument 3 in call to function '__builtin_mul_overflow' has pointer to '_Atomic' type" } */ > +} > + > +void > +f4 () > +{ > + __builtin_sadd_overflow (a, b, &c); /* { dg-error "passing argument 3 of '__builtin_sadd_overflow' from incompatible pointer type" } */ > +} > + > +void > +f5 () > +{ > + __builtin_ssubl_overflow (d, e, &f); /* { dg-error "passing argument 3 of '__builtin_ssubl_overflow' from incompatible pointer type" } */ > +} > + > +void > +f6 () > +{ > + __builtin_smulll_overflow (g, h, &i); /* { dg-error "passing argument 3 of '__builtin_smulll_overflow' from incompatible pointer type" } */ > +} > diff --git a/gcc/testsuite/gcc.dg/c23-qual-4.c b/gcc/testsuite/gcc.dg/c23-qual-4.c > index 8a7a9f2be35..a8538de74e8 100644 > --- a/gcc/testsuite/gcc.dg/c23-qual-4.c > +++ b/gcc/testsuite/gcc.dg/c23-qual-4.c > @@ -83,9 +83,9 @@ void test(void) > (void)(1 ? x0 : z0); > (void)(1 ? x1 : z1); > (void)(1 ? x2 : z2); > - (void)(1 ? x0 : x1); /* { dg-warning "pointer type mismatch in conditional expression" } */ > - (void)(1 ? x1 : x2); /* { dg-warning "pointer type mismatch in conditional expression" } */ > - (void)(1 ? x2 : x0); /* { dg-warning "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x0 : x1); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x1 : x2); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x2 : x0); /* { dg-error "pointer type mismatch in conditional expression" } */ > v0p = (1 ? z0 : v0p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > v1p = (1 ? z1 : v1p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > v2p = (1 ? z2 : v2p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c > new file mode 100644 > index 00000000000..5c6d95cc200 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c > @@ -0,0 +1,58 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */ > + > +/* C99 6.2.7: Compatible type and composite type. */ > + > +#define DECIMAL_COMPOSITE_DECL(TYPE) \ > + _Decimal##TYPE g1_##TYPE(); \ > + _Decimal##TYPE g2_##TYPE(); \ > + _Decimal##TYPE (*h1_##TYPE)[2]; \ > + _Decimal##TYPE (*h2_##TYPE)[3]; \ > + _Decimal##TYPE (*h3_##TYPE)[4]; \ > + _Decimal##TYPE f1_##TYPE(_Decimal##TYPE(*)()); \ > + _Decimal##TYPE f1_##TYPE(_Decimal##TYPE(*)(_Decimal##TYPE*)); \ > + _Decimal##TYPE f1_##TYPE (_Decimal##TYPE(*g)(_Decimal##TYPE*)) \ > + { \ > + _Decimal##TYPE d##TYPE; \ > + d##TYPE = ((_Decimal##TYPE (*) (_Decimal##TYPE*)) g)(&d##TYPE); \ > + d##TYPE = ((_Decimal##TYPE (*) ()) g); \ > + return d##TYPE; \ > + } \ > + _Decimal##TYPE f2_##TYPE(_Decimal##TYPE(*)[]); \ > + _Decimal##TYPE f2_##TYPE(_Decimal##TYPE(*)[3]); > + > +#define DECIMAL_COMPOSITE_TEST(TYPE) \ > +do \ > +{ \ > + _Decimal##TYPE d##TYPE; \ > + d##TYPE = f1_##TYPE(g1_##TYPE); \ > + d##TYPE = f1_##TYPE(g2_##TYPE); \ > + d##TYPE = f2_##TYPE(h1_##TYPE); \ > + d##TYPE = f2_##TYPE(h2_##TYPE); \ > + d##TYPE = f2_##TYPE(h3_##TYPE); \ > + (void) d##TYPE; \ > +} while(0) > + > +DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */ > +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ > + > + > +DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */ > +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ > + > + > +DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */ > +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } .-1 } */ > + > + > +int main() > +{ > + DECIMAL_COMPOSITE_TEST(32); /* { dg-error "incompatible pointer type" } */ > + DECIMAL_COMPOSITE_TEST(64); /* { dg-error "incompatible pointer type" } */ > + DECIMAL_COMPOSITE_TEST(128); /* { dg-error "incompatible pointer type" } */ > + > + return 0; > +} > + > +/* The invalid function redeclarations might also trigger: > + { dg-prune-output "-Warray-parameter" } */ > diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c > index ce7d5c1a0a0..2eb601400b5 100644 > --- a/gcc/testsuite/gcc.dg/dfp/composite-type.c > +++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */ > +/* { dg-options "-fpermissive -O -Wall -ftrack-macro-expansion=0" } */ > > /* C99 6.2.7: Compatible type and composite type. */ > > diff --git a/gcc/testsuite/gcc.dg/diag-aka-1.c b/gcc/testsuite/gcc.dg/diag-aka-1.c > index 3383c1c263b..485a8a5f85d 100644 > --- a/gcc/testsuite/gcc.dg/diag-aka-1.c > +++ b/gcc/testsuite/gcc.dg/diag-aka-1.c > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-Wc++-compat" } */ > +/* { dg-options "-fpermissive -Wc++-compat" } */ > > typedef struct A { int i; } B; > typedef struct T { int i; } *T; /* { dg-warning "using 'T' as both a typedef and a tag is invalid" } */ > diff --git a/gcc/testsuite/gcc.dg/diag-aka-1a.c b/gcc/testsuite/gcc.dg/diag-aka-1a.c > new file mode 100644 > index 00000000000..d161b785e7d > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/diag-aka-1a.c > @@ -0,0 +1,29 @@ > +/* { dg-do compile } */ > +/* { dg-options "-Wc++-compat" } */ > + > +typedef struct A { int i; } B; > +typedef struct T { int i; } *T; /* { dg-warning "using 'T' as both a typedef and a tag is invalid" } */ > +typedef const float TFA; > +typedef TFA TFB; > +typedef TFB TFC; > +typedef int IA[]; > +typedef IA *IAP; > +extern IAP arr[]; > + > +void fn1 (B *); /* { dg-message "expected 'B \\*' {aka 'struct A \\*'} but argument is of type 'struct B \\*'" } */ > +void fn2 (TFC *); > + > +void > +bar (B *b, int *i) > +{ > + fn1 ((struct B *) b); /* { dg-error "passing argument" } */ > + fn2 (i); /* { dg-error "passing argument" } */ > + sizeof (arr); /* { dg-error "invalid application of .sizeof. to incomplete type .int \\(\\*\\\[\\\]\\)\\\[\\\]." } */ > +} > + > +int > +foo (void *a) > +{ > + T t = a; /* { dg-warning "request for implicit conversion from 'void \\*' to 'T' {aka 'struct T \\*'} not" } */ > + return t->i; > +} > diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c > index 5fb150cee79..b7352f6ddc3 100644 > --- a/gcc/testsuite/gcc.dg/enum-compat-1.c > +++ b/gcc/testsuite/gcc.dg/enum-compat-1.c > @@ -3,7 +3,7 @@ > /* Origin: Joseph Myers , based on > PR c/6024 from Richard Earnshaw */ > /* { dg-do compile } */ > -/* { dg-options "" } */ > +/* { dg-options "-fpermissive" } */ > > /* Original test from PR c/6024. */ > enum e1 {a, b}; > diff --git a/gcc/testsuite/gcc.dg/enum-compat-2.c b/gcc/testsuite/gcc.dg/enum-compat-2.c > new file mode 100644 > index 00000000000..69509012480 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/enum-compat-2.c > @@ -0,0 +1,32 @@ > +/* Test that enumerated types are only considered compatible when they > + are the same type. PR c/6024. */ > +/* Origin: Joseph Myers , based on > + PR c/6024 from Richard Earnshaw */ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +/* Original test from PR c/6024. */ > +enum e1 {a, b}; > +enum e2 {c, d}; > + > +void f(enum e1); /* { dg-error "prototype" "error at decl" } */ > + > +void f(x) > + enum e2 x; /* { dg-error "doesn't match prototype" } */ > +{ > + return; > +} > + > +/* Other compatibility tests. */ > +enum e3 { A }; > +enum e4 { B }; > + > +enum e3 v3; > +enum e4 *p = &v3; /* { dg-error "incompatible" "incompatible pointer" } */ > +enum e3 *q = &v3; > + > +void g(enum e3); /* { dg-message "note: previous declaration" "error at first decl" } */ > +void g(enum e4); /* { dg-error "conflicting types" "error at second decl" } */ > + > +void h(enum e3); > +void h(enum e3); > diff --git a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c > index 5c8a101343e..7c2876cc998 100644 > --- a/gcc/testsuite/gcc.dg/func-ptr-conv-1.c > +++ b/gcc/testsuite/gcc.dg/func-ptr-conv-1.c > @@ -5,7 +5,7 @@ > are not permitted. PR c/11234. */ > /* Origin: Joseph Myers */ > /* { dg-do compile } */ > -/* { dg-options "-pedantic" } */ > +/* { dg-options "-fpermissive -pedantic" } */ > > void f(void); > > diff --git a/gcc/testsuite/gcc.dg/func-ptr-conv-2.c b/gcc/testsuite/gcc.dg/func-ptr-conv-2.c > new file mode 100644 > index 00000000000..a9884a6c919 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/func-ptr-conv-2.c > @@ -0,0 +1,56 @@ > +/* Conversions between function and object pointers are not permitted > + in any version of ISO C, even with casts, except for the special > + case of converting a null pointer constant to function pointer > + type. Likewise, comparisons between function and object pointers > + are not permitted. PR c/11234. */ > +/* Origin: Joseph Myers */ > +/* { dg-do compile } */ > +/* { dg-options "-pedantic" } */ > + > +void f(void); > + > +void *v1 = f; /* { dg-warning "12:pointer" "bad conversion" } */ > +void *v2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */ > +void *v3 = (void *)f; /* { dg-warning "12:pointer" "bad conversion" } */ > +void *v4 = (void *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ > +void *v5; > +char *c1 = f; /* { dg-error "12:pointer" "bad conversion" } */ > +char *c2 = &f; /* { dg-error "12:pointer" "bad conversion" } */ > +char *c3 = (char *)f; /* { dg-warning "12:pointer" "bad conversion" } */ > +char *c4 = (char *)&f; /* { dg-warning "12:pointer" "bad conversion" } */ > +char *c5; > +void (*fp)(void); > +int a; > + > +void > +g(void) > +{ > + v5 = f; /* { dg-warning "6:pointer" "bad conversion" } */ > + v5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */ > + v5 = (void *)f; /* { dg-warning "8:pointer" "bad conversion" } */ > + v5 = (void *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ > + c5 = f; /* { dg-error "6:pointer" "bad conversion" } */ > + c5 = &f; /* { dg-error "6:pointer" "bad conversion" } */ > + c5 = (char *)f; /* { dg-warning "8:pointer" "bad conversion" } */ > + c5 = (char *)&f; /* { dg-warning "8:pointer" "bad conversion" } */ > + fp = v5; /* { dg-warning "6:pointer" "bad conversion" } */ > + fp = c5; /* { dg-error "6:pointer" "bad conversion" } */ > + fp = (void (*)(void))v5; /* { dg-warning "8:pointer" "bad conversion" } */ > + fp = (void (*)(void))c5; /* { dg-warning "8:pointer" "bad conversion" } */ > + (a ? f : v3); /* { dg-warning "10:pointer" "bad conversion" } */ > + (a ? v2 : fp); /* { dg-warning "11:pointer" "bad conversion" } */ > + /* The following are OK. */ > + fp = 0; > + fp = (void *)0; > + fp = 0L; > + fp = (void (*)(void))0; > + fp = (void (*)(void))(void *)0; > + (a ? f : 0); > + (a ? f : (void *)0); > + (a ? (void *)0 : fp); > + (a ? 0 : fp); > +} > + > +/* The following are OK. */ > +void (*fp2)(void) = 0; > +void (*fp3)(void) = (void *)0; > diff --git a/gcc/testsuite/gcc.dg/init-bad-7.c b/gcc/testsuite/gcc.dg/init-bad-7.c > index de5e570978c..caa8c783d65 100644 > --- a/gcc/testsuite/gcc.dg/init-bad-7.c > +++ b/gcc/testsuite/gcc.dg/init-bad-7.c > @@ -1,6 +1,6 @@ > /* PR c/37724 */ > /* { dg-do compile } */ > -/* { dg-options "-std=gnu99 -pedantic" } */ > +/* { dg-options "-fpermissive -std=gnu99 -pedantic" } */ > > struct f > { > diff --git a/gcc/testsuite/gcc.dg/init-bad-7a.c b/gcc/testsuite/gcc.dg/init-bad-7a.c > new file mode 100644 > index 00000000000..9ead2901c4c > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/init-bad-7a.c > @@ -0,0 +1,12 @@ > +/* PR c/37724 */ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +struct f > +{ > + int *a; > +}; > + > +char b[10]; > +struct f g = {b}; /* { dg-error "initialization of 'int \\*' from incompatible pointer type" } */ > +/* { dg-note "near initialization for" "" { target *-*-* } .-1 } */ > diff --git a/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c b/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c > index 0618b4d8170..b783052d145 100644 > --- a/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c > +++ b/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c > @@ -4,6 +4,6 @@ typedef struct { int a; } b_t; > int foo (void) > { > b_t d; > - struct b_t *c = &d; /* { dg-warning "incompatible pointer type" } */ > + struct b_t *c = &d; /* { dg-error "incompatible pointer type" } */ > c->a; /* { dg-error "invalid use of undefined type" } */ > } > diff --git a/gcc/testsuite/gcc.dg/param-type-mismatch-2.c b/gcc/testsuite/gcc.dg/param-type-mismatch-2.c > index 91d998437d1..83bc360fbc9 100644 > --- a/gcc/testsuite/gcc.dg/param-type-mismatch-2.c > +++ b/gcc/testsuite/gcc.dg/param-type-mismatch-2.c > @@ -152,7 +152,7 @@ extern int callee_8 (int one, float *two, float (three)); /* { dg-line callee_8 > > int test_8 (int first, int *second, float third) > { > - return callee_8 (first, second, third); /* { dg-warning "passing argument 2 of 'callee_8' from incompatible pointer type" } */ > + return callee_8 (first, second, third); /* { dg-error "passing argument 2 of 'callee_8' from incompatible pointer type" } */ > /* { dg-begin-multiline-output "" } > return callee_8 (first, second, third); > ^~~~~~ > diff --git a/gcc/testsuite/gcc.dg/permerror-default.c b/gcc/testsuite/gcc.dg/permerror-default.c > index 9ed9814d69e..45b58b0131d 100644 > --- a/gcc/testsuite/gcc.dg/permerror-default.c > +++ b/gcc/testsuite/gcc.dg/permerror-default.c > @@ -52,24 +52,24 @@ int * > incompatible_pointer_types (int flag) > { > void f4 (int *); > - flag ? __builtin_abs : __builtin_labs; /* { dg-warning "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > + flag ? __builtin_abs : __builtin_labs; /* { dg-error "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > { > - int *p1 = __builtin_abs; /* { dg-warning "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > - p1 = __builtin_abs; /* { dg-warning "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p1 = __builtin_abs; /* { dg-error "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + p1 = __builtin_abs; /* { dg-error "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > } > { > - int *p2 = incompatible_pointer_types; /* { dg-warning "initialization of 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > - p2 = incompatible_pointer_types; /* { dg-warning "assignment to 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p2 = incompatible_pointer_types; /* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + p2 = incompatible_pointer_types; /* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > { > - int *p3 = &p2; /* { dg-warning "initialization of 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > - p3 = &p2; /* { dg-warning "assignment to 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p3 = &p2; /* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + p3 = &p2; /* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > } > - f4 (&p2); /* { dg-warning "passing argument 1 of 'f4' from incompatible pointer type \\\[-Wincompatible-pointer-types\\\]" } */ > + f4 (&p2); /* { dg-error "passing argument 1 of 'f4' from incompatible pointer type \\\[-Wincompatible-pointer-types\\\]" } */ > } > if (flag) > - return __builtin_abs; /* { dg-warning "returning pointer to '__builtin_abs' of type 'int \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + return __builtin_abs; /* { dg-error "returning pointer to '__builtin_abs' of type 'int \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > else > - return incompatible_pointer_types; /* { dg-warning "returning 'int \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + return incompatible_pointer_types; /* { dg-error "returning 'int \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > } > > void > diff --git a/gcc/testsuite/gcc.dg/permerror-gnu89-nopermissive.c b/gcc/testsuite/gcc.dg/permerror-gnu89-nopermissive.c > index dc282a44489..93504b94139 100644 > --- a/gcc/testsuite/gcc.dg/permerror-gnu89-nopermissive.c > +++ b/gcc/testsuite/gcc.dg/permerror-gnu89-nopermissive.c > @@ -54,22 +54,22 @@ incompatible_pointer_types (int flag) > void f4 (int *); > flag ? __builtin_abs : __builtin_labs; /* { dg-warning "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > { > - int *p1 = __builtin_abs; /* { dg-warning "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > - p1 = __builtin_abs; /* { dg-warning "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p1 = __builtin_abs; /* { dg-error "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + p1 = __builtin_abs; /* { dg-error "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > } > { > - int *p2 = incompatible_pointer_types; /* { dg-warning "initialization of 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > - p2 = incompatible_pointer_types; /* { dg-warning "assignment to 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p2 = incompatible_pointer_types; /* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > + p2 = incompatible_pointer_types; /* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > { > - int *p3 = &p2; /* { dg-warning "initialization of 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > - p3 = &p2; /* { dg-warning "assignment to 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + int *p3 = &p2; /* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + p3 = &p2; /* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > } > - f4 (&p2); /* { dg-warning "passing argument 1 of 'f4' from incompatible pointer type \\\[-Wincompatible-pointer-types\\\]" } */ > + f4 (&p2); /* { dg-error "passing argument 1 of 'f4' from incompatible pointer type \\\[-Wincompatible-pointer-types\\\]" } */ > } > if (flag) > - return __builtin_abs; /* { dg-warning "returning pointer to '__builtin_abs' of type 'int \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + return __builtin_abs; /* { dg-error "returning pointer to '__builtin_abs' of type 'int \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > else > - return incompatible_pointer_types; /* { dg-warning "returning 'int \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > + return incompatible_pointer_types; /* { dg-error "returning 'int \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" } */ > } > > void > diff --git a/gcc/testsuite/gcc.dg/permerror-pedantic.c b/gcc/testsuite/gcc.dg/permerror-pedantic.c > index 852e7daa38d..95dda18acd4 100644 > --- a/gcc/testsuite/gcc.dg/permerror-pedantic.c > +++ b/gcc/testsuite/gcc.dg/permerror-pedantic.c > @@ -52,7 +52,7 @@ int * > incompatible_pointer_types (int flag) > { > void f4 (int *); > - flag ? __builtin_abs : __builtin_labs; /* { dg-warning "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > + flag ? __builtin_abs : __builtin_labs; /* { dg-error "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ > { > int *p1 = __builtin_abs; /* { dg-error "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > p1 = __builtin_abs; /* { dg-error "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" } */ > diff --git a/gcc/testsuite/gcc.dg/permerror-system.c b/gcc/testsuite/gcc.dg/permerror-system.c > index f00420358d9..bd923138461 100644 > --- a/gcc/testsuite/gcc.dg/permerror-system.c > +++ b/gcc/testsuite/gcc.dg/permerror-system.c > @@ -28,5 +28,16 @@ > /* { dg-error "assignment to 'int \\\*' from 'int' makes pointer from integer without a cast \\\[-Wint-conversion\\\]" "" { target *-*-* } 46 } */ > /* { dg-error "returning 'int \\\*' from a function with return type 'int' makes integer from pointer without a cast \\\[-Wint-conversion\\\]" "" { target *-*-* } 48 } */ > > +/* { dg-error "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 55 } */ > +/* { dg-error "initialization of 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 57 } */ > +/* { dg-error "assignment to 'int \\\*' from pointer to '__builtin_abs' with incompatible type 'int \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 58 } */ > +/* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 61 } */ > +/* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\* \\\(\\\*\\\)\\\(int\\\)' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 62 } */ > +/* { dg-error "initialization of 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 64 } */ > +/* { dg-error "assignment to 'int \\\*' from incompatible pointer type 'int \\\*\\\*' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 65 } */ > +/* { dg-error "passing argument 1 of 'f4' from incompatible pointer type \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 67 } */ > +/* { dg-error "returning pointer to '__builtin_abs' of type 'int \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 70 } */ > +/* { dg-error "returning 'int \\\* \\\(\\\*\\\)\\\(int\\\)' from a function with incompatible return type 'int \\\*' \\\[-Wincompatible-pointer-types\\\]" "" { target *-*-* } 72 } */ > + > /* { dg-error "'return' with a value, in function returning void \\\[-Wreturn-mismatch\\\]" "" { target *-*-* } 78 } */ > /* { dg-error "return' with no value, in function returning non-void \\\[-Wreturn-mismatch\\\]" "" { target *-*-* } 84 } */ > diff --git a/gcc/testsuite/gcc.dg/pointer-array-atomic-2.c b/gcc/testsuite/gcc.dg/pointer-array-atomic-2.c > new file mode 100644 > index 00000000000..de63ff141a3 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pointer-array-atomic-2.c > @@ -0,0 +1,60 @@ > +/* { dg-do compile } */ > +/* { dg-options "-std=c11" } */ > +/* Origin: Martin Uecker */ > +void tvoid(void* x); > +void transpose0(double* out, _Atomic double* in) { } > +void transpose1(double out[2][2], _Atomic double in[2][2]) { } > +void transpose2(double out[2][2][2], _Atomic double in[2][2][2]) { } > +// return > +int (*x2(_Atomic int x[3][3]))[3] { return x; } /* { dg-error "returning '_Atomic int \\(\\*\\)\\\[3\\\]' from a function with incompatible return type" } */ > +_Atomic int (*x3(int x[3][3]))[3] { return x; } /* { dg-error "returning 'int \\(\\*\\)\\\[3\\\]' from a function with incompatible return type" } */ > +void test(void) > +{ > + double x0[2]; > + double y0[2]; > + _Atomic double z0[4]; > + double x1[2][2]; > + double y1[2][2]; > + double o1[2][3]; > + _Atomic double z1[2][2]; > + double x2[2][2][2]; > + double y2[2][2][2]; > + double o2[2][2][3]; > + _Atomic double z2[2][2][2]; > + tvoid(z0); > + tvoid(z1); > + tvoid(z2); > + // passing as arguments > + transpose0(y0, x0); /* { dg-error "passing argument 2 of 'transpose0' from incompatible pointer type" } */ > + transpose1(y1, o1); /* { dg-error "passing argument 2 of 'transpose1' from incompatible pointer type" } */ > + transpose1(y1, x1); /* { dg-error "passing argument 2 of 'transpose1' from incompatible pointer type" } */ > + transpose2(y2, o2); /* { dg-error "passing argument 2 of 'transpose2' from incompatible pointer type" } */ > + transpose2(y2, x2); /* { dg-error "passing argument 2 of 'transpose2' from incompatible pointer type" } */ > + // initialization > + _Atomic double (*x0p) = x0; /* { dg-error "initialization of '_Atomic double \\*' from incompatible pointer type" } */ > + _Atomic double (*x1p)[2] = x1; /* { dg-error "initialization of '_Atomic double \\(\\*\\)\\\[2\\\]' from incompatible pointer type" } */ > + _Atomic double (*x2p)[2][2] = x2; /* { dg-error "initialization of '_Atomic double \\(\\*\\)\\\[2\\\]\\\[2\\\]' from incompatible pointer type" } */ > + // assignment > + x0p = x0; /* { dg-error "assignment to '_Atomic double \\*' from incompatible pointer type" } */ > + x1p = x1; /* { dg-error "assignment to '_Atomic double \\(\\*\\)\\\[2\\\]' from incompatible pointer type" } */ > + x2p = x2; /* { dg-error "assignment to '_Atomic double \\(\\*\\)\\\[2\\\]\\\[2\\\]' from incompatible pointer type" } */ > + // subtraction > + &(x0[1]) - &(z0[0]); /* { dg-error "invalid operands to binary" } */ > + &(x1[1]) - &(z1[0]); /* { dg-error "invalid operands to binary" } */ > + &(x2[1]) - &(z2[0]); /* { dg-error "invalid operands to binary" } */ > + // comparison > + x0 == z0; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x1 == z1; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x2 == z2; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x0 > z0; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x1 > z1; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x2 > z2; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x0 < z0; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x1 < z1; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + x2 < z2; /* { dg-warning "comparison of distinct pointer types lacks a cast" } */ > + // conditional expressions > + (void)(1 ? x0 : z0); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x1 : z1); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x2 : z2); /* { dg-error "pointer type mismatch in conditional expression" } */ > +} > + > diff --git a/gcc/testsuite/gcc.dg/pointer-array-atomic.c b/gcc/testsuite/gcc.dg/pointer-array-atomic.c > index bb63797b237..87d177a71a4 100644 > --- a/gcc/testsuite/gcc.dg/pointer-array-atomic.c > +++ b/gcc/testsuite/gcc.dg/pointer-array-atomic.c > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-std=c11" } */ > +/* { dg-options "-fpermissive -std=c11" } */ > /* Origin: Martin Uecker */ > void tvoid(void* x); > void transpose0(double* out, _Atomic double* in) { } > diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c > index 498ab223162..be80912723a 100644 > --- a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c > +++ b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c > @@ -84,9 +84,9 @@ void test(void) > (void)(1 ? x0 : z0); > (void)(1 ? x1 : z1); > (void)(1 ? x2 : z2); > - (void)(1 ? x0 : x1); /* { dg-warning "pointer type mismatch in conditional expression" } */ > - (void)(1 ? x1 : x2); /* { dg-warning "pointer type mismatch in conditional expression" } */ > - (void)(1 ? x2 : x0); /* { dg-warning "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x0 : x1); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x1 : x2); /* { dg-error "pointer type mismatch in conditional expression" } */ > + (void)(1 ? x2 : x0); /* { dg-error "pointer type mismatch in conditional expression" } */ > v0p = (1 ? z0 : v0p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > v1p = (1 ? z1 : v1p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > v2p = (1 ? z2 : v2p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */ > diff --git a/gcc/testsuite/gcc.dg/transparent-union-1.c b/gcc/testsuite/gcc.dg/transparent-union-1.c > index 3f0c260c906..518adfb6ce0 100644 > --- a/gcc/testsuite/gcc.dg/transparent-union-1.c > +++ b/gcc/testsuite/gcc.dg/transparent-union-1.c > @@ -1,6 +1,6 @@ > /* PR c/20043 */ > /* { dg-do compile } */ > -/* { dg-options "-std=gnu99" } */ > +/* { dg-options "-fpermissive -std=gnu99" } */ > > extern void f0 (int *); > extern void f0 (int *__restrict); > diff --git a/gcc/testsuite/gcc.dg/transparent-union-1a.c b/gcc/testsuite/gcc.dg/transparent-union-1a.c > new file mode 100644 > index 00000000000..9796ceab490 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/transparent-union-1a.c > @@ -0,0 +1,85 @@ > +/* PR c/20043 */ > +/* { dg-do compile } */ > +/* { dg-options "-std=gnu99" } */ > + > +extern void f0 (int *); > +extern void f0 (int *__restrict); > + > +extern void f1 (int *__restrict); > +extern void f1 (int *); > + > +typedef union { int *i; long *l; } U2 > + __attribute__((transparent_union)); > +extern void f2 (U2); > +extern void f2 (int *); > + > +typedef union { int *__restrict i; long *__restrict l; } U3 > + __attribute__((transparent_union)); > +extern void f3 (U3); > +extern void f3 (int *__restrict); > + > +extern void f4 (U3); > +extern void f4 (int *); > + > +extern void f5 (U2); > +extern void f5 (int *__restrict); > + > +typedef union { long *l; int *i; } U6 > + __attribute__((transparent_union)); > +extern void f6 (U6); > +extern void f6 (int *); > + > +typedef union { long *__restrict l; int *__restrict i; } U7 > + __attribute__((transparent_union)); > +extern void f7 (U7); > +extern void f7 (int *__restrict); > + > +extern void f8 (U7); > +extern void f8 (int *); > + > +extern void f9 (U6); > +extern void f9 (int *__restrict); > + > +extern void f10 (U2); > +extern void f11 (U3); > +extern void f12 (U6); > +extern void f13 (U7); > + > +int i; > +long l; > + > +int > +main (void) > +{ > + f0 (&i); > + f0 (&l); /* { dg-error "passing argument 1 of 'f0' from incompatible pointer type" } */ > + f1 (&i); > + f1 (&l); /* { dg-error "passing argument 1 of 'f1' from incompatible pointer type" } */ > + f2 (&i); > + f2 (&l); /* { dg-error "passing argument 1 of 'f2' from incompatible pointer type" } */ > + f3 (&i); > + f3 (&l); /* { dg-error "passing argument 1 of 'f3' from incompatible pointer type" } */ > + f4 (&i); > + f4 (&l); /* { dg-error "passing argument 1 of 'f4' from incompatible pointer type" } */ > + f5 (&i); > + f5 (&l); /* { dg-error "passing argument 1 of 'f5' from incompatible pointer type" } */ > + f6 (&i); > + f6 (&l); /* { dg-error "passing argument 1 of 'f6' from incompatible pointer type" } */ > + f7 (&i); > + f7 (&l); /* { dg-error "passing argument 1 of 'f7' from incompatible pointer type" } */ > + f8 (&i); > + f8 (&l); /* { dg-error "passing argument 1 of 'f8' from incompatible pointer type" } */ > + f9 (&i); > + f9 (&l); /* { dg-error "passing argument 1 of 'f9' from incompatible pointer type" } */ > + f10 (&i); > + f10 (&l); > + f11 (&i); > + f11 (&l); > + f12 (&i); > + f12 (&l); > + f13 (&i); > + f13 (&l); > + return 0; > +} > + > +/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/acle/memtag_2a.c b/gcc/testsuite/gcc.target/aarch64/acle/memtag_2a.c > index 16db40df663..9ae371d8867 100644 > --- a/gcc/testsuite/gcc.target/aarch64/acle/memtag_2a.c > +++ b/gcc/testsuite/gcc.target/aarch64/acle/memtag_2a.c > @@ -17,12 +17,12 @@ test_memtag_warning_return_qualifier (void) > > v = __arm_mte_get_tag(c); /* { dg-warning {assignment} } */ > n = __arm_mte_get_tag(c); /* { dg-warning {assignment} } */ > - i = __arm_mte_get_tag(c); /* { dg-warning {assignment} } */ > + i = __arm_mte_get_tag(c); /* { dg-error {assignment} } */ > c = __arm_mte_get_tag(v); /* { dg-warning {assignment} } */ > n = __arm_mte_get_tag(v); /* { dg-warning {assignment} } */ > > - i = __arm_mte_create_random_tag (c, 0); /* { dg-warning {assignment} } */ > - i = __arm_mte_increment_tag (c, 0); /* { dg-warning {assignment} } */ > + i = __arm_mte_create_random_tag (c, 0); /* { dg-error {assignment} } */ > + i = __arm_mte_increment_tag (c, 0); /* { dg-error {assignment} } */ > > c = __arm_mte_get_tag(n); /* No warning. */ > d = __arm_mte_ptrdiff(c, i); /* No warning. */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_2.c > index a8288762695..5f4cbeaea2e 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_2.c > @@ -15,8 +15,8 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr, > svld1_s8 (pg, 0); > svld1_s32 (pg, (int32_t *) 0); > svld1_s8 (pg, void_ptr); > - svld1_s8 (pg, s_ptr); /* { dg-warning {passing argument 2 of 'svld1_s8' from incompatible pointer type} } */ > + svld1_s8 (pg, s_ptr); /* { dg-error {passing argument 2 of 'svld1_s8' from incompatible pointer type} } */ > svld1_f32 (pg, f32_ptr); > - svld1_f32 (pg, cf32_ptr); /* { dg-warning {passing argument 2 of 'svld1_f32' from incompatible pointer type} } */ > + svld1_f32 (pg, cf32_ptr); /* { dg-error {passing argument 2 of 'svld1_f32' from incompatible pointer type} } */ > return svld1_s8 (pg, s8_ptr); /* { dg-error {incompatible types when returning type 'svint8_t' but 'svuint8_t' was expected} } */ > } > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c > index cd849f89941..41bf2da0fab 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_1.c > @@ -14,7 +14,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svld1sb_gather_offset (pg, s8_ptr, s32); /* { dg-error {implicit declaration of function 'svld1sb_gather_offset'; did you mean 'svld1_gather_offset'} } */ > svld1sb_gather_offset_s32 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svld1sb_gather_offset_s32'} } */ > svld1sb_gather_offset_s32 (pg, s8_ptr, s32, 0); /* { dg-error {too many arguments to function 'svld1sb_gather_offset_s32'} } */ > - svld1sb_gather_offset_s32 (pg, s16_ptr, s32); /* { dg-warning {passing argument 2 of 'svld1sb_gather_s32offset_s32' from incompatible pointer type} } */ > + svld1sb_gather_offset_s32 (pg, s16_ptr, s32); /* { dg-error {passing argument 2 of 'svld1sb_gather_s32offset_s32' from incompatible pointer type} } */ > svld1sb_gather_offset_s32 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svld1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svld1sb_gather_offset_s32 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svld1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svld1sb_gather_offset_s32 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svld1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c > index 850eecf99f6..1261b49d487 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_2.c > @@ -14,7 +14,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svld1sb_gather_offset (pg, s8_ptr, s32); /* { dg-error {implicit declaration of function 'svld1sb_gather_offset'; did you mean 'svld1_gather_offset'} } */ > svld1sb_gather_offset_u32 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svld1sb_gather_offset_u32'} } */ > svld1sb_gather_offset_u32 (pg, s8_ptr, s32, 0); /* { dg-error {too many arguments to function 'svld1sb_gather_offset_u32'} } */ > - svld1sb_gather_offset_u32 (pg, s16_ptr, s32); /* { dg-warning {passing argument 2 of 'svld1sb_gather_s32offset_u32' from incompatible pointer type} } */ > + svld1sb_gather_offset_u32 (pg, s16_ptr, s32); /* { dg-error {passing argument 2 of 'svld1sb_gather_s32offset_u32' from incompatible pointer type} } */ > svld1sb_gather_offset_u32 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svld1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > svld1sb_gather_offset_u32 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svld1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > svld1sb_gather_offset_u32 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svld1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c > index 93a728593f9..518348d1146 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_3.c > @@ -14,7 +14,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svld1sb_gather_offset (pg, s8_ptr, s64); /* { dg-error {implicit declaration of function 'svld1sb_gather_offset'; did you mean 'svld1_gather_offset'} } */ > svld1sb_gather_offset_s64 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svld1sb_gather_offset_s64'} } */ > svld1sb_gather_offset_s64 (pg, s8_ptr, s64, 0); /* { dg-error {too many arguments to function 'svld1sb_gather_offset_s64'} } */ > - svld1sb_gather_offset_s64 (pg, s16_ptr, s64); /* { dg-warning {passing argument 2 of 'svld1sb_gather_s64offset_s64' from incompatible pointer type} } */ > + svld1sb_gather_offset_s64 (pg, s16_ptr, s64); /* { dg-error {passing argument 2 of 'svld1sb_gather_s64offset_s64' from incompatible pointer type} } */ > svld1sb_gather_offset_s64 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svld1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > svld1sb_gather_offset_s64 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svld1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > svld1sb_gather_offset_s64 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svld1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c > index d54dc8eafab..6086911fd5d 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_4.c > @@ -14,7 +14,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svld1sb_gather_offset (pg, s8_ptr, s64); /* { dg-error {implicit declaration of function 'svld1sb_gather_offset'; did you mean 'svld1_gather_offset'} } */ > svld1sb_gather_offset_u64 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svld1sb_gather_offset_u64'} } */ > svld1sb_gather_offset_u64 (pg, s8_ptr, s64, 0); /* { dg-error {too many arguments to function 'svld1sb_gather_offset_u64'} } */ > - svld1sb_gather_offset_u64 (pg, s16_ptr, s64); /* { dg-warning {passing argument 2 of 'svld1sb_gather_s64offset_u64' from incompatible pointer type} } */ > + svld1sb_gather_offset_u64 (pg, s16_ptr, s64); /* { dg-error {passing argument 2 of 'svld1sb_gather_s64offset_u64' from incompatible pointer type} } */ > svld1sb_gather_offset_u64 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svld1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > svld1sb_gather_offset_u64 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svld1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > svld1sb_gather_offset_u64 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svld1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c > index 3b521d5c141..9e2cceec2e9 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_5.c > @@ -14,7 +14,7 @@ f1 (svbool_t pg, unsigned char *s8_ptr, unsigned short *s16_ptr, > svld1ub_gather_offset (pg, s8_ptr, s32); /* { dg-error {implicit declaration of function 'svld1ub_gather_offset'; did you mean 'svld1_gather_offset'} } */ > svld1ub_gather_offset_s32 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svld1ub_gather_offset_s32'} } */ > svld1ub_gather_offset_s32 (pg, s8_ptr, s32, 0); /* { dg-error {too many arguments to function 'svld1ub_gather_offset_s32'} } */ > - svld1ub_gather_offset_s32 (pg, s16_ptr, s32); /* { dg-warning {passing argument 2 of 'svld1ub_gather_s32offset_s32' from incompatible pointer type} } */ > + svld1ub_gather_offset_s32 (pg, s16_ptr, s32); /* { dg-error {passing argument 2 of 'svld1ub_gather_s32offset_s32' from incompatible pointer type} } */ > svld1ub_gather_offset_s32 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svld1ub_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svld1ub_gather_offset_s32 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svld1ub_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svld1ub_gather_offset_s32 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svld1ub_gather_offset_s32', which expects a vector of 32-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c > index 96d8ad55074..18e16630944 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_1.c > @@ -16,7 +16,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svldnt1sb_gather_offset (pg, s8_ptr, s32); /* { dg-error {implicit declaration of function 'svldnt1sb_gather_offset'; did you mean 'svldnt1_gather_offset'} } */ > svldnt1sb_gather_offset_s32 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svldnt1sb_gather_offset_s32'} } */ > svldnt1sb_gather_offset_s32 (pg, s8_ptr, u32, 0); /* { dg-error {too many arguments to function 'svldnt1sb_gather_offset_s32'} } */ > - svldnt1sb_gather_offset_s32 (pg, s16_ptr, u32); /* { dg-warning {passing argument 2 of 'svldnt1sb_gather_u32offset_s32' from incompatible pointer type} } */ > + svldnt1sb_gather_offset_s32 (pg, s16_ptr, u32); /* { dg-error {passing argument 2 of 'svldnt1sb_gather_u32offset_s32' from incompatible pointer type} } */ > svldnt1sb_gather_offset_s32 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svldnt1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svldnt1sb_gather_offset_s32 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svldnt1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > svldnt1sb_gather_offset_s32 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svldnt1sb_gather_offset_s32', which expects a vector of 32-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c > index 25ce7268a1e..6bb9998bff5 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_2.c > @@ -16,7 +16,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svldnt1sb_gather_offset (pg, s8_ptr, s32); /* { dg-error {implicit declaration of function 'svldnt1sb_gather_offset'; did you mean 'svldnt1_gather_offset'} } */ > svldnt1sb_gather_offset_u32 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svldnt1sb_gather_offset_u32'} } */ > svldnt1sb_gather_offset_u32 (pg, s8_ptr, u32, 0); /* { dg-error {too many arguments to function 'svldnt1sb_gather_offset_u32'} } */ > - svldnt1sb_gather_offset_u32 (pg, s16_ptr, u32); /* { dg-warning {passing argument 2 of 'svldnt1sb_gather_u32offset_u32' from incompatible pointer type} } */ > + svldnt1sb_gather_offset_u32 (pg, s16_ptr, u32); /* { dg-error {passing argument 2 of 'svldnt1sb_gather_u32offset_u32' from incompatible pointer type} } */ > svldnt1sb_gather_offset_u32 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svldnt1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > svldnt1sb_gather_offset_u32 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svldnt1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > svldnt1sb_gather_offset_u32 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svldnt1sb_gather_offset_u32', which expects a vector of 32-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c > index 04465f251b1..8dc160ce9c3 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_3.c > @@ -16,7 +16,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svldnt1sb_gather_offset (pg, s8_ptr, s64); /* { dg-error {implicit declaration of function 'svldnt1sb_gather_offset'; did you mean 'svldnt1_gather_offset'} } */ > svldnt1sb_gather_offset_s64 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svldnt1sb_gather_offset_s64'} } */ > svldnt1sb_gather_offset_s64 (pg, s8_ptr, s64, 0); /* { dg-error {too many arguments to function 'svldnt1sb_gather_offset_s64'} } */ > - svldnt1sb_gather_offset_s64 (pg, s16_ptr, s64); /* { dg-warning {passing argument 2 of 'svldnt1sb_gather_s64offset_s64' from incompatible pointer type} } */ > + svldnt1sb_gather_offset_s64 (pg, s16_ptr, s64); /* { dg-error {passing argument 2 of 'svldnt1sb_gather_s64offset_s64' from incompatible pointer type} } */ > svldnt1sb_gather_offset_s64 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svldnt1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > svldnt1sb_gather_offset_s64 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svldnt1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > svldnt1sb_gather_offset_s64 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svldnt1sb_gather_offset_s64', which expects a vector of 64-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c > index 479be66996d..9a418f28089 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/load_ext_gather_offset_restricted_4.c > @@ -16,7 +16,7 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svldnt1sb_gather_offset (pg, s8_ptr, s64); /* { dg-error {implicit declaration of function 'svldnt1sb_gather_offset'; did you mean 'svldnt1_gather_offset'} } */ > svldnt1sb_gather_offset_u64 (pg, s8_ptr); /* { dg-error {too few arguments to function 'svldnt1sb_gather_offset_u64'} } */ > svldnt1sb_gather_offset_u64 (pg, s8_ptr, s64, 0); /* { dg-error {too many arguments to function 'svldnt1sb_gather_offset_u64'} } */ > - svldnt1sb_gather_offset_u64 (pg, s16_ptr, s64); /* { dg-warning {passing argument 2 of 'svldnt1sb_gather_s64offset_u64' from incompatible pointer type} } */ > + svldnt1sb_gather_offset_u64 (pg, s16_ptr, s64); /* { dg-error {passing argument 2 of 'svldnt1sb_gather_s64offset_u64' from incompatible pointer type} } */ > svldnt1sb_gather_offset_u64 (pg, s8_ptr, pg); /* { dg-error {passing 'svbool_t' to argument 3 of 'svldnt1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > svldnt1sb_gather_offset_u64 (pg, s8_ptr, s8); /* { dg-error {passing 'svint8_t' to argument 3 of 'svldnt1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > svldnt1sb_gather_offset_u64 (pg, s8_ptr, s16); /* { dg-error {passing 'svint16_t' to argument 3 of 'svldnt1sb_gather_offset_u64', which expects a vector of 64-bit integers} } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c > index 01cfd14f873..b0389fa00a8 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c > @@ -105,8 +105,8 @@ statements (int n) > > /* Pointer assignment. */ > > - gnu_sc_ptr = sve_sc_ptr; /* { dg-warning {assignment to [^\n]* from incompatible pointer type} } */ > - sve_sc_ptr = gnu_sc_ptr; /* { dg-warning {assignment to [^\n]* from incompatible pointer type} } */ > + gnu_sc_ptr = sve_sc_ptr; /* { dg-error {assignment to [^\n]* from incompatible pointer type} } */ > + sve_sc_ptr = gnu_sc_ptr; /* { dg-error {assignment to [^\n]* from incompatible pointer type} } */ > > /* Pointer arithmetic. */ > > @@ -153,8 +153,8 @@ statements (int n) > 0 ? 0 : sve_sc1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ?: sve_sc1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? sve_sc_ptr : sve_sc_ptr; > - 0 ? sve_sc_ptr : gnu_sc_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > - 0 ? gnu_sc_ptr : sve_sc_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > + 0 ? sve_sc_ptr : gnu_sc_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > + 0 ? gnu_sc_ptr : sve_sc_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > > /* Generic associations. */ > > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c > index 613b9c47878..d16f40b5f2a 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c > @@ -105,8 +105,8 @@ statements (int n) > > /* Pointer assignment. */ > > - gnu_sc_ptr = sve_sc_ptr; /* { dg-warning {incompatible pointer type} } */ > - sve_sc_ptr = gnu_sc_ptr; /* { dg-warning {incompatible pointer type} } */ > + gnu_sc_ptr = sve_sc_ptr; /* { dg-error {incompatible pointer type} } */ > + sve_sc_ptr = gnu_sc_ptr; /* { dg-error {incompatible pointer type} } */ > > /* Pointer arithmetic. */ > > @@ -153,8 +153,8 @@ statements (int n) > 0 ? 0 : sve_sc1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ?: sve_sc1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? sve_sc_ptr : sve_sc_ptr; > - 0 ? sve_sc_ptr : gnu_sc_ptr; /* { dg-warning {pointer type mismatch} } */ > - 0 ? gnu_sc_ptr : sve_sc_ptr; /* { dg-warning {pointer type mismatch} } */ > + 0 ? sve_sc_ptr : gnu_sc_ptr; /* { dg-error {pointer type mismatch} } */ > + 0 ? gnu_sc_ptr : sve_sc_ptr; /* { dg-error {pointer type mismatch} } */ > > /* Generic associations. */ > > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_1.c > index 625f059af44..3669b3088a7 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_1.c > @@ -16,11 +16,11 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr, > svst1 (pg, void_ptr, 0); /* { dg-error {passing 'int' to argument 3 of 'svst1', which expects an SVE vector type} } */ > svst1 (pg, void_ptr, pg); /* { dg-error {'svst1' has no form that takes 'svbool_t' arguments} } */ > svst1 (pg, 0, s8); > - svst1 (pg, (int32_t *) 0, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > + svst1 (pg, (int32_t *) 0, s8); /* { dg-error "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > svst1 (pg, void_ptr, s8); > - svst1 (pg, s_ptr, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > - svst1 (pg, f32_ptr, s8); /* { dg-warning "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > + svst1 (pg, s_ptr, s8); /* { dg-error "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > + svst1 (pg, f32_ptr, s8); /* { dg-error "passing argument 2 of 'svst1_s8' from incompatible pointer type" } */ > svst1 (pg, f32_ptr, f32); > - svst1 (pg, cf32_ptr, f32); /* { dg-warning "passing argument 2 of 'svst1_f32' from incompatible pointer type" } */ > + svst1 (pg, cf32_ptr, f32); /* { dg-error "passing argument 2 of 'svst1_f32' from incompatible pointer type" } */ > svst1 (pg, s, s8); /* { dg-error {passing 'struct s' to argument 2 of 'svst1', which expects a scalar pointer} } */ > } > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_2.c > index 669f8844bc1..30a0a4c8586 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_2.c > @@ -18,10 +18,10 @@ f1 (svbool_t pg, signed char *s8_ptr, void *void_ptr, struct s *s_ptr, > svst1_vnum (pg, void_ptr, 0, 0); /* { dg-error {passing 'int' to argument 4 of 'svst1_vnum', which expects an SVE vector type} } */ > svst1_vnum (pg, void_ptr, 0, pg); /* { dg-error {'svst1_vnum' has no form that takes 'svbool_t' arguments} } */ > svst1_vnum (pg, 0, 0, s8); > - svst1_vnum (pg, (int32_t *) 0, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > + svst1_vnum (pg, (int32_t *) 0, 0, s8); /* { dg-error "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > svst1_vnum (pg, void_ptr, 0, s8); > - svst1_vnum (pg, s_ptr, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > - svst1_vnum (pg, f32_ptr, 0, s8); /* { dg-warning "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > + svst1_vnum (pg, s_ptr, 0, s8); /* { dg-error "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > + svst1_vnum (pg, f32_ptr, 0, s8); /* { dg-error "passing argument 2 of 'svst1_vnum_s8' from incompatible pointer type" } */ > svst1_vnum (pg, f32_ptr, 0, f32); > - svst1_vnum (pg, cf32_ptr, 0, f32); /* { dg-warning "passing argument 2 of 'svst1_vnum_f32' from incompatible pointer type" } */ > + svst1_vnum (pg, cf32_ptr, 0, f32); /* { dg-error "passing argument 2 of 'svst1_vnum_f32' from incompatible pointer type" } */ > } > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c > index 29f4510c49b..21bd93afb3f 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c > @@ -20,10 +20,10 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svst1_scatter_index (pg, 0, s32, s32); > svst1_scatter_index (pg, (int32_t *) 0, s32, s32); > svst1_scatter_index (pg, void_ptr, s32, s32); > - svst1_scatter_index (pg, s_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */ > - svst1_scatter_index (pg, f32_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */ > + svst1_scatter_index (pg, s_ptr, s32, s32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */ > + svst1_scatter_index (pg, f32_ptr, s32, s32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32index_s32' from incompatible pointer type" } */ > svst1_scatter_index (pg, f32_ptr, s32, f32); > - svst1_scatter_index (pg, cf32_ptr, s32, f32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32index_f32' from incompatible pointer type" } */ > + svst1_scatter_index (pg, cf32_ptr, s32, f32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32index_f32' from incompatible pointer type" } */ > svst1_scatter_index (pg, s, s32, s32); /* { dg-error {passing 'struct s' to argument 2 of 'svst1_scatter_index', which expects a vector or pointer base address} } */ > > svst1_scatter_index (pg, u32, void_ptr, s32); /* { dg-error "passing argument 3 of 'svst1_scatter_u32base_index_s32' makes integer from pointer without a cast" } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_restricted_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_restricted_1.c > index ab718b5eeee..ec99f8af23e 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_restricted_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_index_restricted_1.c > @@ -22,10 +22,10 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svstnt1_scatter_index (pg, 0, s64, s64); > svstnt1_scatter_index (pg, (int64_t *) 0, s64, s64); > svstnt1_scatter_index (pg, void_ptr, s64, s64); > - svstnt1_scatter_index (pg, s_ptr, s64, s64); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_s64index_s64' from incompatible pointer type" } */ > - svstnt1_scatter_index (pg, f32_ptr, s64, s64); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_s64index_s64' from incompatible pointer type" } */ > + svstnt1_scatter_index (pg, s_ptr, s64, s64); /* { dg-error "passing argument 2 of 'svstnt1_scatter_s64index_s64' from incompatible pointer type" } */ > + svstnt1_scatter_index (pg, f32_ptr, s64, s64); /* { dg-error "passing argument 2 of 'svstnt1_scatter_s64index_s64' from incompatible pointer type" } */ > svstnt1_scatter_index (pg, f64_ptr, s64, f64); > - svstnt1_scatter_index (pg, cf64_ptr, s64, f64); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_s64index_f64' from incompatible pointer type" } */ > + svstnt1_scatter_index (pg, cf64_ptr, s64, f64); /* { dg-error "passing argument 2 of 'svstnt1_scatter_s64index_f64' from incompatible pointer type" } */ > svstnt1_scatter_index (pg, s, s64, s64); /* { dg-error {passing 'struct s' to argument 2 of 'svstnt1_scatter_index', which expects a vector or pointer base address} } */ > > svstnt1_scatter_index (pg, u32, void_ptr, s32); /* { dg-error "passing argument 3 of 'svstnt1_scatter_u32base_index_s32' makes integer from pointer without a cast" } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c > index 311b1744c91..318f0dddfb1 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c > @@ -20,10 +20,10 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svst1_scatter_offset (pg, 0, s32, s32); > svst1_scatter_offset (pg, (int32_t *) 0, s32, s32); > svst1_scatter_offset (pg, void_ptr, s32, s32); > - svst1_scatter_offset (pg, s_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */ > - svst1_scatter_offset (pg, f32_ptr, s32, s32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */ > + svst1_scatter_offset (pg, s_ptr, s32, s32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */ > + svst1_scatter_offset (pg, f32_ptr, s32, s32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32offset_s32' from incompatible pointer type" } */ > svst1_scatter_offset (pg, f32_ptr, s32, f32); > - svst1_scatter_offset (pg, cf32_ptr, s32, f32); /* { dg-warning "passing argument 2 of 'svst1_scatter_s32offset_f32' from incompatible pointer type" } */ > + svst1_scatter_offset (pg, cf32_ptr, s32, f32); /* { dg-error "passing argument 2 of 'svst1_scatter_s32offset_f32' from incompatible pointer type" } */ > svst1_scatter_offset (pg, s, s32, s32); /* { dg-error {passing 'struct s' to argument 2 of 'svst1_scatter_offset', which expects a vector or pointer base address} } */ > > svst1_scatter_offset (pg, u32, void_ptr, s32); /* { dg-error "passing argument 3 of 'svst1_scatter_u32base_offset_s32' makes integer from pointer without a cast" } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c > index 5b251127a47..74bd7aefd70 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c > @@ -22,10 +22,10 @@ f1 (svbool_t pg, signed char *s8_ptr, short *s16_ptr, > svstnt1_scatter_offset (pg, 0, u32, s32); > svstnt1_scatter_offset (pg, (int32_t *) 0, u32, s32); > svstnt1_scatter_offset (pg, void_ptr, u32, s32); > - svstnt1_scatter_offset (pg, s_ptr, u32, s32); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */ > - svstnt1_scatter_offset (pg, f32_ptr, u32, s32); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */ > + svstnt1_scatter_offset (pg, s_ptr, u32, s32); /* { dg-error "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */ > + svstnt1_scatter_offset (pg, f32_ptr, u32, s32); /* { dg-error "passing argument 2 of 'svstnt1_scatter_u32offset_s32' from incompatible pointer type" } */ > svstnt1_scatter_offset (pg, f32_ptr, u32, f32); > - svstnt1_scatter_offset (pg, cf32_ptr, u32, f32); /* { dg-warning "passing argument 2 of 'svstnt1_scatter_u32offset_f32' from incompatible pointer type" } */ > + svstnt1_scatter_offset (pg, cf32_ptr, u32, f32); /* { dg-error "passing argument 2 of 'svstnt1_scatter_u32offset_f32' from incompatible pointer type" } */ > svstnt1_scatter_offset (pg, s, u32, s32); /* { dg-error {passing 'struct s' to argument 2 of 'svstnt1_scatter_offset', which expects a vector or pointer base address} } */ > > svstnt1_scatter_offset (pg, u32, void_ptr, s32); /* { dg-error "passing argument 3 of 'svstnt1_scatter_u32base_offset_s32' makes integer from pointer without a cast" } */ > diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_7.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_7.c > index 95be60591fb..5658a206fa3 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_7.c > +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_7.c > @@ -135,41 +135,41 @@ g (int c) > diff = gs8 - gs8; > > fs8 = ss8; // { dg-error {invalid conversion} "" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > fs8 = fs8; > fs8 = gs8; // { dg-error {invalid conversion} "" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > > fs8 = su8; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > fs8 = fu8; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > fs8 = gu8; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > > fs8 = ss16; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > fs8 = fs16; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > fs8 = gs16; // { dg-error {cannot convert} "c++" { target c++ } } > - // { dg-warning {incompatible pointer type} "c" { target c } .-1 } > + // { dg-error {incompatible pointer type} "c" { target c } .-1 } > > select = c ? ss8 : ss8; > select = c ? ss8 : fs8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > select = c ? ss8 : gs8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > > select = c ? fs8 : ss8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > select = c ? fs8 : fs8; > select = c ? fs8 : gs8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > > select = c ? gs8 : ss8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > select = c ? gs8 : fs8; // { dg-error {distinct pointer types} "" { target c++ } } > - // { dg-warning {pointer type mismatch} "c" { target c } .-1 } > + // { dg-error {pointer type mismatch} "c" { target c } .-1 } > select = c ? gs8 : gs8; > > diff = sb - sb; // { dg-error {arithmetic on pointer to SVE type 'svbool_t'} } > diff --git a/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c b/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c > index d1a76db25e9..599b02632fd 100644 > --- a/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c > +++ b/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c > @@ -181,8 +181,8 @@ __bf16 footest (__bf16 scalar0) > 0 ? 0.1 : scalar0; > 0 ? scalar0 : 0.1; > 0 ? bfloat_ptr : bfloat_ptr2; > - 0 ? bfloat_ptr : float_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > - 0 ? float_ptr : bfloat_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > + 0 ? bfloat_ptr : float_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > + 0 ? float_ptr : bfloat_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > > scalar0 ? scalar0 : scalar0; > scalar0 ? is_a_float : scalar0; > diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c > index 8bc3f4a7b8f..f8bdf2e71fd 100644 > --- a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c > +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c > @@ -224,8 +224,8 @@ __m128bf16 footest (__m128bf16 vector0) > 0 ? 0.1 : vector0; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? vector0 : 0.1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? bfloat_ptr : bfloat_ptr2; > - 0 ? bfloat_ptr : float_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > - 0 ? float_ptr : bfloat_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > + 0 ? bfloat_ptr : float_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > + 0 ? float_ptr : bfloat_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > > vector0 ? vector0 : vector0; /* { dg-error {used vector type where scalar is required} } */ > vector0 ? is_a_float16_vec : vector0; /* { dg-error {used vector type where scalar is required} } */ > diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c > index 2a8a535daae..b6b7a430efa 100644 > --- a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c > +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c > @@ -214,8 +214,8 @@ __m256bf16 footest (__m256bf16 vector0) > 0 ? 0.1 : vector0; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? vector0 : 0.1; /* { dg-error {type mismatch in conditional expression} } */ > 0 ? bfloat_ptr : bfloat_ptr2; > - 0 ? bfloat_ptr : float_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > - 0 ? float_ptr : bfloat_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ > + 0 ? bfloat_ptr : float_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > + 0 ? float_ptr : bfloat_ptr; /* { dg-error {pointer type mismatch in conditional expression} } */ > > vector0 ? vector0 : vector0; /* { dg-error {used vector type where scalar is required} } */ > vector0 ? is_a_float16_vec : vector0; /* { dg-error {used vector type where scalar is required} } */ > -- > 2.42.0 > >