From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB6963858C56; Sat, 5 Nov 2022 17:00:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB6963858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667667618; bh=vRr9wi/s1tIBcBG+BucThF22TSbTC1BIr5q5fisHgpo=; h=From:To:Subject:Date:From; b=ec4a9e5qtbqC/KV5OjRjhGYmeyjOFvGdPd6fnsMkKUf+yCXvqz5X/kve2vx0/OygL BTvzz5OQqZsBxF4d9SLnnA1ASh8PUF42317wDqnIk0MqzS/BW3fdyWh6D96lO+txMV NQFVm8eBkkhQsl78AiALW4vkGmKSwvoBjGzBOMZI= From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/107536] New: [12 regression] Wrong 'not referenced' warning on renamed variable Date: Sat, 05 Nov 2022 17:00:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon at pushface dot 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 bug_severity priority component assigned_to reporter target_milestone attachments.created 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=3D107536 Bug ID: 107536 Summary: [12 regression] Wrong 'not referenced' warning on renamed variable Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: simon at pushface dot org Target Milestone: --- Created attachment 53834 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53834&action=3Dedit Demonstrator If a record has aspect Volatile_Full_Access, a renaming of one of the recor= d=E2=80=99s components will be reported as unreferenced even though it plainly is. $ gnatmake -gnatwa -c -u -f renaming.adb -gnatl gcc -c -gnatwa -gnatl renaming.adb GNAT 12.2.0 Copyright 1992-2022, Free Software Foundation, Inc. Compiling: renaming.adb Source file time stamp: 2022-11-05 16:48:11 Compiled at: 2022-11-05 16:50:40 1. procedure Renaming is 2. 3. type T is record 4. Item : Integer; 5. end record; 6. A_T : T; 7. Item : Integer renames A_T.Item; 8. 9. type VFA_T is record 10. Item : Integer; 11. end record 12. with Volatile_Full_Access; 13. A_VFA_T : VFA_T; 14. VFA_Item : Integer renames A_VFA_T.Item; | >>> warning: renamed variable "VFA_Item" is not referenced [-gnatwu] 15. 16. begin 17. Item :=3D 42; 18. VFA_Item :=3D 42; 19. end Renaming; 19 lines: No errors, 1 warning This is also present on 12.1.0.=