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

--- Comment #22 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jakub Jelinek
<[email protected]>:

https://gcc.gnu.org/g:c872e7faf1b0b8f8dc5e41c0cf1fe89ec8d5ae1f

commit r16-9285-gc872e7faf1b0b8f8dc5e41c0cf1fe89ec8d5ae1f
Author: Jakub Jelinek <[email protected]>
Date:   Sun Jul 5 16:47:47 2026 +0200

    testsuite: Add C++ testcase for the recent PTA bug

    On Wed, Jul 01, 2026 at 09:47:46AM +0200, Eric Botcazou wrote:
    > this is a regression present on mainline, 16, 15 and 14 branches
introduced by
    > the fix for PR tree-optimization/112653 (PTA and return).  What happens
is
    > that DSE incorrectly eliminates a call to __builtin_memcpy, whose
destination
    > is obtained from (an equivalent of) malloc and is ultimately returned
from the
    > function.  But this happens only when the dynamic allocation is
conditional.

    For us Ada illiterate, here is a C++ testcase which got fixed by this too.

    2026-07-05  Jakub Jelinek  <[email protected]>

            * g++.dg/opt/20260703-1.C: New test.

    Reviewed-by: Richard Biener <[email protected]>
    (cherry picked from commit 7da47d53d716b689784eaad20ebe26fdbb33982a)

Reply via email to