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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Kewen Lin <li...@gcc.gnu.org>:

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

commit r12-8846-gc7f17493cc26a4395d549547075603a15f4c94a7
Author: Kewen Lin <li...@linux.ibm.com>
Date:   Mon Sep 26 00:33:18 2022 -0500

    rs6000: Fix the condition with frame_pointer_needed_indeed [PR96072]

    As PR96072 shows, the code adding REG_CFA_DEF_CFA reg note
    makes one assumption that we have emitted one insn which
    restores the frame pointer previously.  That part of code
    was guarded with flag frame_pointer_needed before, it was
    consistent, but it was replaced with flag
    frame_pointer_needed_indeed since commit r10-7981.  It
    caused ICE due to unexpected NULL insn.

            PR target/96072

    gcc/ChangeLog:

            * config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): Update the
            condition for adding REG_CFA_DEF_CFA reg note with
            frame_pointer_needed_indeed.

    gcc/testsuite/ChangeLog:

            * gcc.target/powerpc/pr96072.c: New test.

    (cherry picked from commit 5be0950d22209f5ba69d244387228e12389a8470)

Reply via email to