[committed] d: Warn when declared size of a special enum does not match its intrinsic type.

2023-06-05 Thread Iain Buclaw via Gcc-patches
Hi, All special enums have declarations in the D runtime library, but the compiler will recognize and treat them specially if declared in any module. When the underlying base type of a special enum is a different size to its matched intrinsic, then this can cause undefined behavior at runtime. D

[GCC 12, committed] d: Merge upstream dmd 316b89f1e3, phobos 8e8aaae50.

2023-06-06 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd 316b89f1e3, and standard library with phobos 8e8aaae50. Updates the D language version to v2.100.2 in the GCC 12 release branch. Phobos changes: - Fix instantiating std.container.array.Array!T where T is a shared class. - Fix

Re: [PATCH] Use substituted GDCFLAGS

2023-07-27 Thread Iain Buclaw via Gcc-patches
Excerpts from Andreas Schwab via Gcc-patches's message of Juli 24, 2023 11:15 am: > Ping? > OK from me. Thanks, Iain.

[10, committed] d: Fix error: aggregate value used where floating point was expected (PR106139)

2022-07-05 Thread Iain Buclaw via Gcc-patches
Hi, This is the GCC-10 backport of the fix for PR106139 posted last week. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to releases/gcc-10. Regards, Iain. --- PR d/106139 gcc/d/ChangeLog: * d-convert.cc (convert_expr): Handle casting from arr

[11, committed] d: Fix error: aggregate value used where floating point was expected (PR106139)

2022-07-05 Thread Iain Buclaw via Gcc-patches
Hi, This is the GCC-11 backport of the fix for PR106139 posted last week. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to releases/gcc-11. Regards, Iain. --- PR d/106139 gcc/d/ChangeLog: * d-convert.cc (convert_expr): Handle casting from arr

[committed] d: Build the D sources in the front-end with -fno-exceptions

2022-07-06 Thread Iain Buclaw via Gcc-patches
Hi, The D front-end does not use exceptions, but it still requires RTTI for some lowerings of convenience language features. This patch enforces that by now building GDC with `-fno-exceptions'. Bootstrapped with gcc-9, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * M

[committed] d: Merge upstream dmd 56589f0f4, druntime 651389b5, phobos 1516ecad9.

2022-07-06 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd 56589f0f4, and the standard library with druntime 651389b5 and phobos 1516ecad9. D front-end changes: - Import latest bug fixes to mainline. D runtime changes: - Import latest bug fixes to mainline. Phobos changes: - Import

[PATCH] d: Move DSO registry support code from compiler to drtstuff in library (PR100062)

2022-07-08 Thread Iain Buclaw via Gcc-patches
Hi, Currently the DSO support for D runtime is generated by the compiler in every object, when really it is only required once per shared object. This patch moves that support logic from the compiler itself to the library as part of the drtstuff code. The object files drtbegin.o and drtend.o are

Re: [PATCH] libphobos: Fix instability in the parallelized testsuite

2022-07-15 Thread Iain Buclaw via Gcc-patches
Excerpts from Lewis Hyatt via Gcc-patches's message of Juli 14, 2022 11:53 pm: > Hello- > > I get a different number of test results from libphobos.unittest/unittest.exp, > depending on server load. I believe it's because this testsuite doesn't check > runtest_file_p: > > $ make -j 1 RUNTESTFLAGS

[GCC 12, committed] d: Merge upstream dmd 76e3b41375, druntime 1462ebd1, phobos 5fef0d28f.

2022-07-26 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd 76e3b41375, and standard run-time libraries with druntime 1462ebd1, and phobos 5fef0d28f, updating the D language version to v2.100.1. D front-end changes: - Fix delegate literal with inferred return value that requires following

[committed] d: Fix ICE in in add_stack_var, at cfgexpand.cc:476 (PR106555)

2022-08-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes the ICE reported in PR d/106555. The type that triggers the ICE never got completed by the semantic analysis pass. Checking for size forces it to be done, or issue a compile-time error. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline

[committed] d: Fix undefined reference to pragma(inline) symbol (PR106563)

2022-08-09 Thread Iain Buclaw via Gcc-patches
Hi, This patch changes the emission strategy for inline functions so that they are given codegen in every referencing module, not just the module that they are defined in. Functions that are declared `pragma(inline)' should be treated as if they are defined in every translation unit they are refe

[committed][GCC 12] d: Fix internal compiler error: in layout_aggregate_type, at d/types.cc:574

2023-08-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE that is specific to the D front-end language version in GDC 12. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, committed to releases/gcc-12. The pr110959.d test case has also been committed to mainline to catch the unlikely event of a regression. Regard

[committed] d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.

2023-08-20 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end and run-time library with upstream dmd 26f049fb26, and standard library with phobos 330d6a4fd. Synchronizing with the latest bug fixes in the v2.105.0-beta.1 release. D front-end changes: - Import dmd v2.105.0-beta.1. - Added predefined vers

[committed] d: Merge upstream dmd, druntime a45f4e9f43, phobos 106038f2e.

2023-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end and run-time library with upstream dmd 5f7552bb28, and standard library with phobos 106038f2e. Synchronizing with the latest bug fixes in the v2.103.1 release. D front-end changes: - Import dmd v2.103.1. - Deprecated invalid special token se

[GCC13][committed] d: Fix crash in d/dmd/root/aav.d:127 dmd_aaGetRvalue from DsymbolTable::lookup (PR110113)

2023-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This backports patch from upstream dmd mainline for fixing PR110113. The data being Mem.xrealloc'd contains many Array(T) fields, some of which have self references in their data.ptr field thanks to the smallarray optimization used by Array. Naturally then, the memcpy from old GC data to new

[committed] d: Suboptimal codegen for __builtin_expect(cond, false)

2023-06-25 Thread Iain Buclaw via Gcc-patches
Hi, Since PR96435, both boolean objects and expressions have been evaluated in the following way by the D front-end. (*(ubyte*)&obj_or_expr) & 1 It has been noted that sometimes this can cause the back-end to optimize in non-obvious ways - in particular with __builtin_expect. This @safe fea

[committed] d: Fix d_signed_or_unsigned_type is invoked for vector types (PR110193)

2023-06-28 Thread Iain Buclaw via Gcc-patches
Hi, The function being changed in this patch can be invoked on VECTOR_TYPE, but the implementation assumes it works on integer types only. To fix, added a check whether the type passed is any `__vector(T)' or non-integral type, and return early by calling `signed_or_unsigned_type_for()' instead.

[committed] d: Fix wrong code-gen when returning structs by value.

2023-06-28 Thread Iain Buclaw via Gcc-patches
Hi, Since r13-1104, structs in the D have had compute_record_mode called too early on them, causing them to return differently depending on the order that types are generated in, and whether there are forward references. This patch moves the call to compute_record_mode into its own function, and

[GCC 11][committed] d: Fix ICE in setValue, at d/dmd/dinterpret.c:7013

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports ICE fix from upstream which is already part of GCC-12 and later. When casting null to integer or real, instead of painting the type on the NullExp, we emplace an IntegerExp/RealExp with the value zero. Same as when casting from NullExp to bool. Bootstrapped and regressi

[committed] d: Don't generate code that throws exceptions when compiling with `-fno-exceptions'

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, The version flags for RTMI, RTTI, and exceptions was unconditionally predefined. These are now only predefined if the feature flag is enabled. It was noticed that there was no `-fexceptions' definition inside d/lang.opt, so the detection of the exceptions option flag was only partially worki

[committed] d: Fix accesses of immutable arrays using constant index still bounds checked

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch sets TREE_READONLY on all non-static const and immutable variables in D, as well as all static immutable variables that aren't initialized by a module constructor. This allows more aggressive constant folding of D code which makes use of `immutable' or `const'. Bootstrapped and re

[committed] d: Fix core.volatile.volatileLoad discarded if result is unused

2023-07-01 Thread Iain Buclaw via Gcc-patches
Hi, The first pass of code generation in the D front-end splits up all compound expressions and discards expressions that have no side effects. This included calls to the `volatileLoad' intrinsic if its result was not used, causing such calls to be eliminated from the program. We already set TREE

Re: [PATCH] libphobos: Handle Darwin Arm and AArch64 in fibre context asm.

2023-07-02 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of Juli 2, 2023 12:22 pm: > Tested on AArch64 (Arm64) Darwin on 11.x, 13.x and master, > OK for trunk? > and backports? > thanks > Iain > > --- 8< --- > > This code currently fails to build because it contains ELF- > specific directives. This patch excludes th

[committed] d: Add testcase from PR108962

2023-07-02 Thread Iain Buclaw via Gcc-patches
Hi, This adds testcase from PR108962 into the gdc testsuite. The issue was fixed in r14-2232 and backported to gcc-13. Regtested, committed to mainline and gcc-13 branches. Regards, Iain. --- PR d/108962 gcc/testsuite/ChangeLog: * gdc.dg/pr108962.d: New test. --- gcc/testsui

[committed] d: Fix testcase failure of gdc.dg/Wbuiltin_declaration_mismatch2.d.

2023-07-02 Thread Iain Buclaw via Gcc-patches
Hi, Seen at least on aarch64-*-darwin, the parameters used to instantiate the shufflevector intrinsic meant the return type was __vector(int[1]), which resulted in the error: vector type '__vector(int[1])' is not supported on this platform. All instantiations have now been fixed so the expec

[committed] d: Fix PR 108842: Cannot use enum array with -fno-druntime

2023-07-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch restricts generating of CONST_DECLs for D manifest constants to just scalars without pointers. It shouldn't happen that a reference to a manifest constant has not been expanded within a function body during codegen, but it has been found to occur in older versions of the D front-en

[committed] libphobos: Add @nogc to gcc.backtrace and gcc.libbacktrace modules.

2023-02-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch annotated the LibBacktrace class and the libbacktrace C bindings it uses with `@nogc' in preparation for a `Throwable.TraceInfo' becoming `@nogc' itself. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline. Regards, Iain. --- libphobos/ChangeLog:

[committed] d: Set doing_semantic_analysis_p before calling functionSemantic3

2023-02-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a problem seen where functions which have semantic analysis ran late may still require the use of CTFE built-ins to be evaluated. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * decl.cc (DeclVisit

[committed] d: Only handle the left-to-right evaluation of a call expression during gimplify

2023-02-21 Thread Iain Buclaw via Gcc-patches
This patch removes an unnecessary rewriting of the front-end AST during lowering. As all functions regardless of their linkage are evaluated strictly left-to-right now, there's no point trying to handle all temp saving during the code generation pass. Bootstrapped and regression tested on x86_64-l

[committed] d: Add test for PR d/108167 to the testsuite [PR108167]

2023-03-02 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds the test for checking PR108167. The D front-end implementation got fixed in upstream, add test to the gdc testsuite to check we don't regress on it. Regression tested on x86_64-linux-gnu/-m32, and committed to mainline. Regards, Iain. --- PR d/108167 gcc/testsuite/

[committed] d: Allow vectors to be compared for identity (PR108946)

2023-03-02 Thread Iain Buclaw via Gcc-patches
Hi, Vector equality and comparisons are now accepted by the language implementation, but identity wasn't. This patch implements it as an extra integer comparison of the bit-casted bitmask. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, and committed to mainline. Regards, Iain. --

[committed] d: Fix ICE on explicit immutable struct import [PR10887]

2023-03-02 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in the D front-end when importing an immutable struct. Const and immutable types are built as variants of the type they are derived from, and TYPE_STUB_DECL is not set for these variants. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, committed to mainli

[committed] d: vector float comparison doesn't result in 0 or -1 [PR108945]

2023-03-02 Thread Iain Buclaw via Gcc-patches
Hi, When comparing two vectors, the type of vector was used as the result of the condition result. This meant that for floating point comparisons, each value would either be `0.0' or `-1.0' reinterpreted as an integer, not the expected integral bitmask values `0' and `-1'. Instead, use the compa

[committed] d: Document that TypeInfo-based va_arg is not implemented [PR108763]

2023-03-03 Thread Iain Buclaw via Gcc-patches
Hi, GDC's run-time library doesn't implement the RTTI-based overload of va_arg, document it on the missing features page. Bootstrapped and regression tested, committed to mainline. Regards, Iain. --- PR d/108763 gcc/d/ChangeLog: * implement-d.texi (Missing Features): Document

[committed] d: Refactor DECL_ARGUMENT and DECL_RESULT generation to own function

2023-03-13 Thread Iain Buclaw via Gcc-patches
Hi, When looking into PR109108, the reason why things go awry is because of the logic around functions with thunks - they have their definitions generated even when they are external. This subsequently then relied on the detection of whether a function receiving codegen really is extern or not, a

[committed] d: Delay removing DECL_EXTERNAL from thunks until funcion has finished

2023-03-13 Thread Iain Buclaw via Gcc-patches
Hi, This is the second part to fixing PR109108, don't blindly generate the associated function definition of all referenced thunks in the compilation. Just delay finishing a thunk until the function gets codegen itself. If the function never gets a definition, then the thunk is left as "extern".

[committed] d: Fix undefined reference to lambda defined in private enum [PR109108]

2023-03-14 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes linker error as described in PR d/109108. Previously lambdas were connected to the module they were defined in. Now they are emitted into every referencing compilation unit, and are given one-only linkage. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, co

[committed] d: Enable private member access for __traits

2021-01-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd 3a7ebef73. 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

[committed] libphobos: Fix executables segfault on mipsel architecture

2021-01-23 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an issue running programs linked to the shared libphobos library on MIPS. The dynamic section on MIPS is read-only, but this was not properly handled in the runtime library. Bootstrapped and regression tested on mipsel-linux-gnu, and committed to mainline with backports to t

[committed] d: Merge upstream dmd 609c3ce2d, phobos 3dd5df686

2021-01-26 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 609c3ce2d, and the Phobos standard library with upstream 3dd5df686. 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.

[committed] d: Fix junk in generated symbol on powerpc64-*-* (PR98921)

2021-02-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 5e2a81d9c, fixing PR98921. 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 ca

[committed] libphobos: Merge upstream druntime 9d0c8364, phobos 9d575282e.

2021-02-03 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D runtime library with upstream druntime 9d0c8364, and the standard library with upstream phobos 9d575282e. Adds bindings to libdruntime to replace extern(C) declarations found in the phobos part of the library, and fixes an issue with the locale bindings being incomplet

[committed] d: Merge upstream dmd 46133f761, druntime 0fd4364c

2021-02-04 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 46133f761, and the D runtime library with upstream druntime 0fd4364c. Backports built-in function handling from upstream, adding a new intrinsic `byteswap(ushort)`. Intrinsic modules have been updated accordingly in the runti

[committed] d: Remove the expansion of intrinsic and built-in codes from the DEF_D_INTRINSIC macro

2021-02-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch is a small tidy-up of the intrinsics.def file to make it clear that the parameters refer to INTRINSIC and BUILT_IN codes. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * d-tree.h (DEF_D_INTRINSIC):

[committed] d: Fix heap-buffer-overflow in checkModFileAlias [PR 99337]

2021-03-03 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd, fixing a heap-buffer-overflow in checkModFileAlias. The code wrongly assumed memcmp did not read past the mismatch. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline, and backported to

[committed] d: Don't set default flag_complex_method.

2021-03-06 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the default initializing of flag_complex_method in the D front-end. D doesn't need C99-like requirements for complex multiply and divide, the default set by common.opt is sufficient enough. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to

[committed] d: ICE in gimple_register_canonical_type_1, at lto/lto-common.c:430 (PR102094)

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, User defined types have the TYPE_CXX_ODR_P flag set, but closure frames did not. This mismatch led to an ICE in the conflict detection for ODR and interoperable non-ODR types. As a given closure frame is tied explicitly to a function, it already conforms to ODR. Bootstrapped and regression

[committed] d: Use POINTER_SIZE for testing whether to predefine D_LP64

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes uses of global.params to get information about the target. Using POINTER_SIZE is assumed to be reliably set at the point where predefined version conditions are inserted into the compilation. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to m

[committed] d: Convert convert_for_rvalue switch statement into if condition

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces the switch statement in convert_for_rvalue with an if condition. In the D implementation of the D front-end, the condition value has been changed to an `enum class` type. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline. Regards, I

[committed] d: Get __c_wchar_t type from build_frontend_type

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi This patch uses build_frontend_type to get the underlying type for __c_wchar_t. The previous field has been removed from the upstream D implementation of the D front-end. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline. Regards, Iain --- gcc/d/Change

[committed] d: Use `int` to store class and struct flags

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces ClassFlags and StructFlags with an int. In the D implementation of the D front-end, this type has been changed to an `enum class`. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline. Regards, Iain --- gcc/d/ChangeLog: * typ

[committed] d: Update comment for TypeInfoVisitor::layout_base

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch updates the comment for TypeInfoVisitor::layout_base to reflect a recent change that made the emission of a __monitor optional. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline. Regards, Iain --- gcc/d/ChangeLog: * typeinfo.cc (cla

[committed] d: Call the assertp and boundsp variants for assert and array contract failures.

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch updates the code generator to call _d_assertp or _d_arrayboundsp when an assert or array bounds check fails respectively. These functions accept an `immutable(char)*` instead of an `immutable(char)[]`. The subtle difference being that the length of the string no longer has to be in

[PATCH 1/3] libiberty: Add support for D `typeof(*null)' types

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, The D language has a new bottom type `typeof(*null)'. Null types were also incorrectly being demangled as `none', this has been fixed to be `typeof(null)'. Bootstrapped and regression tested on x86_64-linux-gnu. OK for mainline? Regards, Iain. --- libiberty/ChangeLog: * d-demangl

[PATCH 2/3] libiberty: Add support for demangling D function literals as template value parameters

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, The D language now allows instantiating templates using struct literals that have function literal fields as a value argument. Bootstrapped and regression tested on x86_64-linux-gnu. OK for mainline? Regards, Iain. --- libiberty/ChangeLog: * d-demangle.c (dlang_parse_arrayliteral)

[PATCH 3/3] libiberty: Add support for demangling local D template declarations

2021-08-29 Thread Iain Buclaw via Gcc-patches
Hi, The D language now allows multiple different template declarations in the same function that have the same mangled name. To make the mangled names unique, a fake parent in the form `__Sddd' is added to the symbol. This information is not important for the user, so the demangler now handles an

Re: [PATCH 1/3] libiberty: Add support for D `typeof(*null)' types

2021-08-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Jeff Law's message of August 29, 2021 10:55 pm: > > > On 8/29/2021 12:46 PM, Iain Buclaw via Gcc-patches wrote: >> Hi, >> >> The D language has a new bottom type `typeof(*null)'. Null types were >> also incorrectly being demangled as `

[committed] libphobos: Compile configure tests with -fno-druntime

2021-08-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch changes WITH_LOCAL_DRUNTIME to build with `-fno-druntime'. The D tests done at configure-time for libphobos don't require a functional D run-time, so don't enable any run-time features. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. R

[committed] d: Build TYPE_DECLs for non-numeric enum types.

2020-09-12 Thread Iain Buclaw via Gcc-patches
Hi, This patch alters TYPE_DECL generation to also build one for enums whose member type is non-numeric. This is done so that the DWARF pass will emit a DW_TAG_typedef where the member type of an enum can't be represented in an ENUMERAL_TYPE. Bootstrapped and regression tested on x86_64-linux-gn

[committed] d: Return promoted types in d_type_promotes_to when linkage is not D

2020-09-12 Thread Iain Buclaw via Gcc-patches
Hi, This enables warnings to be shown when a wrong type is passed to va_arg inside an extern(C) or extern(C++) function. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32. Committed to mainline. Regards Iain --- gcc/d/ChangeLog: PR d/97002 * d-codegen.cc (d_buil

Re: [PATCH] MIPS/libphobos: Fix switchcontext.S assembly for MIPS I ISA

2020-10-08 Thread Iain Buclaw via Gcc-patches
Excerpts from Maciej W. Rozycki's message of October 7, 2020 9:45 pm: > Correct MIPS I assembly build errors in switchcontext.S: > > .../libphobos/libdruntime/config/mips/switchcontext.S: Assembler messages: > .../libphobos/libdruntime/config/mips/switchcontext.S:50: Error: opcode not > supported

[committed] libphobos: Fix misspelling of msvcUsesUCRT (PR104659)

2022-03-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a compilation error on x86_64-w64-mingw32. Committed to mainline, and backported to releases/gcc-11. Regards Iain --- libphobos/ChangeLog: PR d/104659 * libdruntime/config/mingw/msvc.c (init_msvc): Fix misspelling of msvcUsesUCRT. --- libphobos/lib

[committed] d: Remove gdc.test/dhry.d from the testsuite (PR104736)

2022-03-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes gdc.test/dhry.d from the testsuite, that was merged in from the sync with upstream 2.098.0. This test is not well ported, and doesn't check anything useful. Committed to mainline. gcc/testsuite/ChangeLog: PR d/104736 * gdc.test/runnable/dhry.d: Removed. -

[committed] d: Merge upstream dmd 423f19b41, druntime 100a608c, phobos a1f8c4c07.

2022-03-02 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 423f19b41, as well as the D runtime libraries with druntime 100a608c, and phobos a1f8c4c07. D Runtime changes: - Fix stdc.stdio bindings to not depend on druntime (PR104729). - Implement stdc.math for Solaris (PR10473

Re: [PATCH] libphobos: Enable on Solaris/SPARC or with /bin/as [PR 103528]

2022-03-10 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of März 10, 2022 11:19 am: > libphobos is currently only enabled on Solaris/x86 with gas. As > discovered when gdc was switched to the dmd frontend, this initially > broke bootstrap for the other Solaris configurations. > > However, it's now well possible to en

[committed] d: Cache generated import declarations in a hash_map

2022-03-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch refactors the ImportVisitor to cache the generated result decl in a hash_map. Originally, these were cached in the front-end AST node field `isym'. However, this field is soon to be removed. Bootstrapped and regression tested on x86_64-linux-gnu/m32/mx32, and committed to mainlin

[committed] d: Fix mistakes in strings to be translated [PR104552]

2022-03-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch addresses comments made in PR104552 about documented D language options. Bootstrapped and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: PR translation/104552 * lang.opt (fdump-cxx-spec=): Fix typo in argument handle. (fpreview=fixaliasthis):

[committed] d: Fix internal compiler error: in build_complex, at tree.c:2358

2022-03-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in the D front-end when constructing a complex object from a struct literal typed as enum __c_complex_float. The conversion from the special _Complex enum to native complex used build_complex, however the input value isn't necessarily a literal. Bootstrapped and regre

[committed] d: Remove Wtemplates warnings from the code generation pass

2022-04-03 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the `-Wtemplate' warnings from the code generation pass of the D front-end. These have been superceded by the upstream front-end's own internal tracking of instantiations, exposed by `-ftransition=templates'. Bootstrapped on x86_64-linux-gnu, and committed to mainline. Re

[committed] d: Compile simd_ctfe.d only on avx_runtime or vect_sizes_16B_8B targets

2022-04-04 Thread Iain Buclaw via Gcc-patches
Hi, This test makes use of the `__vector(int[4])' type, which is not supported on all targets, so guard the test with target avx_runtime || vect_sizes_16B_8B, fixing PR104740. Regression tested on x86_64-linux-gnu, committed to mainline. Regards, Iain. --- PR d/104740 gcc/testsuite/Ch

[committed] d: Merge upstream dmd eb7bee331, druntime 27834edb, phobos ac296f80c.

2022-04-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd eb7bee331, and the standard library with druntime 27834edb and phobos ac296f80c. D front-end changes: - Import dmd v2.100.0-beta.1. - Print deprecation messages for scope violations unless `-frevert=dip1000' is used. - Fix

Re: [PATCH] internal_error - do not use leading capital letter

2022-01-27 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of Januar 27, 2022 1:40 pm: > That's follow up patch based on the discussion with Jakub. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * config/rs6000/host-darwin.cc (segv_crash_handler): > Do not use leading capital letter.

Re: [PATCH][pushed] d: Fix -Werror=format-diag error.

2022-02-01 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of Januar 31, 2022 9:50 am: > Pushed as obvious. > Thanks, Iain.

Re: [committed] d: Merge upstream dmd 52844d4b1, druntime dbd0c874, phobos 896b1d0e1.

2022-02-18 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of Februar 16, 2022 11:45 pm: > Hi Iain, > >> This patch merges the D front-end implementation with upstream dmd >> 52844d4b1, as well as the D runtime libraries with druntime dbd0c874, >> and phobos 896b1d0e1, including the latest features and bug-fixes ahead o

[committed] d: Merge upstream dmd cb49e99f8, druntime 55528bd1, phobos 1a3e80ec2.

2022-02-20 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd cb49e99f8, as well as the D runtime libraries with druntime 55528bd1, and phobos 1a3e80ec2, synchronizing with the release of 2.099.0-beta1. D front-end changes: - Import dmd v2.099.0-beta.1. - It's now an error to us

[committed] d: Remove handling of deleting GC allocated classes.

2022-02-20 Thread Iain Buclaw via Gcc-patches
Hi, Now that the `delete' keyword has been removed from the front-end, only compiler-generated uses of DeleteExp reach the code generator via the auto-destruction of `scope class' variables. The run-time library helpers that previously were used to delete GC class objects can now be removed from

[committed] d: Merge upstream dmd cf63dd8e5, druntime caf14b0f, phobos 41aaf8c26.

2022-02-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd cf63dd8e5, as well as the D runtime libraries with druntime caf14b0f, and phobos 41aaf8c26, synchronizing with the release of 2.099.0-rc1. D front-end changes: - Import dmd v2.099.0-rc.1. - The `main' can now return t

[PATCH] doc, d: Add note that D front end now requires GDC installed in order to bootstrap.

2021-11-17 Thread Iain Buclaw via Gcc-patches
Hi, As asked for, this adds the documentation note in install.texi about the upcoming bootstrap requirements. Obviously this will be applied alongside the patch posted previously: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582917.html Final batch of testing before proceeding has tak

[committed] d: Use HOST_WIDE_INT for type size temporaries.

2021-11-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an issue with bootstrap on x86_64-darwin when building with --enable-werror. These couple variables are later used as the value for the format specifier `%wd`, to which the expected type may not match dinteger_t, causing unnecessary -Wformat warnings. Bootstrapped and regres

[PATCH] darwin, d: Support outfile substitution for liphobos

2021-11-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a stage2 bootstrap failure in the D front-end on darwin due to libgphobos being dynamically linked despite -static-libphobos being on the command line. In the gdc driver, this takes the previous fix for the Darwin D bootstrap, and extends it to the -static-libphobos option as

Re: [PATCH] darwin, d: Support outfile substitution for liphobos

2021-11-19 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 19, 2021 10:21 am: > Hi Iain > >> On 19 Nov 2021, at 08:32, Iain Buclaw wrote: > >> This patch fixes a stage2 bootstrap failure in the D front-end on >> darwin due to libgphobos being dynamically linked despite >> -static-libphobos being on the com

[committed] libphobos: Don't call __gthread_key_delete in the emutls destroy function.

2021-11-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a EXC_BAD_ACCESS issue seen on Darwin when the libphobos DSO gets unloaded. Based on reading libgcc's emutls implementation, as it doesn't call __gthread_key_delete directly, neither should libphobos. Bootstrapped and regression tested on x86_64-linux-gnu and x86_64-apple-da

[committed] libphobos: Increase size of defaultStackPages on OSX X86_64 targets.

2021-11-19 Thread Iain Buclaw via Gcc-patches
Hi, As of macOS 11, libunwind now requires more stack space than 16k, so default to a larger stack size. This is only applied to X86 as the PAGESIZE is still 4k, however on AArch64 it is 16k. Regression tested on x86_64-linux-gnu and x86_64-apple-darwin20, committed to mainline and backported to

Re: [PATCH] libphobos, testsuite: Add prune clauses for two Darwin cases.

2021-11-19 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 19, 2021 4:59 pm: > Depending on the permutation of CPU, OS version and shared/non- > shared library inclusion, we get can get two warnings from the > external tools (ld64, dsymutil) which are not actually GCC issues > but relate to the external tools

Re: [PATCH] d: fix ASAN in option processing

2021-11-26 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of November 25, 2021 2:59 pm: > Fixes: > > ==129444==ERROR: AddressSanitizer: global-buffer-overflow on address > 0x0666ca5c at pc 0x00ef094b bp 0x7fff8180 sp 0x7fff8178 > READ of size 4 at 0x0666ca5c thread T0 > #0 0xef094a in parse_o

Re: [committed 03/12] d: Insert null terminator in obstack buffers

2021-11-26 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of November 25, 2021 3:09 pm: > On 7/30/21 13:01, Iain Buclaw via Gcc-patches wrote: >> |Covers cases where functions that handle the extracted strings ignore the >> explicit length. This isn't something that's known to happen in

Re: [PATCH] darwin, d: Support outfile substitution for liphobos

2021-11-26 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 19, 2021 10:21 am: > Hi Iain > >> On 19 Nov 2021, at 08:32, Iain Buclaw wrote: > >> This patch fixes a stage2 bootstrap failure in the D front-end on >> darwin due to libgphobos being dynamically linked despite >> -static-libphobos being on the com

Re: [committed 03/12] d: Insert null terminator in obstack buffers

2021-11-28 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Buclaw's message of November 26, 2021 1:35 pm: > Excerpts from Martin Liška's message of November 25, 2021 3:09 pm: >> On 7/30/21 13:01, Iain Buclaw via Gcc-patches wrote: >>> |Covers cases where functions that handle the extracted strings ignore th

[committed 10/19] libphobos: Update libgdruntime to build with latest version

2021-11-30 Thread Iain Buclaw via Gcc-patches
Updates the make files, and the gdc-specific modules of druntime. Bootstrapped, regression tested, and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * libdruntime/Makefile.am (D_EXTRA_FLAGS): Build libdruntime with -fpreview=dip1000, -fpreview=fieldwise, and -fp

[committed 14/19] libphobos: Update libphobos to build latest version

2021-11-30 Thread Iain Buclaw via Gcc-patches
Updates the make files that build phobos. Bootstrapped, regression tested, and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=dip1000 and -fpreview=dtorfields flags. (PHOBOS_DSOURCES): Update list of std m

[committed 17/19] libphobos: Import druntime testsuite v2.098.0-beta.1 (e6caaab9)

2021-11-30 Thread Iain Buclaw via Gcc-patches
This is the updated D runtime library testsuite. Bootstrapped, regression tested, and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * testsuite/libphobos.aa/test_aa.d: Update test. * testsuite/libphobos.exceptions/unknown_gc.d: Likewise. * testsuite/libp

[committed 18/19] testsuite: Update gdc testsuite to pass on latest version

2021-11-30 Thread Iain Buclaw via Gcc-patches
This updates the GDC testsuite parts to be compatible with the current language features/deprecations. The dejagnu gdc-utils helper has also been updated to handle the new options and directives added to the D2 testsuite tests. Bootstrapped, regression tested, and committed to mainline. Regards,

[committed 19/19] libphobos: Update libphobos testsuite to pass on latest version

2021-11-30 Thread Iain Buclaw via Gcc-patches
This adds new, or updates the dejagu testing scripts for the suite of libphobos tests. Bootstrapped, regression tested, and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * testsuite/lib/libphobos.exp (libphobos-dg-test): Handle assembly compile types. (d

[PING, PATCH] doc, d: Add note that D front end now requires GDC installed in order to bootstrap.

2021-11-30 Thread Iain Buclaw via Gcc-patches
Ping. Excerpts from Iain Buclaw's message of November 18, 2021 2:06 am: > Hi, > > As asked for, this adds the documentation note in install.texi about the > upcoming bootstrap requirements. > > Obviously this will be applied alongside the patch posted previously: > > https://gcc.gnu.org/piperma

[PING, PATCH] darwin, d: Support outfile substitution for liphobos

2021-11-30 Thread Iain Buclaw via Gcc-patches
Ping. Are the common gcc parts OK (also for backporting)? Iain. Excerpts from Iain Buclaw's message of November 26, 2021 1:51 pm: > Excerpts from Iain Sandoe's message of November 19, 2021 10:21 am: >> Hi Iain >> >>> On 19 Nov 2021, at 08:32, Iain Buclaw wrote: >> >>> This patch fixes a stage

[committed] d: Update documentation of new D language options.

2021-12-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds documentation for the following new D options: - New switch that controls what code is generated on a contract failure (throw or abort). - New switch that controls mangling of D types in `extern(C++)` code, as well as setting the compile-time value of

[committed] d: Prefix object files from the root package with 'root-'

2021-12-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch prefixes D object files from the root package with 'root-'. None of the front-end module names in either the dmd or root package collide just yet, but that does not mean they won't in the future. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. R

[committed] d: Disable the D runtime garbage collector after initializing (PR103520)

2021-12-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch disables the D runtime garbage collector after initializing. Not all targets that support building libdruntime have a stable garbage collector, so to avoid running into problems where live memory allocated by the D GC is freed, disable all in-flight collections until a time when sc

[committed] libphobos: Add missing ControlState variable for AArch64

2021-12-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a typo that occurred during the splitting of the std.math module into a package. Bootstrapped and regression tested on aarch64-linux-gnu, and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * src/std/math/hardware.d (FloatingPointControl.getControlSt

  1   2   3   4   5   6   >