public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/107536] New: [12 regression] Wrong 'not referenced' warning on renamed variable
@ 2022-11-05 17:00 simon at pushface dot org
  2022-11-07  7:01 ` [Bug ada/107536] [12/13 " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: simon at pushface dot org @ 2022-11-05 17:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107536

            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=53834&action=edit
Demonstrator

If a record has aspect Volatile_Full_Access, a renaming of one of the record’s
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 := 42;
    18.    VFA_Item := 42;
    19. end Renaming;

 19 lines: No errors, 1 warning

This is also present on 12.1.0.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-11 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-05 17:00 [Bug ada/107536] New: [12 regression] Wrong 'not referenced' warning on renamed variable simon at pushface dot org
2022-11-07  7:01 ` [Bug ada/107536] [12/13 " rguenth at gcc dot gnu.org
2022-11-08 11:29 ` simon at pushface dot org
2023-05-08 12:25 ` [Bug ada/107536] [12/13/14 " rguenth at gcc dot gnu.org
2023-05-11 15:49 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).