aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
AgeCommit message (Collapse)AuthorFilesLines
2025-08-19Daily bump.GCC Administrator1-0/+5
2025-08-18opts: use sanitize_code_type for sanitizer flagsIndu Bhagat1-4/+5
Currently, the data type of sanitizer flags is unsigned int, with SANITIZE_SHADOW_CALL_STACK (1UL << 31) being highest individual enumerator for enum sanitize_code. Use 'sanitize_code_type' data type to allow for more distinct instrumentation modes be added when needed. gcc/ChangeLog: * flag-types.h (sanitize_code_type): Define. * asan.h (sanitize_flags_p): Use 'sanitize_code_type' instead of 'unsigned int'. * common.opt: Likewise. * dwarf2asm.cc (dw2_output_indirect_constant_1): Likewise. * opts.cc (find_sanitizer_argument): Likewise. (report_conflicting_sanitizer_options): Likewise. (parse_sanitizer_options): Likewise. (parse_no_sanitize_attribute): Likewise. * opts.h (parse_sanitizer_options): Likewise. (parse_no_sanitize_attribute): Likewise. * tree-cfg.cc (print_no_sanitize_attr_value): Likewise. * tree.cc (tree_fits_sanitize_code_type_p): Define. (tree_to_sanitize_code_type): Likewise. * tree.h (tree_fits_sanitize_code_type_p): Declare. (tree_to_sanitize_code_type): Likewise. gcc/c-family/ChangeLog: * c-attribs.cc (add_no_sanitize_value): Use 'sanitize_code_type' instead of 'unsigned int'. (handle_no_sanitize_attribute): Likewise. (handle_no_sanitize_address_attribute): Likewise. (handle_no_sanitize_thread_attribute): Likewise. (handle_no_address_safety_analysis_attribute): Likewise. * c-common.h (add_no_sanitize_value): Likewise. gcc/c/ChangeLog: * c-parser.cc (c_parser_declaration_or_fndef): Use 'sanitize_code_type' instead of 'unsigned int'. gcc/cp/ChangeLog: * typeck.cc (get_member_function_from_ptrfunc): Use 'sanitize_code_type' instead of 'unsigned int'. gcc/d/ChangeLog: * d-attribs.cc (d_handle_no_sanitize_attribute): Use 'sanitize_code_type' instead of 'unsigned int'. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
2025-08-12Daily bump.GCC Administrator1-0/+6
2025-08-11D: Adjust the code-gen for a string constant.Iain Sandoe1-5/+1
In this function, we are generating a string constant but do so with a mismatch between the actual string length and the length specified in the type. This causes Darwin, at least, to place the string in an unexpected section (since the parameters do not match, it is rejected as a cstring). Use build_string_literal() to construct a consistent null-terminated string. gcc/d/ChangeLog: * d-codegen.cc (build_filename_from_loc): Use build_string_literal() to build a null-terminated string for the filename. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-08-07Daily bump.GCC Administrator1-0/+4
2025-08-06gcc: drop placement new workaround for old bootstrap compilersSam James1-1/+1
Since r15-4719-ga9ec1bc06bd3cc, we require GCC 5.4, so a workaround for < GCC 4.3 is long-obsolete. Before that, we required GCC 4.8.3 too. i.e. it shouldn't be possible to build GCC with such a compiler for quite some time. gcc/ChangeLog: PR libstdc++/29286 * Makefile.in (ALIASING_FLAGS): Drop. * configure: Regenerate. * configure.ac: Drop -fno-strict-aliasing workaround for < GCC 4.3. gcc/d/ChangeLog: * Make-lang.in (ALL_DFLAGS): Don't use ALIASING_FLAGS.
2025-07-26Daily bump.GCC Administrator1-0/+14
2025-07-25diagnostics: eliminate ::diagnostic_info typedefDavid Malcolm1-1/+1
No functional change intended. gcc/c-family/ChangeLog: * c-common.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * c-opts.cc: Likewise. gcc/c/ChangeLog: * c-errors.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". gcc/cp/ChangeLog: * constexpr.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * cp-tree.h: Likewise. * error.cc: Likewise. * module.cc: Likewise. gcc/d/ChangeLog: * d-diagnostic.cc: Likewise. gcc/ChangeLog: * diagnostic.h: Eliminate "diagnostic_info" typedef. * diagnostics/context.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * langhooks.cc: Likewise. * libgdiagnostics.cc: Likewise. * rtl-error.cc: Likewise. * substring-locations.cc: Likewise. * toplev.cc: Likewise. * tree-diagnostic.cc: Likewise. * tree-diagnostic.h: Likewise. gcc/fortran/ChangeLog: * cpp.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * error.cc: Likewise. gcc/jit/ChangeLog: * dummy-frontend.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". gcc/m2/ChangeLog: * gm2-gcc/m2linemap.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * gm2-gcc/rtegraph.cc: Likewise. gcc/rust/ChangeLog: * resolve/rust-ice-finalizer.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * resolve/rust-ice-finalizer.h: Likewise. gcc/testsuite/ChangeLog: * g++.dg/plugin/show_template_tree_color_plugin.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". * gcc.dg/plugin/diagnostic_group_plugin.cc: Likewise. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Likewise. * gcc.dg/plugin/location_overflow_plugin.cc: Likewise. libcc1/ChangeLog: * context.cc: Update usage of "diagnostic_info" to explicitly refer to "diagnostics::diagnostic_info". Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-25diagnostics: convert diagnostic_t to enum class diagnostics::kindDavid Malcolm1-8/+11
No functional change intended. gcc/ChangeLog: * Makefile.in: Replace diagnostic.def with diagnostics/kinds.def. * config/aarch64/aarch64.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * config/i386/i386-options.cc: Likewise. * config/s390/s390.cc: Likewise. * diagnostic-core.h: Replace typedef diagnostic_t with enum class diagnostics::kind in diagnostics/kinds.h and include it. * diagnostic-global-context.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * diagnostic.cc: Likewise. * diagnostic.h: Likewise. * diagnostics/buffering.cc: Likewise. * diagnostics/buffering.h: Likewise. * diagnostics/context.h: Likewise. * diagnostics/diagnostic-info.h: Likewise. * diagnostics/html-sink.cc: Likewise. * diagnostic.def: Move to... * diagnostics/kinds.def: ...here and update for diagnostic_t becoming enum class diagnostics::kind. * diagnostics/kinds.h: New file, based on material in diagnostic-core.h. * diagnostics/lazy-paths.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * diagnostics/option-classifier.cc: Likewise. * diagnostics/option-classifier.h: Likewise. * diagnostics/output-spec.h: Likewise. * diagnostics/paths-output.cc: Likewise. * diagnostics/sarif-sink.cc: Likewise. * diagnostics/selftest-context.cc: Likewise. * diagnostics/selftest-context.h: Likewise. * diagnostics/sink.h: Likewise. * diagnostics/source-printing.cc: Likewise. * diagnostics/text-sink.cc: Likewise. * diagnostics/text-sink.h: Likewise. * gcc.cc: Likewise. * libgdiagnostics.cc: Likewise. * lto-wrapper.cc: Likewise. * opts-common.cc: Likewise. * opts-diagnostic.h: Likewise. * opts.cc: Likewise. * rtl-error.cc: Likewise. * substring-locations.cc: Likewise. * toplev.cc: Likewise. gcc/ada/ChangeLog: * gcc-interface/trans.cc: Update for diagnostic_t becoming enum class diagnostics::kind. gcc/analyzer/ChangeLog: * pending-diagnostic.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * program-point.cc: Likewise. gcc/c-family/ChangeLog: * c-common.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * c-format.cc: Likewise. * c-lex.cc: Likewise. * c-opts.cc: Likewise. * c-pragma.cc: Likewise. * c-warn.cc: Likewise. gcc/c/ChangeLog: * c-errors.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * c-parser.cc: Likewise. * c-typeck.cc: Likewise. gcc/cobol/ChangeLog: * util.cc: Update for diagnostic_t becoming enum class diagnostics::kind. gcc/cp/ChangeLog: * call.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * constexpr.cc: Likewise. * cp-tree.h: Likewise. * decl.cc: Likewise. * error.cc: Likewise. * init.cc: Likewise. * method.cc: Likewise. * module.cc: Likewise. * parser.cc: Likewise. * pt.cc: Likewise. * semantics.cc: Likewise. * typeck.cc: Likewise. * typeck2.cc: Likewise. gcc/d/ChangeLog: * d-diagnostic.cc: Update for diagnostic_t becoming enum class diagnostics::kind. gcc/fortran/ChangeLog: * cpp.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * error.cc: Likewise. * options.cc: Likewise. gcc/jit/ChangeLog: * dummy-frontend.cc: Update for diagnostic_t becoming enum class diagnostics::kind. gcc/m2/ChangeLog: * gm2-gcc/m2linemap.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * gm2-gcc/rtegraph.cc: Likewise. gcc/rust/ChangeLog: * backend/rust-tree.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * backend/rust-tree.h: Likewise. * resolve/rust-ast-resolve-expr.cc: Likewise. * resolve/rust-ice-finalizer.cc: Likewise. * resolve/rust-ice-finalizer.h: Likewise. * resolve/rust-late-name-resolver-2.0.cc: Likewise. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Update for diagnostic_t becoming enum class diagnostics::kind. * gcc.dg/plugin/expensive_selftests_plugin.cc: Likewise. * gcc.dg/plugin/location_overflow_plugin.cc: Likewise. * lib/gcc-dg.exp: Likewise. libcpp/ChangeLog: * internal.h: Update comment for diagnostic_t becoming enum class diagnostics::kind. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-25diagnostics: add m_ prefix to fields of diagnostic_infoDavid Malcolm1-1/+1
No functional change intended. gcc/c-family/ChangeLog: * c-opts.cc (c_diagnostic_text_finalizer): Add "m_" prefix to fields of diagnostic_info. gcc/c/ChangeLog: * c-errors.cc: Update to add "m_" prefix to fields of diagnostic_info throughout. gcc/cp/ChangeLog: * constexpr.cc: Update to add "m_" prefix to fields of diagnostic_info throughout. * error.cc: Likewise. gcc/d/ChangeLog: * d-diagnostic.cc (d_diagnostic_report_diagnostic): Update to add "m_" prefix to fields of diagnostic_info throughout. gcc/ChangeLog: * diagnostic.cc: Update to add "m_" prefix to fields of diagnostic_info throughout. * diagnostic.h: Likewise. * diagnostics/html-sink.cc: Likewise. * diagnostics/sarif-sink.cc: Likewise. * diagnostics/text-sink.cc: Likewise. * libgdiagnostics.cc: Likewise. * substring-locations.cc: Likewise. * tree-diagnostic.cc: Likewise. gcc/fortran/ChangeLog: * error.cc: Update to add "m_" prefix to fields of diagnostic_info throughout. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Update to add "m_" prefix to fields of diagnostic_info throughout. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-22Daily bump.GCC Administrator1-0/+5
2025-07-21Error handling for hard register constraintsStefan Schulze Frielinghaus1-2/+4
This implements error handling for hard register constraints including potential conflicts with register asm operands. In contrast to register asm operands, hard register constraints allow more than just one register per operand. Even more than just one register per alternative. For example, a valid constraint for an operand is "{r0}{r1}m,{r2}". However, this also means that we have to make sure that each register is used at most once in each alternative over all outputs and likewise over all inputs. For asm statements this is done by this patch during gimplification. For hard register constraints used in machine description, error handling is still a todo and I haven't investigated this so far and consider this rather a low priority. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu): Pass null pointer to parse_{input,output}_constraint(). gcc/analyzer/ChangeLog: * region-model-asm.cc (region_model::on_asm_stmt): Pass null pointer to parse_{input,output}_constraint(). gcc/c/ChangeLog: * c-typeck.cc (build_asm_expr): Pass null pointer to parse_{input,output}_constraint(). gcc/ChangeLog: * cfgexpand.cc (n_occurrences): Move this ... (check_operand_nalternatives): and this ... (expand_asm_stmt): and the call to gimplify.cc. * config/s390/s390.cc (s390_md_asm_adjust): Pass null pointer to parse_{input,output}_constraint(). * gimple-walk.cc (walk_gimple_asm): Pass null pointer to parse_{input,output}_constraint(). (walk_stmt_load_store_addr_ops): Ditto. * gimplify-me.cc (gimple_regimplify_operands): Ditto. * gimplify.cc (num_occurrences): Moved from cfgexpand.cc. (num_alternatives): Ditto. (gimplify_asm_expr): Deal with hard register constraints. * stmt.cc (eliminable_regno_p): New helper. (hardreg_ok_p): Perform a similar check as done in make_decl_rtl(). (parse_output_constraint): Add parameter for gimplify_reg_info and validate hard register constrained operands. (parse_input_constraint): Ditto. * stmt.h (class gimplify_reg_info): Forward declaration. (parse_output_constraint): Add parameter. (parse_input_constraint): Ditto. * tree-ssa-operands.cc (operands_scanner::get_asm_stmt_operands): Pass null pointer to parse_{input,output}_constraint(). * tree-ssa-structalias.cc (find_func_aliases): Pass null pointer to parse_{input,output}_constraint(). * varasm.cc (assemble_asm): Pass null pointer to parse_{input,output}_constraint(). * gimplify_reg_info.h: New file. gcc/cp/ChangeLog: * semantics.cc (finish_asm_stmt): Pass null pointer to parse_{input,output}_constraint(). gcc/d/ChangeLog: * toir.cc: Pass null pointer to parse_{input,output}_constraint(). gcc/testsuite/ChangeLog: * gcc.dg/pr87600-2.c: Split test into two files since errors for functions test{0,1} are thrown during expand, and for test{2,3} during gimplification. * lib/scanasm.exp: On s390, skip lines beginning with #. * gcc.dg/asm-hard-reg-error-1.c: New test. * gcc.dg/asm-hard-reg-error-2.c: New test. * gcc.dg/asm-hard-reg-error-3.c: New test. * gcc.dg/asm-hard-reg-error-4.c: New test. * gcc.dg/asm-hard-reg-error-5.c: New test. * gcc.dg/pr87600-3.c: New test. * gcc.target/aarch64/asm-hard-reg-2.c: New test. * gcc.target/s390/asm-hard-reg-7.c: New test.
2025-04-30Daily bump.GCC Administrator1-0/+17
2025-04-29d: Use __builtin_clear_padding for zeroing alignment holes after setIain Buclaw4-70/+30
In an earlier change, a wrapper function was added to set CONSTRUCTOR_ZERO_PADDING_BITS on all CONSTRUCTOR nodes. This removes all the old generated calls to built-in memset and memcpy as zero padding is now taken care of by the middle-end. The remaining constructors that weren't getting zero padded was ARRAY_TYPEs, so now `__builtin_clear_padding' is used to fill in all alignment holes in constructed array literals where required. PR d/103044 gcc/d/ChangeLog: * d-tree.h (build_clear_padding_call): New prototype. * d-codegen.cc (build_clear_padding_call): New function. (build_memset_call): Remove generated call to __builtin_memcpy. (build_address): Replace generated call to __builtin_memset with __builtin_clear_padding. (build_array_from_exprs): Likewise. * expr.cc (ExprVisitor::visit (AssignExp *)): Remove generated call to __builtin_memset. (ExprVisitor::visit (ArrayLiteralExp *)): Likewise. Insert call to __builtin_clear_padding after copying array into GC memory. (ExprVisitor::visit (StructLiteralExp *)): Remove generated call to __builtin_memset. * toir.cc (IRVisitor::visit (ReturnStatement *)): Likewise.
2025-04-18Daily bump.GCC Administrator1-0/+4
2025-04-17d: Fix infinite loop regression in CTFEIain Buclaw2-4/+4
An infinite loop was introduced by a previous refactoring in the semantic pass for DeclarationExp nodes. Ensure the loop properly terminates and add tests cases. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 956e73d64e. gcc/testsuite/ChangeLog: * gdc.test/fail_compilation/test21247.d: New test. * gdc.test/fail_compilation/test21247b.d: New test. Reviewed-on: https://github.com/dlang/dmd/pull/21248
2025-04-16Daily bump.GCC Administrator1-0/+19
2025-04-16d: Fix ICE: type variant differs by TYPE_MAX_VALUE with -g [PR119826]Iain Buclaw1-0/+20
Forward referenced enum types were never fixed up after the main ENUMERAL_TYPE was finished. All flags set are now propagated to all variants after its mode, size, and alignment has been calculated. PR d/119826 gcc/d/ChangeLog: * types.cc (TypeVisitor::visit (TypeEnum *)): Propagate flags of main enum types to all forward-referenced variants. gcc/testsuite/ChangeLog: * gdc.dg/debug/imports/pr119826b.d: New test. * gdc.dg/debug/pr119826.d: New test.
2025-04-15d: Fix internal compiler error: in visit, at d/decl.cc:838 [PR119799]Iain Buclaw1-5/+10
This was caused by a check in the D front-end disallowing static VAR_DECLs with a size `0'. While empty structs in D are give the size `1', the same symbol coming from ImportC modules do infact have no size, so allow C variables to pass the check as well as array objects. PR d/119799 gcc/d/ChangeLog: * decl.cc (DeclVisitor::visit (VarDeclaration *)): Check front-end type size before building the VAR_DECL. Allow C symbols to have a size of `0'. gcc/testsuite/ChangeLog: * gdc.dg/import-c/pr119799.d: New test. * gdc.dg/import-c/pr119799c.c: New test.
2025-04-15d: Fix ICE in dwarf2out_imported_module_or_decl, at dwarf2out.cc:27676 ↵Iain Buclaw1-1/+5
[PR119817] The ImportVisitor method for handling the importing of overload sets was pushing NULL_TREE to the array of import decls, which in turn got passed to `debug_hooks->imported_module_or_decl', triggering the observed internal compiler error. NULL_TREE is returned from `build_import_decl' when the symbol was ignored for being non-trivial to represent in debug, for example, template or tuple declarations. So similarly "skip" adding the symbol when this is the case for overload sets too. PR d/119817 gcc/d/ChangeLog: * imports.cc (ImportVisitor::visit (OverloadSet *)): Don't push NULL_TREE to vector of import symbols. gcc/testsuite/ChangeLog: * gdc.dg/debug/imports/m119817/a.d: New test. * gdc.dg/debug/imports/m119817/b.d: New test. * gdc.dg/debug/imports/m119817/package.d: New test. * gdc.dg/debug/pr119817.d: New test.
2025-04-13Daily bump.GCC Administrator1-0/+18
2025-04-12d: Add option to include imported modules in the compilation [PR109023]Iain Buclaw5-2/+67
Adds the ability to include imported modules in the compilation, as if they were given on the command line. When this option is enabled, all imported modules are compiled except those that are part of libphobos. PR d/109023 gcc/d/ChangeLog: * d-compiler.cc: Include dmd/errors.h. (Compiler::onImport): Implement. * d-lang.cc (d_handle_option): Handle -finclude-imports. (d_parse_file): Run semantic on included imports. * gdc.texi: Document -finclude-imports. * lang.opt: Add finclude-imports. * lang.opt.urls: Regenerate. gcc/testsuite/ChangeLog: * gdc.dg/torture/imports/pr109023.d: New test. * gdc.dg/torture/pr109023.d: New test.
2025-04-12d: Fix -fonly= argument only matches when including full path [PR119758]Iain Buclaw2-26/+30
Using `strcmp' to match the `-fonly=' argument with the input source file made the feature inflexible to use. By mistake, the driver was also found to omit all other modules on the command line as well, which differed from the documentation on the flag: Tell the compiler to parse and run semantic analysis on all modules on the command line, but only generate code for the given argument. New tests added to check the feature, which didn't exist before. PR d/119758 gcc/d/ChangeLog: * d-lang.cc (d_parse_file): Use endswith in test for -fonly= argument. * d-spec.cc (lang_specific_driver): Rework -fonly= and pass all input files to the front-end compiler when the option is seen. gcc/testsuite/ChangeLog: * gdc.dg/driver_fonly1.d: New test. * gdc.dg/driver_fonly2.d: New test. * gdc.dg/driver_fonly3.d: New test. * gdc.dg/imports/fonly.d: New test.
2025-04-12Daily bump.GCC Administrator1-0/+4
2025-04-11d: Merge upstream dmd 1b34fea478, phobos 40ffbb364Iain Buclaw5-15/+31
D front-end changes: - Import latest fixes from dmd v2.111.1-rc.1. Phobos changes: - Import latest fixes from phobos v2.111.1-rc.1. - Restore compatibility with older Linux platforms where `getrandom' is unavailable. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 1b34fea478. libphobos/ChangeLog: * src/MERGE: Merge upstream phobos 40ffbb364. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Call DRUNTIME_OS_FEATURES. * libdruntime/Makefile.am (AM_DFLAGS): Add OS_DFLAGS. * libdruntime/Makefile.in: Regenerate. * m4/druntime/os.m4 (DRUNTIME_OS_FEATURES): Define. * src/Makefile.am: Add OS_DFLAGS. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add OS_DFLAGS.
2025-04-10Daily bump.GCC Administrator1-0/+30
2025-04-09d: Fix forward referenced enums missing type names in debug info [PR118309]Iain Buclaw2-13/+11
Calling `rest_of_type_compilation' as the D types were built meant that debug info was being emitted before all forward references were resolved, resulting in DW_AT_name's to be missing. Instead, defer outputting type debug information until all modules have been parsed and generated in `d_finish_compilation'. PR d/118309 gcc/d/ChangeLog: * modules.cc: Include debug.h (d_finish_compilation): Call debug_hooks->type_decl on all TYPE_DECLs. * types.cc: Remove toplev.h include. (finish_aggregate_type): Don't call rest_of_type_compilation or rest_of_decl_compilation on type. (TypeVisitor::visit (TypeEnum *)): Likewise. gcc/testsuite/ChangeLog: * gdc.dg/debug/dwarf2/pr118309.d: New test.
2025-04-09d: Use CONSTRUCTOR_ZERO_PADDING_BITS in the D FE [PR117832]Iain Buclaw7-28/+45
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.
2025-04-09Daily bump.GCC Administrator1-0/+4
2025-04-08d: Fix infinite loop in isAliasThisTupleIain Buclaw2-14/+18
This reverts a change in the upstream D implementation of the compiler, as the refactoring introduced a regression. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 51816cd01d. Reviewed-on: https://github.com/dlang/dmd/pull/21155
2025-04-07Daily bump.GCC Administrator1-0/+4
2025-04-06Doc: make regenerate-opt-urlsSandra Loosemore1-0/+3
I keep forgetting to do this.... :-( gcc/c-family/ChangeLog * c.opt.urls: Regenerate. gcc/d/ChangeLog * lang.opt.urls: Regenerate.
2025-04-03Daily bump.GCC Administrator1-0/+4
2025-04-02d: Fix error using UFCS in a speculative contextIain Buclaw2-9/+4
This reverts a change in the upstream D implementation of the compiler, as it is no longer necessary since another fix for opDispatch got applied in the same area (merged in r12-6003-gfd43568cc54e17). gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd ed17b3e95d. Reviewed-on: https://github.com/dlang/dmd/pull/21132
2025-04-01Daily bump.GCC Administrator1-0/+14
2025-03-31d: Bump front-end language version to v2.111.0Iain Buclaw129-255/+255
Merges the front-end language implementation and runtime library with upstream dmd c6863be720, and the standard library with phobos 60034b56e. Synchronizing with the upstream release of v2.111.0. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd c6863be720. * dmd/VERSION: Bump version to v2.111.0. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime c6863be720. * src/MERGE: Merge upstream phobos 60034b56e.
2025-03-31d: Fix error with -Warray-bounds and -O2 [PR117002]Iain Buclaw3-1/+10
The record layout of class types in D don't get any tail padding, so it is possible for the `classInstanceSize' to not be a multiple of the `classInstanceAlignment'. Rather than setting the instance alignment on the underlying RECORD_TYPE, instead give the type an alignment of 1, which will mark it as TYPE_PACKED. The value of `classInstanceAlignment' is instead applied to the DECL_ALIGN of both the static `init' symbol, and the stack allocated variable used when generating `new' for a `scope' class. PR d/117002 gcc/d/ChangeLog: * decl.cc (aggregate_initializer_decl): Set explicit decl alignment of class instance. * expr.cc (ExprVisitor::visit (NewExp *)): Likewise. * types.cc (TypeVisitor::visit (TypeClass *)): Mark the record type of classes as packed. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr117002.d: New test.
2025-03-31Daily bump.GCC Administrator1-0/+4
2025-03-30Docs: make regenerate-opt-urlsSandra Loosemore1-1/+1
gcc/c-family/ChangeLog * c.opt.urls: Regenerate. gcc/d/ChangeLog * lang.opt.urls: Regenerate. gcc/m2/ChangeLog * lang.opt.urls: Regenerate.
2025-03-27Daily bump.GCC Administrator1-0/+4
2025-03-26d: import __stdin causes compilation to pause while reading from stdinIain Buclaw5-59/+8
Moves the special handling of reading from stdin out of the language semantic routines. All references to `__stdin.d` have also been removed from the front-end implementation. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 02a64d2e13.
2025-03-24Daily bump.GCC Administrator1-0/+5
2025-03-23d: Fix ICE type variant differs by TYPE_PACKED [PR117621]Iain Buclaw1-1/+1
Introduced by r13-1104-gf4c3ce32fa54c1, which had an accidental self assignment of TYPE_PACKED when it should have been assigned to the type's variants. PR d/117621 gcc/d/ChangeLog: * types.cc (finish_aggregate_type): Propagate TYPE_PACKED to variants. gcc/testsuite/ChangeLog: * gdc.dg/pr117621.d: New test.
2025-03-23Daily bump.GCC Administrator1-0/+24
2025-03-22d: Bump front-end language version to v2.111.0-rc.1.Iain Buclaw2-2/+2
gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 032e24446b. * dmd/VERSION: Bump version to v2.111.0-rc.1.
2025-03-22d: Improve UFCS/property error messageIain Buclaw2-4/+12
Improves on the speller suggestions for UFCS by using the location of the suggested symbol, and considering that local functions aren't eligible for UFCS instead of making a nonsensical suggestion, such as "no property foo, did you mean foo?". gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 9d2f034398. Reviewed-on: https://github.com/dlang/dmd/pull/21046
2025-03-22d: Add C++23 to CppStdRevision enumIain Buclaw6-2/+10
D front-end changes: - The compiler now accepts `-fextern-std=c++23' gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 94950cae58. * d-lang.cc (d_handle_option): Add case for CppStdRevisionCpp23. * gdc.texi: Document -fextern-std=c++23. * lang.opt (fextern-std=): Add c++23. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 94950cae58. Reviewed-on: https://github.com/dlang/dmd/pull/21043
2025-03-22d: Indexing a cast(AA) yields no lvalue anymoreIain Buclaw2-1/+2
gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 8db14cf846. Reviewed-on: https://github.com/dlang/dmd/pull/21029
2025-03-22libphobos: Add module declaration to rt.invariantIain Buclaw1-2/+2
This prevents conflicts with a user-provided `invariant.d' module. gcc/d/ChangeLog: * runtime.def (INVARIANT): Update signature of run-time function. libphobos/ChangeLog: * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Rename rt/invariant.d to rt/invariant_.d. * libdruntime/Makefile.in: Regenerate. * libdruntime/rt/invariant.d: Move to... * libdruntime/rt/invariant_.d: ...here.
2025-03-21Daily bump.GCC Administrator1-0/+5