public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/111253] New: Dodgy pointer name (*_42 = PHI ...) in -Wfree-nonheap-object diagnostic
@ 2023-08-31  6:33 sjames at gcc dot gnu.org
  2023-08-31  7:05 ` [Bug middle-end/111253] " sjames at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-08-31  6:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111253
           Summary: Dodgy pointer name (*_42 = PHI ...) in
                    -Wfree-nonheap-object diagnostic
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
            Blocks: 99098
  Target Milestone: ---

Created attachment 55823
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55823&action=edit
object_cache.i

With gcc-13 (Gentoo Hardened 13.2.1_p20230826 p7) 13.2.1 20230826:
```
/bin/sh ../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc
-DHAVE_CONFIG_H -I. -I..    -fvisibility=hidden -pthread -std=gnu99 -O2 -pipe
-march=native -fdiagnostics-color=always -frecord-gcc-switch
es -Wreturn-type      -ggdb3 -Wall -Wmissing-prototypes -Wextra
-DLT_BUILDING_DLL=1 -c -o data-struct/object_cache.lo
data-struct/object_cache.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..
-fvisibility=hidden -pthread -std=gnu99 -O2 -pipe -march=native
-fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Wall
-Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1 -c data-struct/object_cache.c 
-fPIC -DPIC -o data-struct/.libs/object_cache.o
In function 'resize_memory_caches',
    inlined from 'find_cache' at data-struct/object_cache.c:211:4:
data-struct/object_cache.c:150:29: warning: 'realloc' called on pointer '*_42 =
PHI <lcs.14_40(29), lcs.19_48(30)>.t_mem_caches' with nonzero offset 640
[-Wfree-nonheap-object]
  150 |         lcs->t_mem_caches = realloc(lcs->t_mem_caches,
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
  151 |                                     lcs->t_mem_caches_total *
sizeof(struct local_cache));
      |                                    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

gcc -O2 -c object_cache.i is enough to reproduce.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99098
[Bug 99098] invalid/missing -Wfree-nonheap-object warnings

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

end of thread, other threads:[~2023-12-15 13:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31  6:33 [Bug middle-end/111253] New: Dodgy pointer name (*_42 = PHI ...) in -Wfree-nonheap-object diagnostic sjames at gcc dot gnu.org
2023-08-31  7:05 ` [Bug middle-end/111253] " sjames at gcc dot gnu.org
2023-08-31 11:13 ` rguenth at gcc dot gnu.org
2023-08-31 11:13 ` [Bug middle-end/111253] [11/12/13/14 Regression] " rguenth at gcc dot gnu.org
2023-08-31 11:14 ` rguenth at gcc dot gnu.org
2023-08-31 12:37 ` rguenth at gcc dot gnu.org
2023-08-31 13:07 ` cvs-commit at gcc dot gnu.org
2023-08-31 13:08 ` [Bug middle-end/111253] [11/12/13 " rguenth at gcc dot gnu.org
2023-11-10 14:23 ` cvs-commit at gcc dot gnu.org
2023-12-15 13:17 ` [Bug middle-end/111253] [11/12 " cvs-commit 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).