From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4DA563857802; Thu, 28 Oct 2021 19:12:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DA563857802 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102953] Improvements to CET-IBT and ENDBR generation Date: Thu, 28 Oct 2021 19:12:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 19:12:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102953 --- Comment #16 from H.J. Lu --- (In reply to Andrew Cooper from comment #14) > (In reply to H.J. Lu from comment #13) > > (In reply to Andrew Cooper from comment #11) > > >=20 > > > There should be a diagnostic, but it ought to include cf_check in the= type > > > it prints. > >=20 > > Try the v3 patch. >=20 > Thanks. Now get: >=20 > proto.c:2:37: error: conflicting types with implied 'nocf_check' attribute > for 'foo'; have 'void(void)' > 2 | static void __attribute__((unused)) foo(void) > | ^~~ > proto.c:1:39: note: previous declaration of 'foo' with type 'void(void)' > 1 | static void __attribute__((cf_check)) foo(void); > | ^~~ >=20 > which at least highlights the issue. Any variant like this, but possibly > even simply reporting 'void __attribute__((nocf_check))(void)' should be > fine. The v4 patch changed it to bar1.c:2:37: error: conflicting types for =E2=80=98foo=E2=80=99; have =E2= =80=98void(void)=E2=80=99 with implied =E2=80=98nocf_check=E2=80=99 attribute 2 | static void __attribute__((unused)) foo(void) | ^~~ bar1.c:1:39: note: previous declaration of =E2=80=98foo=E2=80=99 with type = =E2=80=98void(void)=E2=80=99 1 | static void __attribute__((cf_check)) foo(void); | ^~~ bar1.c:5:21: warning: initialization of =E2=80=98void (*)(void)=E2=80=99 fr= om incompatible pointer type =E2=80=98void (__attribute__((nocf_check)) *)(void)=E2=80=99 [-Wincompatible-pointer-types] 5 | void (*ptr)(void) =3D foo; | ^~~=