public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104886] New: -Wdangling-pointer= prints internal MEM and (D) names in warnings
@ 2022-03-11 23:36 slyfox at gcc dot gnu.org
  2022-03-11 23:43 ` [Bug tree-optimization/104886] " pinskia at gcc dot gnu.org
  2022-03-14  7:56 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: slyfox at gcc dot gnu.org @ 2022-03-11 23:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104886
           Summary: -Wdangling-pointer= prints internal MEM and (D) names
                    in warnings
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed internal names on libuv-1.43.0. Here is the minimal example:

//$ cat a.c
struct uv_stream_s {
  int io_watcher;
  void *write_completed_queue[];
};

void uv__write_callbacks(struct uv_stream_s *stream) {
  int pq;
  if (*(int **)stream->write_completed_queue)
    ;
  *(int **)stream->write_completed_queue[0] = &pq;
}

$ gcc -std=gnu89  -fno-strict-aliasing   -c a.c -Wall -O2
a.c: In function 'uv__write_callbacks':
a.c:10:45: warning: storing the address of local variable 'pq' in '*(int
**)MEM[(int * *)stream_2(D) + 8B]' [-Wdangling-pointer=]
   10 |   *(int **)stream->write_completed_queue[0] = &pq;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.c:7:7: note: 'pq' declared here
    7 |   int pq;
      |       ^~
a.c:8:7: note: '((int **)stream)[1]' declared here
    8 |   if (*(int **)stream->write_completed_queue)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note: "note: " looks like a reasonable expression while "warning: " contains
internal names.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-12.0.0/bin/gcc
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-12.0.0/libexec/gcc/x86_64-unknown-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220306 (experimental) (GCC)

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

* [Bug tree-optimization/104886] -Wdangling-pointer= prints internal MEM and (D) names in warnings
  2022-03-11 23:36 [Bug c/104886] New: -Wdangling-pointer= prints internal MEM and (D) names in warnings slyfox at gcc dot gnu.org
@ 2022-03-11 23:43 ` pinskia at gcc dot gnu.org
  2022-03-14  7:56 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-03-11 23:43 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-03-11
             Status|UNCONFIRMED                 |NEW
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=104077
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, the warning itself looks correct, just the formating of the warning
seems bogus in this case.

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

* [Bug tree-optimization/104886] -Wdangling-pointer= prints internal MEM and (D) names in warnings
  2022-03-11 23:36 [Bug c/104886] New: -Wdangling-pointer= prints internal MEM and (D) names in warnings slyfox at gcc dot gnu.org
  2022-03-11 23:43 ` [Bug tree-optimization/104886] " pinskia at gcc dot gnu.org
@ 2022-03-14  7:56 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-14  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
pretty-printing of internal IL is sometimes complicated ...

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

end of thread, other threads:[~2022-03-14  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 23:36 [Bug c/104886] New: -Wdangling-pointer= prints internal MEM and (D) names in warnings slyfox at gcc dot gnu.org
2022-03-11 23:43 ` [Bug tree-optimization/104886] " pinskia at gcc dot gnu.org
2022-03-14  7:56 ` 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).