From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1561E38717DF; Sat, 10 Dec 2022 03:42:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1561E38717DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670643777; bh=MPoA4kH0govRucY+05lQfU55goL622rFaY2KEtMnPQA=; h=From:To:Subject:Date:From; b=UexUPNNWYoK4kGiqQwCNue+yQbmhdYdlDJUyn+GSO3fQ56TXehUtxj0pGU40lUA7x H/IdtM6/uq2AHNnKsJMpL7fh28yenVSXejWmtgiGKAbmwzUIQ2aHnpxPUYay10Jj6o vyx+n+u96b/905yP185ghz8zC+bUsWIJqMdhqdiU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108042] New: [10/11/12/13 Regression] weakref on an extern decl is incorrectly ignored Date: Sat, 10 Dec 2022 03:42:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108042 Bug ID: 108042 Summary: [10/11/12/13 Regression] weakref on an extern decl is incorrectly ignored Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- From: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Function-Attributes.ht= ml#index-weakref-function-attribute Without a target given as an argument to weakref or to alias, weakref is equivalent to weak (in that case the declaration may be extern). Testcase: ``` void KNOWNNOTOBEAFUNCTION(void) __attribute__((weakref)); int main() { if (KNOWNNOTOBEAFUNCTION) __builtin_abort(); else return 0; } ``` This should pass.=