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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>:

https://gcc.gnu.org/g:3e3b665cc77791f2e088aeee124d8a9fb7f6eb41

commit r15-9333-g3e3b665cc77791f2e088aeee124d8a9fb7f6eb41
Author: Iain Buclaw <ibuc...@gdcproject.org>
Date:   Wed Apr 9 14:49:14 2025 +0200

    d: Use CONSTRUCTOR_ZERO_PADDING_BITS in the D FE [PR117832]

    Adds a new wrapper function for `build_constructor', and calls it
    instead to ensure that all CONSTRUCTOR nodes explicitly created by the
    front-end have CONSTRUCTOR_ZERO_PADDING_BITS set.

    Some places may not be necessary as it's guaranteed for there to be no
    padding in the type, such as D dynamic arrays.  Other places this gets
    turned into a double-memset when optimizations are turned off, as the
    front-end already generates a memset call to zero out all padding on
    initializing a variable.  The optimizer sees through this so will
    correctly clear all bits once, so this can be improved later as-needed.

            PR d/117832

    gcc/d/ChangeLog:

            * d-tree.h (build_padded_constructor): New prototype.
            * d-codegen.cc (build_padded_constructor): New function.
            (d_array_value): Call it.
            (build_memset_call): Likewise.
            (build_struct_literal): Likewise.
            (underlying_complex_expr): Likewise.
            (build_array_from_val): Likewise.
            (build_array_from_exprs): Likewise.
            (d_build_call): Likewise.
            (get_frame_for_symbol): Likewise.
            * d-convert.cc (convert_for_rvalue): Likewise.
            (convert_for_assignment): Likewise.
            * decl.cc (class DeclVisitor): Likewise.
            * expr.cc (class ExprVisitor): Likewise.
            * modules.cc (layout_moduleinfo): Likewise.
            * typeinfo.cc (class TypeInfoVisitor): Likewise.
  • [Bug d/117832] Use CONSTRUCTOR_... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to