[Bug lto/96680] [11 Regression][OpenMP][LTO] Declare variant + ICE in lto_fixup_prevailing_decls, at lto/lto-common.c:2595

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 28 09:29:35 GMT 2020


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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r11-4468-gf165ef89c08ddabb19583e45e8a6819f810d95ab
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 28 10:28:18 2020 +0100

    lto: LTO cgraph support for late declare variant resolution [PR96680]

    > I've tried to add the saving/restoring next to ipa refs saving/restoring,
as
    > the declare variant alt stuff is kind of extension of those,
unfortunately
    > following doesn't compile, because I need to also write or read a tree
there
    > (ctx is a portion of DECL_ATTRIBUTES of the base function), but the ipa
refs
    > write/read back functions don't have arguments that can be used for that.

    This patch adds the streaming out and in of those omp_declare_variant_alt
    hash table on the side data for the declare_variant_alt cgraph_nodes and
    treats for LTO purposes the declare_variant_alt nodes (which have no body)
    as if they contained a body that calls all the possible variants.
    After IPA all the calls to these magic declare_variant_alt calls are
    replaced with call to one of the variant depending on which one has the
    highest score in the context.

    2020-10-28  Jakub Jelinek  <jakub@redhat.com>

            PR lto/96680
    gcc/
            * lto-streamer.h (omp_lto_output_declare_variant_alt,
            omp_lto_input_declare_variant_alt): Declare variant.
            * symtab.c (symtab_node::get_partitioning_class): Return
            SYMBOL_DUPLICATE for declare_variant_alt nodes.
            * passes.c (ipa_write_summaries): Add declare_variant_alt to
            partition.
            * lto-cgraph.c (output_refs): Call
omp_lto_output_declare_variant_alt
            on declare_variant_alt nodes.
            (input_refs): Call omp_lto_input_declare_variant_alt on
            declare_variant_alt nodes.
            * lto-streamer-out.c (output_function): Don't call
            collect_block_tree_leafs if DECL_INITIAL is error_mark_node.
            (lto_output): Call output_function even for declare_variant_alt
            nodes.
            * omp-general.c (omp_lto_output_declare_variant_alt,
            omp_lto_input_declare_variant_alt): New functions.
    gcc/lto/
            * lto-common.c (lto_fixup_prevailing_decls): Don't use
            LTO_NO_PREVAIL on TREE_LIST's TREE_PURPOSE.
            * lto-partition.c (lto_balanced_map): Treat declare_variant_alt
            nodes like definitions.
    libgomp/
            * testsuite/libgomp.c/declare-variant-1.c: New test.


More information about the Gcc-bugs mailing list