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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Last reconfirmed|                            |2022-07-25
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
             Blocks|                            |104075
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think we've seen similar issues.  We diagnose

old_buffer1_9 = (long unsigned int) buffer1_7;

so the exceptions for equality compares of the pointer does not trigger.
That is by design (but not all people agree here).

Now, that optimization causes code-motion cannot be avoided so I think the
diagnostic is bad and we should _not_ warn about value uses.  That's something
we can somewhat easily do - but diagnosing at -O0 but not at -O2 seems hard.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104075
[Bug 104075] bogus/missing -Wuse-after-free

Reply via email to