aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
AgeCommit message (Collapse)AuthorFilesLines
2021-04-20Daily bump.GCC Administrator1-0/+8
2021-04-19d: Fix ICE in when formating a string with '%' or '`' characters (PR98457)Iain Buclaw1-5/+59
The percentage character was being confused for a format specifier in pp_format(), whilst the backtick character was confused for the beginning of a quoted string in expand_d_format(). Both are now properly escaped to avoid the ICE. gcc/d/ChangeLog: PR d/98457 * d-diagnostic.cc (expand_d_format): Handle escaped backticks. (escape_d_format): New funtion. (verror): Call escape_d_format on prefixing strings. (vdeprecation): Likewise. gcc/testsuite/ChangeLog: PR d/98457 * gdc.dg/pr98457.d: New test.
2021-04-18Daily bump.GCC Administrator1-0/+18
2021-04-17d: Add TARGET_D_TEMPLATES_ALWAYS_COMDATIain Buclaw3-3/+23
Following up on the fix for PR99914, when testing on MinGW, it was found not to support weak in the same way as on ELF or Mach-O targets. So the linkage has been reverted back to COMDAT for that target, however in order to properly support overriding functions and variables, all declarations with external linkage must be put on COMDAT. For this a new target hook has been added to control the behavior. gcc/ChangeLog: PR d/99914 * config/i386/winnt-d.c (TARGET_D_TEMPLATES_ALWAYS_COMDAT): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (D language and ABI): Add @hook for TARGET_D_TEMPLATES_ALWAYS_COMDAT. gcc/d/ChangeLog: PR d/99914 * d-target.def (d_templates_always_comdat): New hook. * d-tree.h (mark_needed): Remove prototype. * decl.cc: Include d-target.h. (mark_needed): Rename to... (d_mark_needed): ...this. Make static. (set_linkage_for_decl): Put variables in comdat if d_templates_always_comdat.
2021-04-17d: Implement __traits(getTargetInfo, "objectFormat")Iain Buclaw1-4/+31
Following on from adding TARGET_D_REGISTER_OS_TARGET_INFO, this adds the required handlers to implement `__traits(getTargetInfo, "objectFormat")' for all platforms that have D support files. Some back-ends (i386, rs6000, and pa) have some awarenes of the what object format they are compiling for, so new getTargetInfo handlers have been have added both to those back-ends as well as platform-specific target files to override the default in the D front-end. gcc/ChangeLog: * config/darwin-d.c (darwin_d_handle_target_object_format): New function. (darwin_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/dragonfly-d.c (dragonfly_d_handle_target_object_format): New function. (dragonfly_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/freebsd-d.c (freebsd_d_handle_target_object_format): New function. (freebsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/glibc-d.c (glibc_d_handle_target_object_format): New function. (glibc_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/i386/i386-d.c (ix86_d_handle_target_object_format): New function. (ix86_d_register_target_info): Add ix86_d_handle_target_object_format as handler for objectFormat key. * config/i386/winnt-d.c (winnt_d_handle_target_object_format): New function. (winnt_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/netbsd-d.c (netbsd_d_handle_target_object_format): New function. (netbsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/openbsd-d.c (openbsd_d_handle_target_object_format): New function. (openbsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/pa/pa-d.c (pa_d_handle_target_object_format): New function. (pa_d_register_target_info): Add pa_d_handle_target_object_format as handler for objectFormat key. * config/rs6000/rs6000-d.c (rs6000_d_handle_target_object_format): New function. (rs6000_d_register_target_info): Add rs6000_d_handle_target_object_format as handler for objectFormat key. * config/sol2-d.c (solaris_d_handle_target_object_format): New function. (solaris_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. gcc/d/ChangeLog: * d-target.cc (d_handle_target_object_format): New function. (d_language_target_info): Add d_handle_target_object_format as handler for objectFormat key. (Target::getTargetInfo): Continue if handler returned NULL_TREE.
2021-04-15Daily bump.GCC Administrator1-0/+37
2021-04-14d: Add TARGET_D_REGISTER_OS_TARGET_INFOIain Buclaw2-0/+9
This allows target platforms that have D support files to defined their own target-specific information keys. gcc/ChangeLog: * doc/tm.texi: Regenerate. * doc/tm.texi.in (D language and ABI): Add @hook for TARGET_D_REGISTER_OS_TARGET_INFO. gcc/d/ChangeLog: * d-target.cc (Target::_init): Call new targetdm hook to register OS specific target info keys. * d-target.def (d_register_os_target_info): New hook.
2021-04-14d: Remove setting of target-specific global.params flags from front-endIain Buclaw2-23/+1
Now that all dependencies on these flags have been removed, there's no need to test and set them. gcc/d/ChangeLog: * d-builtins.cc (d_add_builtin_version): Remove all setting of target-specific global.params. * typeinfo.cc (create_typeinfo): Don't add argType fields to TypeInfo_Struct.
2021-04-14d: Move call to set_linkage_for_decl to declare_extern_var.Iain Buclaw1-4/+2
This both prevents against it being called twice for declarations that are defined, and fixes an issue where variables defined in the compilation get one kind of linkage (weak), and the same variables declared via declare_extern_var get another (extern). gcc/d/ChangeLog: PR d/99914 * decl.cc (DeclVisitor::visit (StructDeclaration *)): Don't set DECL_INSTANTIATED on static initializer declarations. (DeclVisitor::visit (ClassDeclaration *)): Likewise. (DeclVisitor::visit (EnumDeclaration *)): Likewise. (d_finish_decl): Move call to set_linkage_for_decl to... (declare_extern_var): ...here.
2021-04-14d: Add TARGET_D_REGISTER_CPU_TARGET_INFOIain Buclaw2-0/+13
This implements `__traits(getTargetInfo, "floatAbi")' for all targets that have D support files. gcc/ChangeLog: * config/aarch64/aarch64-d.c (aarch64_d_handle_target_float_abi): New function. (aarch64_d_register_target_info): New function. * config/aarch64/aarch64-protos.h (aarch64_d_register_target_info): Declare. * config/aarch64/aarch64.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/arm/arm-d.c (arm_d_handle_target_float_abi): New function. (arm_d_register_target_info): New function. * config/arm/arm-protos.h (arm_d_register_target_info): Declare. * config/arm/arm.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/i386/i386-d.c (ix86_d_handle_target_float_abi): New function. (ix86_d_register_target_info): New function. * config/i386/i386-protos.h (ix86_d_register_target_info): Declare. * config/i386/i386.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/mips/mips-d.c (mips_d_handle_target_float_abi): New function. (mips_d_register_target_info): New function. * config/mips/mips-protos.h (mips_d_register_target_info): Declare. * config/mips/mips.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/pa/pa-d.c (pa_d_handle_target_float_abi): New function. (pa_d_register_target_info): New function. * config/pa/pa-protos.h (pa_d_register_target_info): Declare. * config/pa/pa.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/riscv/riscv-d.c (riscv_d_handle_target_float_abi): New function. (riscv_d_register_target_info): New function. * config/riscv/riscv-protos.h (riscv_d_register_target_info): Declare. * config/riscv/riscv.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/rs6000/rs6000-d.c (rs6000_d_handle_target_float_abi): New function. (rs6000_d_register_target_info): New function. * config/rs6000/rs6000-protos.h (rs6000_d_register_target_info): Declare. * config/rs6000/rs6000.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/s390/s390-d.c (s390_d_handle_target_float_abi): New function. (s390_d_register_target_info): New function. * config/s390/s390-protos.h (s390_d_register_target_info): Declare. * config/s390/s390.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/sparc/sparc-d.c (sparc_d_handle_target_float_abi): New function. (sparc_d_register_target_info): New function. * config/sparc/sparc-protos.h (sparc_d_register_target_info): Declare. * config/sparc/sparc.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (D language and ABI): Add @hook for TARGET_D_REGISTER_CPU_TARGET_INFO. gcc/d/ChangeLog: * d-target.cc (Target::_init): Call new targetdm hook to register CPU specific target info keys. * d-target.def (d_register_cpu_target_info): New hook.
2021-04-14d: Add TARGET_D_HAS_STDCALL_CONVENTIONIain Buclaw3-7/+37
This replaces the use of the D front-end `is64bit' parameter in determining whether to insert the "stdcall" function attribute. It is also used to determine whether `extern(System)' should be the same as `extern(Windows)' in the implementation of Target::systemLinkage. gcc/ChangeLog: * config/i386/i386-d.c (ix86_d_has_stdcall_convention): New function. * config/i386/i386-protos.h (ix86_d_has_stdcall_convention): Declare. * config/i386/i386.h (TARGET_D_HAS_STDCALL_CONVENTION): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (D language and ABI): Add @hook for TARGET_D_HAS_STDCALL_CONVENTION. gcc/d/ChangeLog: * d-target.cc (Target::systemLinkage): Return LINKwindows if d_has_stdcall_convention applies to LINKsystem. * d-target.def (d_has_stdcall_convention): New hook. * types.cc (TypeVisitor::visit (TypeFunction *)): Insert "stdcall" function attribute if d_has_stdcall_convention applies to LINKwindows.
2021-04-11Daily bump.GCC Administrator1-0/+4
2021-04-10d: Merge upstream dmd 0450061c8Iain Buclaw11-17/+150
D front-end changes: - Fix ICE in forward referenced type members of structs. - Fix ICE passing a member template mixin identifier as alias argument. - Fix ICE when `__traits' prints error involving a Parameter. - Fix bugs found in `__traits(allMembers)' returning wrong result. - Detect and shortcut Alias and AliasSeq template patterns. Reviewed-on: https://github.com/dlang/dmd/pull/12405 https://github.com/dlang/dmd/pull/12411 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 0450061c8.
2021-04-09Daily bump.GCC Administrator1-0/+43
2021-04-08d: Update language attribute support, and implement gcc.attributesIain Buclaw3-141/+702
D attribute support has been updated to have a baseline parity with the LLVM D compiler's own `ldc.attributes'. The handler that extracts GCC attributes from a list of UDAs has been improved to take care of some mistakes that could have been warnings. UDAs attached to field variables are also now processed for any GCC attributes attached to them. The following new attributes have been added to the D front-end: - @attribute("alloc_size") - @attribute("used") - @attribute("optimize") - @attribute("restrict") - @attribute("cold") - @attribute("noplt") - @attribute("target_clones") - @attribute("no_icf") - @attribute("noipa") - @attribute("symver") With convenience aliases in a new `gcc.attributes' module to match the same naming convention as `ldc.attributes': - @allocSize() - @assumeUsed - @fastmath - @naked - @restrict - @cold - @noplt - @optStrategy() - @polly - @section() - @target() - @weak The old gcc.attribute module has been deprecated, along with the removal of the following attribute handlers: - @attribute("alias"): Has been superseded by `pragma(mangle)'. - @attribute("forceinline"): Renamed to always_inline. gcc/d/ChangeLog: * d-attribs.cc: Include fold-const.h and opts.h. (attr_noreturn_exclusions): Add alloc_size. (attr_const_pure_exclusions): Likewise. (attr_inline_exclusions): Add target_clones. (attr_noinline_exclusions): Rename forceinline to always_inline. (attr_target_exclusions): New array. (attr_target_clones_exclusions): New array. (attr_alloc_exclusions): New array. (attr_cold_hot_exclusions): New array. (d_langhook_common_attribute_table): Add new D attribute handlers. (build_attributes): Update to look for gcc.attributes. Issue warning if not given a struct literal. Handle void initialized arguments. (handle_always_inline_attribute): Remove function. (d_handle_noinline_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_forceinline_attribute): Rename to... (d_handle_always_inline_attribute): ...this. Remove special handling. (d_handle_flatten_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_target_attribute): Likewise. Warn about empty arguments. (d_handle_target_clones_attribute): New function. (optimize_args): New static variable. (parse_optimize_options): New function. (d_handle_optimize_attribute): New function. (d_handle_noclone_attribute): Don't extract TYPE_LANG_FRONTEND. (d_handle_alias_attribute): Remove function. (d_handle_noicf_attribute): New function. (d_handle_noipa_attribute): New function. (d_handle_section_attribute): Call the handle_generic_attribute target hook after performing target independent processing. (d_handle_symver_attribute): New function. (d_handle_noplt_attribute): New function. (positional_argument): New function. (d_handle_alloc_size_attribute): New function. (d_handle_cold_attribute): New function. (d_handle_restrict_attribute): New function. (d_handle_used_attribute): New function. * decl.cc (gcc_attribute_p): Update to look for gcc.attributes. (get_symbol_decl): Update decl source location of old prototypes to the new declaration being merged. * types.cc (layout_aggregate_members): Apply user defined attributes on fields. libphobos/ChangeLog: * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add gcc/attributes.d. * libdruntime/Makefile.in: Regenerate. * libdruntime/gcc/attribute.d: Deprecate module, publicly import gcc.attributes. * libdruntime/gcc/deh.d: Update imports. * libdruntime/gcc/attributes.d: New file. gcc/testsuite/ChangeLog: * gdc.dg/gdc108.d: Update test. * gdc.dg/gdc142.d: Likewise. * gdc.dg/pr90136a.d: Likewise. * gdc.dg/pr90136b.d: Likewise. * gdc.dg/pr90136c.d: Likewise. * gdc.dg/pr95173.d: Likewise. * gdc.dg/attr_allocsize1.d: New test. * gdc.dg/attr_allocsize2.d: New test. * gdc.dg/attr_alwaysinline1.d: New test. * gdc.dg/attr_cold1.d: New test. * gdc.dg/attr_exclusions1.d: New test. * gdc.dg/attr_exclusions2.d: New test. * gdc.dg/attr_flatten1.d: New test. * gdc.dg/attr_module.d: New test. * gdc.dg/attr_noclone1.d: New test. * gdc.dg/attr_noicf1.d: New test. * gdc.dg/attr_noinline1.d: New test. * gdc.dg/attr_noipa1.d: New test. * gdc.dg/attr_noplt1.d: New test. * gdc.dg/attr_optimize1.d: New test. * gdc.dg/attr_optimize2.d: New test. * gdc.dg/attr_optimize3.d: New test. * gdc.dg/attr_optimize4.d: New test. * gdc.dg/attr_restrict1.d: New test. * gdc.dg/attr_section1.d: New test. * gdc.dg/attr_symver1.d: New test. * gdc.dg/attr_target1.d: New test. * gdc.dg/attr_targetclones1.d: New test. * gdc.dg/attr_used1.d: New test. * gdc.dg/attr_used2.d: New test. * gdc.dg/attr_weak1.d: New test. * gdc.dg/imports/attributes.d: New test.
2021-04-07Daily bump.GCC Administrator1-0/+20
2021-04-06d: Fix missing call to va_end in getMatchError [PR99917]Iain Buclaw2-1/+2
Reviewed-on: https://github.com/dlang/dmd/pull/12380 gcc/d/ChangeLog: PR d/99917 * dmd/MERGE: Merge upstream dmd d16195406.
2021-04-06d: Use Array::find to get index of elementIain Buclaw1-18/+10
gcc/d/ChangeLog: * d-codegen.cc (build_frame_type): Use Array::find to get index of element.
2021-04-06d: Increment gaggedWarnings if warning or deprecation message was suppressedIain Buclaw1-0/+4
gcc/d/ChangeLog: * d-diagnostic.cc (vwarning): Increment gaggedWarnings if warning message was suppressed. (vdeprecation): Likewise for deprecation messages.
2021-04-06d: Merge upstream dmd 5cc71ff83, druntime 1134b710Iain Buclaw5-57/+77
D front-end changes: - Fix ICEs that occurred when using opaque enums. - Update `pragma(printf)' checking code to work on 16-bit targets. Phobos change: - Don't compile in argTypes code on AArch64 Reviewed-on: https://github.com/dlang/dmd/pull/12378 https://github.com/dlang/druntime/pull/3431 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 5cc71ff83. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 1134b710.
2021-04-06Daily bump.GCC Administrator1-0/+40
2021-04-05d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914)Iain Buclaw7-72/+89
The default linkage of templates in the D language is now DECL_WEAK instead of DECL_ONE_ONLY, if supported. This better matches the expected override semantics of template symbols compiled to object code. For example: module rt.config; template rt_flag() { pragma(mangle, "rt_flag") __gshared bool rt_flag = true; } module main; extern(C) __gshared bool rt_flag = false; The above currently does not succeed in linking due to there being multiple definitions of `rt_flag' in different sections that aren't considered mergeable. The compiler flag enabling toggling of this has been given a clearer named `-fweak-templates', which distinguishes itself from G++ `-fweak', which is intended only for testing. gcc/d/ChangeLog: PR d/99914 * d-lang.cc (d_init): Disable flag_weak_templates if no support for weak or one-only symbols. * d-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. (DECL_INSTANTIATED): New macro. (d_comdat_linkage): Remove declaration. (d_linkonce_linkage): Remove declaration. (set_linkage_for_decl): New declaration. * decl.cc (DeclVisitor::visit (StructDeclaration *)): Replace call to d_linkonce_linkage with setting DECL_INSTANTIATED. (DeclVisitor::visit (ClassDeclaration *)): Likewise. (DeclVisitor::visit (EnumDeclaration *)): Likewise. (DeclVisitor::visit (InterfaceDeclaration *)): Remove call to d_linkonce_linkage. (get_symbol_decl): Call set_linkage_for_decl instead of d_linkonce_linkage. (d_finish_decl): Call set_linkage_for_decl. (d_comdat_linkage): Made function static. Only set DECL_COMDAT for DECL_INSTANTIATED decls. (d_linkonce_linkage): Remove function. (d_weak_linkage): New function. (set_linkage_for_decl): New function. * gdc.texi (Runtime Options): Rename -fno-weak to -fno-weak-templates, update documentation of option. * lang.opt (fweak): Rename option to ... (fweak-templates): ... this. Update help string. * modules.cc (get_internal_fn): Add Prot parameter. Set generated function flag. (build_internal_fn): Update call to get_internal_fn. (build_dso_cdtor_fn): Likewise. (register_moduleinfo): Call d_finish_decl on dso_slot_node and dso_initialized_node. * typeinfo.cc (TypeInfoVisitor::internal_reference): Call set_linkage_for_decl instead of d_comdat_linkage. (TypeInfoDeclVisitor::visit (TypeInfoDeclaration *)): Remove calls to d_linkonce_linkage and d_comdat_linkage. (get_cpp_typeinfo_decl): Likewise. gcc/testsuite/ChangeLog: PR d/99914 * gdc.dg/pr99914.d: New test.
2021-04-04Daily bump.GCC Administrator1-0/+17
2021-04-04d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217aIain Buclaw51-2269/+4332
D front-end changes: - Explicit package visibility attribute is now always applied to introducing scopes. - Added `__traits(totype, string)' to convert mangled type string to an existing type. - Printf-like and scanf-like functions are now detected by prefixing them with `pragma(printf)' for printf-like functions or `pragma(scanf)' for scanf-like functions. - Added `__c_wchar_t', `__c_complex_float', `__c_complex_double', and `__c_complex_real' types for interfacing with C and C++. - Template alias parameters can now be instantiated with basic types, such as `int` or `void function()`. - Mixins can now be used as types in the form `mixin(string) var'. - Mixin expressions can take an argument list, same as `pragma(msg)'. - Implement DIP1034, add `typeof(*null)' types to represent `noreturn'. - `pragma(msg)' can print expressions of type `void'. - It is now an error to use private variables selectively imported from other modules. Due to a bug, some imported private members were visible from other modules, violating the specification. - Added new syntax to declare an alias to a function type using the `alias' syntax based on the assignment operator. - Function literals can now return a value by reference. Phobos changes: - Synchronize C bindings with the latest port fixes in upstream druntime. - Added alias for a `noreturn' type in object.d - Make use of the new `pragma(printf)' and `pragma(scanf)' pragmas, fix all code that got flagged as being incorrect. - Fixed code that relied on bugs in the D import package system. Reviewed-on: https://github.com/dlang/dmd/pull/12339 https://github.com/dlang/druntime/pull/3422 https://github.com/dlang/phobos/pull/7932 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 3b808e838. * Make-lang.in (D_FRONTEND_OBJS): Add d/chkformat.o. * d-codegen.cc (build_struct_literal): Handle special enums. * d-convert.cc (convert_expr): Handle noreturn type. (convert_for_condition): Likewise. * d-target.cc (Target::_init): Set type for wchar_t. (TargetCPP::derivedClassOffset): New method. (Target::libraryObjectMonitors): New method. * decl.cc (get_symbol_decl): Set TREE_THIS_VOLATILE for functions of type noreturn. * toir.cc (IRVisitor::visit (ReturnStatement *)): Handle returning noreturn types. * types.cc (TypeVisitor::visit (TypeNoreturn *)): New method. (TypeVisitor::visit (TypeEnum *)): Handle special enums. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 483bc129. * libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/fcntl.d. (DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/unistd.d. (DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/stdc/malloc.d. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos f89dc217a. * src/Makefile.am (PHOBOS_DSOURCES): Add std/regex/internal/tests2.d. * src/Makefile.in: Regenerate. * testsuite/libphobos.exceptions/chain.d: Fix format arguments. * testsuite/libphobos.exceptions/line_trace.d: Likewise.
2021-03-29Daily bump.GCC Administrator1-0/+30
2021-03-28d: Predefine the D_PIE version condition when flag_pie is set.Iain Buclaw1-0/+2
Same as the D_PIC version condition, which is set by flag_pic. gcc/d/ChangeLog: * d-builtins.cc (d_init_versions): Predefine D_PIE if flag_pie is set.
2021-03-28d: Define language hook for LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPEIain Buclaw1-0/+12
The underlying base type for enumerals are always present in TREE_TYPE. gcc/d/ChangeLog: * d-lang.cc (d_enum_underlying_base_type): New function. (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Set as d_enum_underlying_base_type.
2021-03-28d: Use COMPILER_FOR_BUILD to build all D front-end generator programsIain Buclaw2-3/+15
This means the correct config headers are included when building the D front-end in a Canadian cross configuration. gcc/d/ChangeLog: * Make-lang.in (DMDGEN_COMPILE): Remove. (d/%.dmdgen.o): Use COMPILER_FOR_BUILD and BUILD_COMPILERFLAGS to build all D generator programs. (D_SYSTEM_H): New macro. (d/idgen.dmdgen.o): Add dependencies to build. (d/impcnvgen.dmdgen.o): Likewise. * d-system.h: Include bconfig.h if GENERATOR_FILE is defined.
2021-03-28d: Don't generate per-module wrapper for calling DSO constructor/destructor.Iain Buclaw2-32/+6
The static constructor/destructor list only ever has one function to call in it, so mark the gdc.dso_ctor and gdc.dso_dtor functions as static ctor/dtor directly instead. gcc/d/ChangeLog: * config-lang.in (gtfiles): Remove modules.cc. * modules.cc (struct module_info): Remove GTY marker. (static_ctor_list): Remove variable. (static_dtor_list): Remove variable. (register_moduleinfo): Directly set DECL_STATIC_CONSTRUCTOR on dso_ctor, and DECL_STATIC_DESTRUCTOR on dso_dtor. (d_finish_compilation): Remove static ctor/dtor handling. gcc/testsuite/ChangeLog: * gdc.dg/gdc270a.d: Removed. * gdc.dg/gdc270b.d: Removed.
2021-03-07Daily bump.GCC Administrator1-0/+5
2021-03-06d: Don't set default flag_complex_method.Iain Buclaw1-3/+0
D doesn't need C99-like requirements for complex multiply and divide, the default set by common.opt is sufficient enough. gcc/d/ChangeLog: * d-lang.cc (d_init_options_struct): Don't set default flag_complex_method.
2021-03-04Daily bump.GCC Administrator1-0/+5
2021-03-03d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]Iain Buclaw2-2/+2
The code wrongly assumed memcmp did not read past the mismatch. Reviewed-on: https://github.com/dlang/dmd/pull/12247 gcc/d/ChangeLog: PR d/99337 * dmd/MERGE: Merge upstream dmd a3c9bf422.
2021-02-14Daily bump.GCC Administrator1-0/+10
2021-02-13d: Merge upstream dmd 7132b3537Iain Buclaw139-9782/+9937
Splits out all semantic passes for Dsymbol, Type, and TemplateParameter nodes into Visitors in separate files, and the copyright years of all sources have been updated. Reviewed-on: https://github.com/dlang/dmd/pull/12190 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 7132b3537. * Make-lang.in (D_FRONTEND_OBJS): Add d/dsymbolsem.o, d/semantic2.o, d/semantic3.o, and d/templateparamsem.o. * d-compiler.cc (Compiler::genCmain): Update calls to semantic entrypoint functions. * d-lang.cc (d_parse_file): Likewise. * typeinfo.cc (make_frontend_typeinfo): Likewise.
2021-02-06Daily bump.GCC Administrator1-0/+9
2021-02-05d: Remove the expansion of intrinsic and built-in codes from the ↵Iain Buclaw3-107/+195
DEF_D_INTRINSIC macro Instead, the full name of these codes are explicitly given in intrinsics.def, to make it clear what these values map to. gcc/d/ChangeLog: * d-tree.h (DEF_D_INTRINSIC): Don't insert INTRINSIC_ into the intrinsic code name. * intrinsics.cc (DEF_D_INTRINSIC): Don't insert INTRISIC_ and BUILT_IN_ into the intrinsic and built-in code names. * intrinsics.def: Explicitly use full intrinsic and built-in codes in all definitions.
2021-02-05Daily bump.GCC Administrator1-0/+35
2021-02-04d: Merge upstream dmd 46133f761, druntime 0fd4364cIain Buclaw9-36/+130
D front-end changes: - Backported built-in function handling from upstream. - Added new intrinsic `byteswap(ushort)`. Druntime changes: - Update intrinsic modules core.bitop, core.checkedint, core.simd, core.vararg, and core.volatile. - Backport platform-specific fixes for runtime modules core.cpuid, core.internal.traits, and rt.lifetime. - Backport openbsd fixes for core.stdc.stdio. - Backport solaris fixes for core.sys.posix.locale, and core.thread.osthread (PR98910). gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 46133f761. * d-builtins.cc (d_build_builtins_module): Set builtins as BUILTINgcc. (maybe_set_builtin_1): Likewise. * d-frontend.cc (eval_builtin): Adjust condition for early return. * intrinsics.cc (maybe_set_intrinsic): Set intrinsics as BUILTINgcc. (maybe_expand_intrinsic): Add case for INTRINSIC_BSWAP16. * intrinsics.def (INTRINSIC_BT): Update signature. (INTRINSIC_BT64): Likewise. (INTRINSIC_BSWAP16): New intrinsic. (INTRINSIC_VLOAD8): Update module. (INTRINSIC_VLOAD16): Likewise. (INTRINSIC_VLOAD32): Likewise. (INTRINSIC_VLOAD64): Likewise. (INTRINSIC_VSTORE8): Likewise. (INTRINSIC_VSTORE16): Likewise. (INTRINSIC_VSTORE32): Likewise. (INTRINSIC_VSTORE64): Likewise. (INTRINSIC_ADDS): Update signature. (INTRINSIC_ADDSL): Likewise. (INTRINSIC_ADDU): Likewise. (INTRINSIC_ADDUL): Likewise. (INTRINSIC_SUBS): Likewise. (INTRINSIC_SUBSL): Likewise. (INTRINSIC_SUBU): Likewise. (INTRINSIC_SUBUL): Likewise. (INTRINSIC_MULS): Likewise. (INTRINSIC_MULSL): Likewise. (INTRINSIC_MULU): Likewise. (INTRINSIC_MULUI): Likewise. (INTRINSIC_MULUL): Likewise. (INTRINSIC_NEGS): Likewise. (INTRINSIC_NEGSL): Likewise. libphobos/ChangeLog: PR d/98910 * libdruntime/MERGE: Merge upstream druntime 0fd4364c. * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add core/volatile.d. * libdruntime/Makefile.in: Regenerate. * testsuite/libphobos.allocations/tls_gc_integration.d: Update test. gcc/testsuite/ChangeLog: * gdc.dg/intrinsics.d: Update test.
2021-02-03Daily bump.GCC Administrator1-0/+5
2021-02-02d: Fix junk in generated symbol on powerpc64-*-* [PR98921]Iain Buclaw4-10/+53
This adds a special formatter to OutBuffer to handle formatted printing of integers, a common case. The replacement is faster and safer. In dmangle.c, it also gets rid of a number of problematic casts, as seen on powerpc64 targets. Reviewed-on: https://github.com/dlang/dmd/pull/12174 gcc/d/ChangeLog: PR d/98921 * dmd/MERGE: Merge upstream dmd 5e2a81d9c.
2021-01-31Daily bump.GCC Administrator1-0/+5
2021-01-30libphobos: Synchronize libdruntime bindings with upstream druntimeIain Buclaw1-16/+0
Reviewed-on: https://github.com/dlang/druntime/pull/3348 gcc/d/ChangeLog: * typeinfo.cc (TypeInfoVisitor::visit (TypeInfoDeclaration *)): Don't layout m_arg1 and m_arg2 fields. libphobos/ChangeLog: * Makefile.in: Regenerate. * configure: Regenerate. * libdruntime/MERGE: Merge upstream druntime e4aae28e. * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Refresh module list. (DRUNTIME_DSOURCES_BIONIC): Add core/sys/bionic/err.d. (DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/err.d, core/sys/darwin/ifaddrs.d, core/sys/darwin/mach/nlist.d, core/sys/darwin/mach/stab.d, and core/sys/darwin/sys/attr.d. (DRUNTIME_DSOURCES_DRAGONFLYBSD): Add core/sys/dragonflybsd/err.d. (DRUNTIME_DSOURCES_FREEBSD): Add core/sys/freebsd/err.d. (DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/err.d. (DRUNTIME_DSOURCES_NETBSD): Add core/sys/netbsd/err.d. (DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/err.d. (DRUNTIME_DSOURCES_POSIX): Add core/sys/posix/locale.d, core/sys/posix/stdc/time.d, core/sys/posix/string.d, and core/sys/posix/strings.d. (DRUNTIME_DSOURCES_SOLARIS): Add core/sys/solaris/err.d. (DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/sdkddkver.d, and core/sys/windows/stdc/time.d * libdruntime/Makefile.in: Regenerate. * libdruntime/gcc/sections/elf_shared.d (sizeofTLS): New function. * testsuite/libphobos.thread/fiber_guard_page.d: Use __traits(getMember) to get internal fields.
2021-01-27Daily bump.GCC Administrator1-0/+8
2021-01-26d: Merge upstream dmd 609c3ce2d, phobos 3dd5df686Iain Buclaw9-10/+51
D front-end changes: - Contracts for pre- and postconditions are now implicitly "this" const, so that state can no longer be altered in these functions. - Inside a constructor scope, assigning to aggregate declaration members is done by considering the first assignment as initialization and subsequent assignments as modifications of the constructed object. For const/immutable fields the initialization is accepted in the constructor but subsequent modifications are not. However this rule did not apply when inside a constructor scope there is a call to a different constructor. This been changed so it is now an error when there's a double initialization of immutable fields inside a constructor. Phobos changes: - Don't run unit-tests for unsupported clocks in std.datetime. The phobos and phobos_shared tests now add -fversion=Linux_Pre_2639 if required. - Deprecate public extern(C) bindings for getline and getdelim in std.stdio. The correct module for bindings is core.sys.posix.stdio. Reviewed-on: https://github.com/dlang/dmd/pull/12153 https://github.com/dlang/phobos/pull/7768 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 609c3ce2d. * d-compiler.cc (Compiler::loadModule): Rename to ... (Compiler::onParseModule): ... this. (Compiler::onImport): New function. * d-lang.cc (d_parse_file): Remove call to Compiler::loadModule. libphobos/ChangeLog: * src/MERGE: Merge upstream phobos 3dd5df686. * testsuite/libphobos.phobos/phobos.exp: Add compiler flag -fversion=Linux_Pre_2639 if target is linux_pre_2639. * testsuite/libphobos.phobos_shared/phobos_shared.exp: Likewise.
2021-01-22Daily bump.GCC Administrator1-0/+4
2021-01-21d: Enable private member access for __traitsIain Buclaw2-7/+5
The following traits can now access non-public members: - hasMember - getMember - getOverloads - getVirtualMethods - getVirtualFuntions This fixes a long-standing issue in D where the allMembers trait would correctly return non-public members but those non-public members would be inaccessible to other traits. Reviewed-on: https://github.com/dlang/dmd/pull/12135 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 3a7ebef73.
2021-01-12Daily bump.GCC Administrator1-0/+10
2021-01-11d: Remove visibility and lookup deprecationIain Buclaw15-245/+61
The deprecation phase for access checks is finished. The `-ftransition=import` and `-ftransition=checkimports` switches no longer have an effect and are now removed. Symbols that are not visible in a particular scope will no longer be found by the compiler. Reviewed-on: https://github.com/dlang/dmd/pull/12124 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 2d3d13748. * d-lang.cc (d_handle_option): Remove OPT_ftransition_checkimports and OPT_ftransition_import. * gdc.texi (Warnings): Remove documentation for -ftransition=import and -ftransition=checkimports. * lang.opt (ftransition=checkimports): Remove. (ftransition=import): Remove.
2021-01-10Daily bump.GCC Administrator1-0/+12