From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 89147385802E; Wed, 31 Mar 2021 07:22:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89147385802E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBsdG8vOTk4MjhdIGlubGluaW5nIGZhaWxlZCBpbiBjYWxs?= =?UTF-8?B?IHRvIOKAmGFsd2F5c19pbmxpbmXigJkg4oCYbWVtY3B54oCZOiAtLXBhcmFt?= =?UTF-8?B?IG1heC1pbmxpbmUtaW5zbnMtYXV0byBsaW1pdCByZWFjaGVk?= Date: Wed, 31 Mar 2021 07:22:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org 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: Wed, 31 Mar 2021 07:22:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99828 --- Comment #6 from Richard Biener --- (In reply to Jan Hubicka from comment #5) > > Btw, one solution would be to drop __always_inline__ after always-inline > > inlining > > and thus make it reliably not present for IPA inlining. > Removing it would make you to lose those errors, but we can ignore it > for late inlining if we decide we do not really care about always > inlining indirect calls (that are not reliably inlined by early > inliner). >=20 > But I tried that at some point and broke kernel. >=20 > Note that we could also use syntactic aliase and consider two decls > unmergeable if they differ by always_inline attribute. That should make > it to behave consistently... Yeah, and then maybe diagnose this "ODR violation". Still __attribute__((__always_inline__)) void *memcpy(); void *foo =3D memcpy; should be ill-formed (but yeah, maybe this ship has sailed...). Now, I do wonder why during cgraph merging we prefer the non-definition declaration ... the code "works fine" if it's not memcpy but memcpyx (and thus not __builtin_memcpy but also memcpyx). I also wonder if we can get a better reduction of the kernel problem due to all the diagnostics I get: 1.i:1:42: warning: 'always_inline' function might not be inlinable [-Wattribute] 1 | __attribute__((__always_inline__)) void *memcpy(); | ^~~~~~ 3.i:5:1: warning: conflicting types for built-in function 'memcpy'; expected 'void *(void *, const void *, long unsigned int)' [-Wbuiltin-declaration-mismatch] 5 | memcpy(void *dest, void *src, long len) { | ^~~~~~ 1.i:1:42: warning: type of 'memcpy' does not match original declaration [-Wlto-type-mismatch] 1 | __attribute__((__always_inline__)) void *memcpy(); | ^ ...=