public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og
       [not found] <bug-82601-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-02 22:02 ` msebor at gcc dot gnu.org
  2022-03-17 20:16 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-02 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org
   Last reconfirmed|2017-12-30 00:00:00         |2021-4-2
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=31279
      Known to fail|                            |10.2.0, 11.0, 8.3.0, 9.3.0
   Target Milestone|---                         |12.0
             Status|NEW                         |ASSIGNED

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Pr31279 asks for a warning for a warning for call-by-reference arguments with
known intent(in).  This is the converse, but as I mentioned in pr31279 comment
#7 the middle end infrastructure to issue these warnings is in place.  The
Fortran front end needs to make use of it.

That being said, detecting read accesses to write-only arguments within the
annotated function itself isn't implemented yet (only passing uninitialized
arguments to read-only arguments is).  So I suggest tracking the Fortran
changes in pr31279 and the missing middle-end support here.

$ cat z.c && gcc -S -Wall z.c
__attribute__ ((access (read_only, 1)))
void f1 (int *);

void f2 (void)
{
  int i;
  f1 (&i);         // -Wuninitialized (good)
}

__attribute__ ((access (write_only, 1)))
int g1 (int *p)
{
  return *p;       // missing warning
}

z.c: In function ‘f2’:
z.c:7:3: warning: ‘i’ is used uninitialized [-Wuninitialized]
    7 |   f1 (&i);         // -Wuninitialized (good)
      |   ^~~~~~~
z.c:2:6: note: in a call to ‘f1’ declared with attribute ‘access (read_only,
1)’ here
    2 | void f1 (int *);
      |      ^~
z.c:6:7: note: ‘i’ declared here
    6 |   int i;
      |       ^

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

* [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og
       [not found] <bug-82601-4@http.gcc.gnu.org/bugzilla/>
  2021-04-02 22:02 ` [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og msebor at gcc dot gnu.org
@ 2022-03-17 20:16 ` msebor at gcc dot gnu.org
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-03-17 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|msebor at gcc dot gnu.org          |

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm no longer working on this.

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

* [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og
       [not found] <bug-82601-4@http.gcc.gnu.org/bugzilla/>
  2021-04-02 22:02 ` [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og msebor at gcc dot gnu.org
  2022-03-17 20:16 ` msebor at gcc dot gnu.org
@ 2022-05-06  8:30 ` jakub at gcc dot gnu.org
  2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og
       [not found] <bug-82601-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-05-06  8:30 ` jakub at gcc dot gnu.org
@ 2023-05-08 12:21 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |12.4

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.

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

end of thread, other threads:[~2023-05-08 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-82601-4@http.gcc.gnu.org/bugzilla/>
2021-04-02 22:02 ` [Bug middle-end/82601] missing uninitialized warning for INTENT(OUT) argument with -O0 / -Og msebor at gcc dot gnu.org
2022-03-17 20:16 ` msebor at gcc dot gnu.org
2022-05-06  8:30 ` jakub at gcc dot gnu.org
2023-05-08 12:21 ` 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).