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

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

https://gcc.gnu.org/g:33be07be9e46f15b9556521050356c47460651ee

commit r11-5746-g33be07be9e46f15b9556521050356c47460651ee
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Dec 4 18:00:54 2020 +0100

    fold-const: Don't use build_constructor for non-aggregate types in
native_encode_initializer [PR93121]

    The following testcase is rejected, because when trying to encode a zeroing
    CONSTRUCTOR, the code was using build_constructor to build initializers for
    the elements but when recursing the function handles CONSTRUCTOR only for
    aggregate types.

    The following patch fixes that by using build_zero_cst instead for
    non-aggregates.  Another option would be add handling CONSTRUCTOR for
    non-aggregates in native_encode_initializer.  Or we can do both, I guess
    the middle-end generally doesn't like CONSTRUCTORs for scalar variables,
but
    am not 100% sure if the FE doesn't produce those sometimes.

    2020-12-04  Jakub Jelinek  <ja...@redhat.com>

            PR libstdc++/93121
            * fold-const.c (native_encode_initializer): Use build_zero_cst
            instead of build_constructor.

            * g++.dg/cpp2a/bit-cast6.C: New test.

Reply via email to