public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package
@ 2023-04-11 14:32 simon at pushface dot org
  2023-04-12  8:45 ` [Bug ada/109472] " ebotcazou at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: simon at pushface dot org @ 2023-04-11 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109472
           Summary: [13 regression] False unread/unassigned warning for
                    variable in local package
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54830&action=edit
Demonstrator

The compiler warns that a variable in a local package is not assigned and not
read, even though it is assigned and read in code outside the package.

GNAT 13.0.1 20230409 (experimental)
Copyright 1992-2023, Free Software Foundation, Inc.

Compiling: test_wu.adb
Source file time stamp: 2023-04-11 14:20:32
Compiled at: 2023-04-11 15:30:49

     1. procedure Test_Wu is
     2.
     3.   package P is
     4.     X : Integer;
            |
        >>> warning: variable "X" is never read and never assigned [-gnatwu]

     5.   end;
     6.
     7.   Y : Integer;
     8.
     9. begin
    10.   P.X := 5;
    11.   Y := P.X;
    12. end;

 12 lines: No errors, 1 warning

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

* [Bug ada/109472] [13 regression] False unread/unassigned warning for variable in local package
  2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
@ 2023-04-12  8:45 ` ebotcazou at gcc dot gnu.org
  2023-04-12 10:28 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-04-12  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2023-04-12
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
I can reproduce.

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

* [Bug ada/109472] [13 regression] False unread/unassigned warning for variable in local package
  2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
  2023-04-12  8:45 ` [Bug ada/109472] " ebotcazou at gcc dot gnu.org
@ 2023-04-12 10:28 ` rguenth at gcc dot gnu.org
  2023-04-12 14:31 ` dkm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-12 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Priority|P3                          |P4
           Keywords|                            |diagnostic

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

* [Bug ada/109472] [13 regression] False unread/unassigned warning for variable in local package
  2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
  2023-04-12  8:45 ` [Bug ada/109472] " ebotcazou at gcc dot gnu.org
  2023-04-12 10:28 ` rguenth at gcc dot gnu.org
@ 2023-04-12 14:31 ` dkm at gcc dot gnu.org
  2023-04-26  6:58 ` [Bug ada/109472] [13/14 regression] False unread/unassigned warning for variable in local package since r13-1626-ga8d17a88a52d2f rguenth at gcc dot gnu.org
  2023-07-27  9:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-04-12 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Regression starts from:

a8d17a88a52d2f773423adb55399d23ed5ea03c8 is the first bad commit
commit a8d17a88a52d2f773423adb55399d23ed5ea03c8
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue Jun 21 10:17:57 2022 +0200

    [Ada] Warn on unset objects in packages with no bodies

    Fix an inconsistency, where GNAT was warning about references to unset
    objects inside generic packages with no bodies but not inside ordinary
    packages with no bodies.

But the issue is probably not this particular change, that simply asks gnat to
warn on unreferenced entities. The error is most probably caused by the
Referenced(N) that returns False for 'X' entity.

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

* [Bug ada/109472] [13/14 regression] False unread/unassigned warning for variable in local package since r13-1626-ga8d17a88a52d2f
  2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
                   ` (2 preceding siblings ...)
  2023-04-12 14:31 ` dkm at gcc dot gnu.org
@ 2023-04-26  6:58 ` rguenth at gcc dot gnu.org
  2023-07-27  9:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |13.2

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

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

* [Bug ada/109472] [13/14 regression] False unread/unassigned warning for variable in local package since r13-1626-ga8d17a88a52d2f
  2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
                   ` (3 preceding siblings ...)
  2023-04-26  6:58 ` [Bug ada/109472] [13/14 regression] False unread/unassigned warning for variable in local package since r13-1626-ga8d17a88a52d2f rguenth at gcc dot gnu.org
@ 2023-07-27  9:25 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-27  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.2                        |13.3

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.

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

end of thread, other threads:[~2023-07-27  9:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 14:32 [Bug ada/109472] New: [13 regression] False unread/unassigned warning for variable in local package simon at pushface dot org
2023-04-12  8:45 ` [Bug ada/109472] " ebotcazou at gcc dot gnu.org
2023-04-12 10:28 ` rguenth at gcc dot gnu.org
2023-04-12 14:31 ` dkm at gcc dot gnu.org
2023-04-26  6:58 ` [Bug ada/109472] [13/14 regression] False unread/unassigned warning for variable in local package since r13-1626-ga8d17a88a52d2f rguenth at gcc dot gnu.org
2023-07-27  9:25 ` rguenth 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).