https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104492
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|c++ |middle-end Summary|Bogus dangling pointer |[12 Regression] Bogus |warning (dangling pointer |dangling pointer warning at |to ‘candidates’ may be used |-O3 |[-Werror=dangling-pointer=] | |) | Ever confirmed|0 |1 Blocks| |104077 Last reconfirmed| |2022-02-11 Keywords| |diagnostic CC| |msebor at gcc dot gnu.org --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- The warning is issued for the if condition in the basic block below: <bb 28> [local count: 1014686340]: # _106 = PHI <&MEM <const struct QLatin1String[1]> [(void *)&candidates + 16B](26), &candidates(27)> <L14>: _274 = _106; __pred ={v} {CLOBBER(eol)}; _17 = _274; __pred ={v} {CLOBBER(eol)}; candidates ={v} {CLOBBER(eol)}; <<< clobber s ={v} {CLOBBER(eol)}; D.169975 ={v} {CLOBBER(eol)}; if (&MEM <const struct QLatin1String[1]> [(void *)&candidates + 16B] != _17) <<< -Wdangling-pointer goto <bb 30>; [5.50%] else goto <bb 29>; [94.50%] Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104077 [Bug 104077] bogus/missing -Wdangling-pointer