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

--- Comment #4 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:bd0c9d9e706adaeea0d96152daade0a6819a8715

commit r13-4143-gbd0c9d9e706adaeea0d96152daade0a6819a8715
Author: Andrew Pinski <apin...@marvell.com>
Date:   Thu Nov 17 22:08:07 2022 +0000

    Fix PRs 106764, 106765, and 107307, all ICE after invalid re-declaration

    The problem here is the gimplifier returns GS_ERROR but
    in some cases we don't check that soon enough and try
    to do other work which could crash.
    So the fix in these two cases is to return GS_ERROR
    early if the gimplify_* functions had return GS_ERROR.

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

    Thanks,
    Andrew Pinski

    gcc/ChangeLog:

            PR c/106764
            PR c/106765
            PR c/107307
            * gimplify.cc (gimplify_compound_lval): Return GS_ERROR
            if gimplify_expr had return GS_ERROR.
            (gimplify_call_expr): Likewise.

    gcc/testsuite/ChangeLog:

            PR c/106764
            PR c/106765
            PR c/107307
            * gcc.dg/redecl-19.c: New test.
            * gcc.dg/redecl-20.c: New test.
            * gcc.dg/redecl-21.c: New test.

Reply via email to