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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

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

commit r13-4144-gceba66ee230bb96b0889fc8ec7333c7ffae96d6e
Author: Andrew Pinski <apin...@marvell.com>
Date:   Thu Nov 17 22:03:08 2022 +0000

    Fix PR middle-end/107705: ICE after reclaration error

    The problem here is after we created a call expression
    in the C front-end, we replace the decl type with
    an error mark node. We then end up calling
    aggregate_value_p with the call expression
    with the decl with the error mark as the type
    and we ICE.

    The fix is to check the function type
    after we process the call expression inside
    aggregate_value_p to get it.

    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

    Thanks,
    Andrew Pinski

    gcc/ChangeLog:

            PR middle-end/107705
            * function.cc (aggregate_value_p): Return 0 if
            the function type was an error operand.

    gcc/testsuite/ChangeLog:

            * gcc.dg/redecl-22.c: New test.

Reply via email to