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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Leandro Nini from comment #2)
> Oh, now I see it, it wasn't that obvious in the first test. But why is the
> compiler allowed to postpone the store after deleting the pointer? Is there
> some undefined behavior involved here or what?

So the branch where the read after delete happens just happens to be dead code
but GCC cannot prove it statically due to what I mentioned in comment #4.

Oh if you compile the testcase in comment #4 with -fno-exceptions you don't get
the warning. Or marking f as noexcept. I have not looked into what could be
done for either other testcase though.

Reply via email to