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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:49a7e7d0fc5fcc28ed13b6d67faf99a5dfe03f65

commit r9-9443-g49a7e7d0fc5fcc28ed13b6d67faf99a5dfe03f65
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Sat Apr 10 12:49:01 2021 +0200

    expand: Fix up LTO ICE with COMPOUND_LITERAL_EXPR [PR99849]

    The gimplifier optimizes away COMPOUND_LITERAL_EXPRs, but they can remain
    in the form of ADDR_EXPR of COMPOUND_LITERAL_EXPRs in static initializers.
    By the TREE_STATIC check I meant to check that the underlying decl of
    the compound literal is a global rather than automatic variable which
    obviously can't be referenced in static initializers, but unfortunately
    with LTO it might end up in another partition and thus be DECL_EXTERNAL
    instead.

    2021-04-10  Jakub Jelinek  <ja...@redhat.com>

            PR lto/99849
            * expr.c (expand_expr_addr_expr_1): Test is_global_var rather than
            just TREE_STATIC on COMPOUND_LITERAL_EXPR_DECLs.

            * gcc.dg/lto/pr99849_0.c: New test.

    (cherry picked from commit 2e57bc7eedb084869d17fe07b538d907b8fee819)

Reply via email to