[committed] d: Implement core.bitop.rol() and core.bitop.ror() as intrinsics.

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, Following on from the last patch, this implements rol() and ror() in the core.bitop module as D intrinsics. Bootstrapped and regression tested on x86_64-linux-gnu and committed to mainline. Regards Iain --- gcc/d/ChangeLog: * intrinsics.cc (expand_intrinsic_rotate): Add function.

[committed] d: Split up the grouped compilable and runnable tests.

2020-07-31 Thread Iain Buclaw via Gcc-patches
Hi, This patch breaks up the big monolithic tests in gdc.dg test directory. The majority of tests in runnable are really compilable/ICE tests, and have have dg-do adjusted where necessary. Tests that had a dependency on Phobos have also been reproduced and reduced with all imports stripped from

[committed] d: Fix regression, all 32-bit execution tests FAIL: internal error printing module cycle

2020-07-31 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a regression caused by 6ee874f1353. For 32-bit btr(), BIT_NOT_EXPR was being generated twice, something that was not seen with the 64-bit variant. Removed the second call to fix the generated code. Bootstrapped on x86_64-linux-gnu and checked for regressions on -m32 and

[committed] d: Merge upstream dmd c2274e56a (PR96250).

2020-08-03 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd c2274e56a, fixing a couple ICE bugs found in the front-end. 1. Fixes an ICE in the front-end if a struct symbol were to appear twice in the compilation unit. 2. Fixes a rejects-valid bug in the front-end where `(symbol)' was

[committed] d: Fix struct literals that have non-deterministic hash values (PR96153)

2020-08-04 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds code generation for generating a temporary for, and pre-filling struct and array literals with zeroes before assigning, so that alignment holes don't cause objects to produce a non-deterministic hash value. A new field has been added to the expression visitor to track whether

[committed] d: Move d_signed_type and d_unsigned_type to types.cc

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch moves d_signed_type and d_unsigned_type to types.cc. These two functions are not tied to the language-specific part of the front-end in any way. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: *

[committed] d: Turn on deprecation warnings by default.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch makes deprecation warnings the default in gdc, fixing both the library and any tests that are currently using deprecated styles. This is the default in the upstream reference compiler, and can reduce some confusion when comparing warning/error messages of gdc and dmd side by side.

[committed] d: Remove another dependency on the front-end OutBuffer type.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes another dependency on the front-end OutBuffer type. As the DMD front-end never frees allocated memory, the glue layer between the DMD front-end and GCC should generally avoid using DMD types and interfaces if the purpose is internal only. Bootstrapped and regression

[committed] d: Merge upstream dmd 90450f3ef.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 90450f3ef. Fixes a regression caused by an incomplete backport of converting the Expression semantic pass to a Visitor. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. ---

[committed] d: Merge upstream dmd 5fc1806cd.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 5fc1806cd. Backports the OutBuffer interface from upstream dmd master, removing another difference this and the self-hosted D branch that is purely refactoring, and doesn't introduce any mechanical changes. Bootstrapped and

[committed] d: Merge upstream dmd 4f1046222.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 4f1046222. Renames OnScopeStatement to ScopeGuardStatement. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd

[committed] d: Fix ICE in uda_attribute_p when looking up unknown attribute

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in uda_attribute_p when looking up an unknown attribute. The target attribute table is not guaranteed to be set by all backends. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: PR

[committed] d: Don't set DECL_INITIAL if initializer is 'void'.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a logic bug in the code-gen for variable declarations. Declarations initialized with `= void` were being default initialized. That is not really the intent, and misses the small optimization that should have been gained from using void initializations. Bootstrapped and

[committed] d: Do not implicitly set DECL_DECLARED_INLINE_P on member functions.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the implicit setting of DECL_DECLARATED_INLINE_P on member function. This has been questionable behaviour since it was added, and though it has no effect on wider discussions around what should be the correct semantics of pragma(inline) within D modules, doing this

[committed] d: Merge upstream dmd 4be011355.

2020-06-25 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 4be011355. Fixes self-assignment warnings seen when compiling with clang. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: PR d/95075 *

Re: [committed] d: Fix ICE in uda_attribute_p when looking up unknown attribute

2020-06-26 Thread Iain Buclaw via Gcc-patches
Hi, This patch has been backported, bootstrapped and regression tested on the releases/gcc-9 and releases/gcc-10 branches. Regards Iain. On 25/06/2020 17:38, Iain Buclaw wrote: > Hi, > > This patch fixes an ICE in uda_attribute_p when looking up an unknown > attribute. The targ

Re: [committed] d: Merge upstream dmd 90450f3ef.

2020-06-26 Thread Iain Buclaw via Gcc-patches
Hi, This patch has been backported, bootstrapped and regression tested on the releases/gcc-9 and releases/gcc-10 branches. Regards Iain. On 25/06/2020 17:41, Iain Buclaw wrote: > Hi, > > This patch merges the D front-end implementation with upstream dmd > 90450f3ef. Fixes a regre

[committed] d: Merge upstream dmd 8508c4e68.

2020-06-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 8508c4e68. Fixes a performance bug where 'static foreach' would take an exponentially long time to expand during CTFE. In the following example: static foreach (i; 0..3) {} Compilation time had been reduced from

[committed] d: Use toTypeFunction instead of explicit cast

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces uses of casting to TypeFunction with toTypeFunction, which takes care of asserting that `ty' is a `Tfunction'. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-frontend.cc (eval_builtin): Use

[committed] d: Use toStringExp instead of explicit cast

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces uses of casting to StringExp with toStringExp. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-attribs.cc (build_attributes): Use toStringExp instead of cast. * toir.cc

[committed] d: Move generation of array bounds error to own function.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch moves a couple code duplications into its own routine, the checkAction global parameter is now initialized and properly adjusted. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-codegen.cc

[committed] d: Consistently format quotations in comments.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch updates comments to consistently format quotations in code comments throughout the D front-end. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-builtins.cc: Update quotation formatting of comments.

[committed] d: Remove dependency on front-end File type for json and deps file generation.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces some uses of File with FILE. Memory allocated by the DMD front-end is never freed due to the bump pointer allocator used internally. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-lang.cc

[committed] d: Remove dependency on front-end OutBuffer for diagnostic and deps file generation.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces some uses of OutBuffer with obstack. Memory allocated by the DMD front-end is never freed due to the bump pointer allocator used internally. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: *

[committed] d: Update code formatting in a consistent style.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch is a mechanical update of various formatting to make it consistent throughout the D front-end. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-attribs.cc: Update code formatting in a consistant style.

[committed] d: Use new isTypeXxxx helpers where possible.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces uses of casting to Type nodes with the newly introduced isTypeXxxx functions. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-builtins.cc (d_eval_constant_expression): Use isTypeXxxx helpers

[committed] d: Use new isXxxxExp helpers where possible

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces uses of casting to Expression nodes with the newly introduced isXxxxExp functions. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-attribs.cc (build_attributes): Use isXxxxExp helpers instead

[committed] d: Remove names of unused function parameters.

2020-06-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch replaces ARG_UNUSED and ATTRIBUTE_UNUSED with unnamed parameters. As the unused attribute was being used incorrectly. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to master. Regards Iain gcc/d/ChangeLog: * d-attribs.cc

[committed] d: Merge upstream dmd 73d8e2fec.

2020-06-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 73d8e2fec. Renames the enum PROTKIND to Prot::Kind, updates all uses of the original enum accordingly. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog:

[committed] d: Merge upstream dmd 108ca1bcd.

2020-06-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd b0df0e982. Renames OutBuffer::peekString to OutBuffer::peekChars, and OutBuffer::extractString to OutBuffer::extractChars. All callers have been updated as appropriate. Bootstrapped and regression tested on

[committed] d: Split up d-frontend.cc into multiple parts.

2020-06-04 Thread Iain Buclaw via Gcc-patches
In preparation for possibly switching the front-end implementation from C++ to D, a lot of changes in the "glue" layer are just noise from lots of small, but invasive API changes in the DMD front-end headers. This will be the first of about a dozen or so. This change splits up the few

[committed] d: Merge upstream dmd f5638c7b8.

2020-06-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd f5638c7b8. Adds a CHECKENABLE enum, uses it for all contract parameters for consistency in state checking. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog:

[committed] d: Merge upstream dmd 740f3d1ea.

2020-06-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 740f3d1ea. Backports the conversion of the parameter fields debugids and versionids to Identifiers. The idea is that Identifiers should be used instead of C strings where ever possible. Bootstrapped and regression tested on

[committed] d: Merge upstream dmd cef1e7991.

2020-06-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd cef1e7991. Adds a DString type, a struct that has a compatible layout with D strings. Many parameters in the Global struct have been switched over to this type, and users of these params have been adjust to use the length or

[committed] d: Merge upstream dmd 955b8b36f.

2020-06-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 955b8b36f. Merges AndAndExp and OrOrExp into a LogicalExp AST node. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream

[committed] d: Fix regression caused by recent refactoring (PR95573)

2020-06-08 Thread Iain Buclaw via Gcc-patches
Hi, This parch merges the D front-end implementation with upstream dmd 5041e56f1. Fixing a small regression made by one of the refactorings. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog: PR d/95573 *

[committed] d: Merge upstream dmd 13d67c575.

2020-06-09 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 13d67c575. Contains many small API changes, most contained within the front-end, but some spill out into the codegen. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain.

[committed] d: Merge upstream dmd 47ed0330f

2020-06-04 Thread Iain Buclaw via Gcc-patches
Reserved + * Copyright (C) 2018-2020 by The D Language Foundation, All Rights Reserved * written by Iain Buclaw * http://www.digitalmars.com * Distributed under the Boost Software License, Version 1.0. diff --git a/gcc/d/dmd/identifier.c b/gcc/d/dmd/identifier.c index 9d1df4dd466..d5c927c12b0

[committed] d: Merge upstream dmd 48d704f08

2020-06-04 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 47ed0330f. Updates the Array interface in dmd/root/array to use a DArray internally. Splits out BitArray into a separate header. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards

[committed] d: Merge upstream dmd 6d5bffa54

2020-06-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 6d5bffa54. Removes an unused parameter from Condition::include(), all callers have been updated in the front-end. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain.

[committed] d: Merge upstream dmd 1831b24ff.

2020-06-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 1831b24ff. Converts some global and param fields from pointers to value types. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog: * dmd/MERGE: Merge

[committed] d: Merge upstream dmd b0df0e982

2020-06-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd b0df0e982. Adds a struct ParameterList to encapulate parameter and vararg information in the front-end. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog:

[committed] d: Merge upstream dmd 56f0a65c4.

2020-06-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 56f0a65c4. Updates the Target interface, removing static from all members, so all field accesses and member function calls go through a a single global 'target'. Information relating to extern ABI are now in TargetC,

[committed][GCC10/11] testsuite: Re-add gdc.test prefix in test names (PR testsuite/95575)

2020-06-14 Thread Iain Buclaw via Gcc-patches
Hi, When moving the gdc-test.exp test script into multiple test scripts (c76df72f1a9), this subdir handling got removed. This patch re-adds that, adjusted to handle the new $subdir path. Regression tested on x86_64-linux-gnu, committed to mainline, and backported to releases/gcc-10. Regards

[committed] d: Fix line lengths after mechanical field renames.

2020-06-14 Thread Iain Buclaw via Gcc-patches
Hi, This patch adjusts a few overflowed lines after the recent refactorings done in the upstream front-end that caused renames of many fields - in this case, dim -> length. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. gcc/d/ChangeLog:

[committed] d: Move private functions out of ExprVisitor into local statics

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch breaks out all private functions from ExprVisitor into free standing static functions. None of them need access to the context pointer of the visitor class. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain --- gcc/d/ChangeLog:

[committed] d: Refactor use of built-in memcmp/memcpy/memset into helper functions.

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds three codegen helper functions for generating calls to memcmp, memcpy and memset. All parts of the front-end have been updated to call them instead of doing it themselves. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain ---

[committed] d: Inline bounds checking for simple array assignments.

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch implements a small optimization to the code generation of simple array assignments, inlining the array bounds checking code so there is no reliance on the library routine _d_arraycopy(), which also deals with postblit and copy constructors for non-trivial arrays. Bootstrapped and

[committed] d: Fix associative array literals that don't have alignment holes filled (PR96152)

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an assert that is triggered at run-time due to the hash of an associative array literal not matching a non-literal with the same contents. Associative array literals are now filled using memset() prior to usage, with LTR evalution of side-effects enforced. Bootstrapped and

[committed] d: Fix ICE in expand_intrinsic_vaarg (PR96140)

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in the D front-end in the va_arg intrinsic functions. Both intrinsics did not handler the case where the va_list object comes from a ref parameter. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline. Regards Iain. --- gcc/d/ChangeLog:

[committed] d: Add -Wvarargs warning flag to the D front-end (PR96154)

2020-07-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds the -Wvarargs warning flag to the D front-end. The language has C-style variadic functions and va_start/va_arg, so it is right to also have warnings for inproper use. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline. Regards Iain ---

[PING][PATCH] PR target/96347: non-delegitimized UNSPEC UNSPEC_TP (19) found in variable location

2020-08-14 Thread Iain Buclaw via Gcc-patches
Ping. Though I wonder if there's any point adding a check at all over just swapping the order that mem_loc_descriptor and tls_mem_loc_descriptor are called in. Iain. On 07/08/2020 13:33, Iain Buclaw wrote: > Hi, > > On x86, a memory reference reference to a TLS address can be b

[PING][PATCH] libiberty: Add support for 'in' and 'in ref' storage classes.

2020-08-14 Thread Iain Buclaw via Gcc-patches
Ping. Though I will hold back on supporting 'in ref' until it has been formalized. Current discussions are around what value might it have over 'ref const scope' (so far, none). Iain. On 07/08/2020 13:32, Iain Buclaw wrote: > Hi, > > This patch adds support for 'in' as a first-clas

[committed] d: Remove visibility and lookup deprecation

2021-01-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 2d3d13748, removing the visibility and lookup deprecation. The deprecation phase for access checks is finished. The `-ftransition=import` and `-ftransition=checkimports` switches no longer have an effect and are now removed.

Re: [committed] d: Support deprecated, @disable, and user-defined attributes on enum members

2021-01-11 Thread Iain Buclaw via Gcc-patches
Excerpts from Andreas Schwab's message of January 10, 2021 9:08 am: > ../../gcc/d/dmd/parse.c: In member function 'Dsymbols* > Parser::parseDeclDefs(int, Dsymbol**, PrefixAttributes*)': > ../../gcc/d/dmd/parse.c:647:29: error: unused variable 'e' > [-Werror=unused-variable] > 647 |

Re: [PATCH] libphobos: Allow building libphobos using Solaris/x86 assembler

2021-01-11 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Buclaw's message of January 7, 2021 6:48 pm: > Excerpts from Rainer Orth's message of January 7, 2021 5:17 pm: >> Hi Iain, >> The Solaris assemblers don't support UTF-8 identifiers. Unless gdc can encode them in some way for toolchains like this (no idea if this is

[committed] d: Merge upstream dmd 9038e64c5.

2021-01-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds support for using user-defined attributes on function arguments and single-parameter alias declarations. These attributes behave analogous to existing UDAs. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards Iain. ---

Re: [PATCH] d: Add freebsd support for D compiler and runtime

2020-11-30 Thread Iain Buclaw via Gcc-patches
Excerpts from Jeff Law's message of November 30, 2020 2:16 am: > > > On 11/28/20 9:04 AM, Iain Buclaw via Gcc-patches wrote: >> Hi, >> >> This patch adds the necessary version conditions and configure rules in >> place to allow building the D compiler on Fre

[committed] libphobos: Merge upstream druntime d37ef985.

2020-11-27 Thread Iain Buclaw via Gcc-patches
at.Real80; else static if (T.mant_dig == 106) diff --git a/libphobos/libdruntime/core/sys/freebsd/config.d b/libphobos/libdruntime/core/sys/freebsd/config.d new file mode 100644 index 000..4eda066b293 --- /dev/null +++ b/libphobos/libdruntime/core/sys/freebsd/config.d @@ -0,0 +

[committed] d: Merge upstream dmd db0df3f7e.

2020-11-27 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream DMD db0df3f7e, removing all support code and tests for the extern(Pascal) calling convention. Bootstrapped and regression tested on x86_64-linux-gnu with -mx32/-m32, committed to mainline. Regards Iain. --- gcc/d/ChangeLog: *

[committed] d: Add float and double overloads for all core.math intrinsics

2020-11-27 Thread Iain Buclaw via Gcc-patches
Hi, For the math intrinsics: cos, fabs, ldexp, rint, rndtol, and sin, new overloads have been added to the core.math module for matching float and double types. These have been implemented in the compiler. A recent change to dump_function_to_file started triggering some scan-tree-dump tests to

[committed] libphobos: Merge upstream phobos 38873fe6e.

2020-11-27 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D standard library with upstream phobos 38873fe6e, adding support for FreeBSD/x86 53-bit precision reals, and removing all support code and tests for the extern(Pascal) calling convention. Bootstrapped and regression tested on x86_64-linux-gnu with -mx32/-m32, committed

Re: [PATCH] INSTALL: Default to --enable-cet=auto

2020-11-27 Thread Iain Buclaw via Gcc-patches
Excerpts from H.J. Lu's message of November 27, 2020 8:28 pm: > On Fri, Nov 27, 2020 at 11:02 AM Matthias Klose wrote: >> >> On 11/27/20 3:54 PM, H.J. Lu via Gcc-patches wrote: >> > On Fri, Nov 27, 2020 at 6:24 AM Richard Biener wrote: >> >> >> >> OK. >> >> >> >> On Fri, 27 Nov 2020, H.J. Lu

[committed] libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)

2020-11-27 Thread Iain Buclaw via Gcc-patches
Hi, When libphobos is configured with --enable-cet, this adds extra fields to the Fiber class to support the ucontext_t fallback implementation. These fields get omitted when compiling user code unless they also used `-fversion=CET' to build their project, which resulted in data being overwritten

Re: [pushed] c++: Implement C++20 'using enum'. [PR91367]

2020-11-30 Thread Iain Buclaw via Gcc-patches
Excerpts from Jason Merrill via Gcc-patches's message of November 13, 2020 7:35 pm: > > The changes to dwarf2out revealed an existing issue with the D front-end: we > were doing the wrong thing for importing a D CONST_DECL, because > dwarf2out_imported_module_or_decl_1 was looking through it to

Re: [PATCH] d: Add darwin support for D language front-end

2020-12-07 Thread Iain Buclaw via Gcc-patches
e person managing the list at >> gcc-patches-ow...@gcc.gnu.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Gcc-patches digest..." >> Today's Topics: >> >>1. Re: [PATCH] configure: S

[PATCH] configure: Support building D front-end on *-*-darwin*

2020-11-28 Thread Iain Buclaw via Gcc-patches
Hi, The bootstrap has been succeeding for some time now, there's no need to set it as an unsupported language. OK for mainline? Regards Iain. --- ChangeLog: PR d/87788 * configure.ac: Don't disable D for *-*-darwin*. * configure: Regenerate. --- configure| 3 ---

[PATCH] d: Add freebsd support for D compiler and runtime

2020-11-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds the necessary version conditions and configure rules in place to allow building the D compiler on FreeBSD. Running the testsuite on both i386 and x86_64, all tests except for one passes (gdc.test/runnable/test17338.d, though the problem appears to be the linker producing a

[PATCH] d: Add darwin support for D language front-end

2020-11-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds necessary predefined version symbols and support for moduleinfo sections for darwin to allow testing libphobos support. OK for mainline? Regards Iain. --- gcc/ChangeLog: * config.gcc (*-*-darwin*): Set d_target_objs and target_has_targetdm. * config/elfos.h

Re: [PATCH] d: Add darwin support for D language front-end

2020-11-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 29, 2020 1:49 pm: > Hi Iain > > Iain Buclaw wrote: > >> This patch adds necessary predefined version symbols and support for >> moduleinfo sections for darwin to allow testing libphobos support. >> >> OK for mai

[committed] d: Remove d_size_t from front-end sources (PR 87788)

2020-11-29 Thread Iain Buclaw via Gcc-patches
Hi, The typedef for d_size_t assumes that the implementation of the front-end is written in D itself, where size_t can map only to uint32_t or uint64_t. As that is not the case for the current D front-end, the typedef should be removed. This would fix the bootstrap on targets where in C++ size_t

Re: [committed] d: Remove d_size_t from front-end sources (PR 87788)

2020-11-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 29, 2020 1:54 pm: > Iain Buclaw via Gcc-patches wrote: >> >> The typedef for d_size_t assumes that the implementation of the >> front-end is written in D itself, where size_t can map only to uint32_t >> or uint64_

Re: [PATCH] configure: Support building D front-end on *-*-darwin*

2020-11-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 29, 2020 10:35 am: > Hi Iain > > Iain Buclaw wrote: > >> The bootstrap has been succeeding for some time now, there's no need to >> set it as an unsupported language. >> >> OK for mainline? > > At prese

Re: [PATCH] configure: Support building D front-end on *-*-darwin*

2020-11-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of November 29, 2020 10:35 am: > Hi Iain > > Iain Buclaw wrote: > >> The bootstrap has been succeeding for some time now, there's no need to >> set it as an unsupported language. >> >> OK for mainline? > > At prese

[committed] d: Force TYPE_MODE of classes and non-POD structs as BLKmode (PR98427)

2020-12-23 Thread Iain Buclaw via Gcc-patches
Hi, This patch forces the TYPE_MODE of non-POD types as BLKmode. Without this being forced, the optimizer could still make decisions that require objects of the non-POD types to need a temporary, which would result in an ICE during the expand to RTL passes. Bootstrapped and regression tested on

[committed] d: Fix ICE in gimplify_expr, at gimplify.c (PR98277)

2020-12-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE during gimplify_expr for code generated by the D front-end. The DMD front-end shouldn't, but can sometimes leak manifest constants in the AST passed to the code generator. To prevent this being an issue, the setting of DECL_INITIAL has been moved to the point where

[PATCH] d: Fix ICE in in force_decl_die, at dwarf2out.c with -gdwarf-2 -gstrict-dwarf [PR98067]

2020-12-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in dwarf2out.c that occurs when compiling a selective import declaration in D with strict dwarf2 in effect. Manifest constants in D are represented as CONST_DECLs, which can be imported from one module to another. However, when compiling on strict dwarf2 targets such

[committed] libphobos: Merge upstream phobos 7948e0967.

2020-11-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the libphobos library with upstream phobos 7948e0967, removing all deprecated functions from std.string module. Regression tested and committed to mainline. Regards, Iain. --- libphobos/ChangeLog: * src/MERGE: Merge upstream phobos 7948e0967. ---

[PATCH] d: Fix a couple of ICEs found in the dmd front-end (PR97842)

2020-11-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd b6a779e49, fixing two segmentation faults. One when encountering an incomplete static if, and another when resolving typeof() expressions whilst gagging is on. Bootstrapped and regression tested on x86_64-linux-gnu, committed

[PATCH] d: Fix LHS of array concatentation evaluated before the RHS.

2020-11-18 Thread Iain Buclaw via Gcc-patches
Hi, In an array append expression: array ~= fun(array); The array in the left hand side of the expression was extended before evaluating the result of the right hand side, which resulted in the newly uninitialized array index being used before set. This fixes that so that the result of the

[committed][GCC-10 backport] d: Fix undefined template references with circular module imports

2020-11-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports r11-4424 to GCC-10, as it fixes a critical link-time error that occurred whilst bootstrapping the D implementation of the DMD front-end. Regression tested on x86_64-linux-gnu and committed to branch. Regards Iain --- gcc/d/ChangeLog: * dmd/dtemplate.c

[committed][GCC-10 backport] d: Explicitly determine which built-in copysign function to call.

2020-11-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports r11-4980 to GCC-10, as it fixes an ICE that could occur on some targets. Regression tested on x86_64-linux-gnu and committed to branch. Regards Iain --- gcc/d/ChangeLog: * intrinsics.cc (expand_intrinsic_copysign): Explicitly determine which built-in

[committed] d: Fix OutOfMemoryError thrown when appending to an array with a side effect (PR97889)

2020-11-22 Thread Iain Buclaw via Gcc-patches
Hi, When appending a character to an array, the result of that concat assignment was not the new value of the array, similarly, when appending an array to another array, side effects were evaluated in reverse to the expected order of evaluation. As of this change, the address of the left-hand

[committed] d: Fix ICE in finish_thunk (PR97644)

2020-11-13 Thread Iain Buclaw via Gcc-patches
Hi, Because this what the upstream reference compiler did, thunks for the D front-end were associated with the class definition, so were forced code-gen even if the target function was extern. This has now been changed so there are now only generated if there is a function definition, fixing the

[PING][PATCH] d: Add dragonflybsd support for D compiler and runtime

2020-11-13 Thread Iain Buclaw via Gcc-patches
Ping. CTFE math fixes have been committed to mainline in r11-4980. Excerpts from Iain Buclaw's message of October 29, 2020 3:22 pm: > Hi, > > This patch adds the necessary version conditions and configure rules in > place to allow building the D compiler on DragonFlyBSD. > > Running the

[committed] d: Explicitly determine which built-in copysign function to call.

2020-11-13 Thread Iain Buclaw via Gcc-patches
Hi, For some targets, mathfn_built_in returns NULL as copysign is not implicitly available, causing an ICE. Now copysign is explicitly requested when expanding the intrinsic. Bootstrapped and regression tested on x86_64-linux-gnu and x86_64-freebsd. Committed to mainline. As this fixes an

[committed] libphobos: Update libtool version to 2:0:0

2020-11-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch bumps the libphobos soname to 2:0:0 so that the library is not to conflict with gcc-10. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- libphobos/ChangeLog: * configure: Regenerate. * configure.ac

[PATCH] d: Add dragonflybsd support for D compiler and runtime

2020-10-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds the necessary version conditions and configure rules in place to allow building the D compiler on DragonFlyBSD. Running the testsuite, all core tests pass, with a couple failures relating to CTFE math support which are not blocking the library from being usable, and will be

[PATCH] ipa: Fix segmentation fault in function_summary::get(cgraph_node*) (PR 97660)

2020-11-01 Thread Iain Buclaw via Gcc-patches
Hi, PR 97660 occurs when cgraph_node::get returns NULL, and this NULL cgraph_node is then passed to clone_info::get. As the original assert prior to the regressing change in r11-4587 allowed for the cgraph_node to be NULL, clone_info::get is now only called when cgraph_node::get returns a

[committed] d: Simplify quoting characters in deps_add_target

2020-12-30 Thread Iain Buclaw via Gcc-patches
Hi, The implementation of deps_add_target in d-lang.cc was based on what was present in libcpp. This patch synchronizes the escaping logic to match the current version. Bootstrapped and regression tested on x86_64-linux-gnu, committed to mainline. Regards Iain --- gcc/d/ChangeLog: *

[committed] d: Give the result of evaluated expressions a location

2020-12-30 Thread Iain Buclaw via Gcc-patches
Hi, CST trees that were converted back to a D front-end AST node lost all location information of the original expression. With this patch, now this is propagated on to the literal expression. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards, Iain.

[committed] d: Mangled Symbols now back reference types and identifiers

2020-12-30 Thread Iain Buclaw via Gcc-patches
Hi, With this patch, symbols with `extern(D)` linkage are now mangled using back references to types and identifiers if these occur more than once in the mangled name as emitted before. This reduces symbol length, especially with chained expressions of templated functions with Voldemort return

[PATCH] libphobos: Allow building libphobos using Solaris/x86 assembler

2021-01-05 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the disabling of libphobos when the Solaris/x86 assembler is being used. Since r11-6373, D symbols are now compressed using back references, this helped reduce the average symbol length by a factor of about 3, while the longest symbol shrank from 416133 to 1142 characters.

[committed] d: Merge upstream dmd a5c86f5b9

2021-01-05 Thread Iain Buclaw via Gcc-patches
This patch merges the D front-end implementation with upstream dmd a5c86f5b9, adding the following new `__traits' to the D language. - isDeprecated: used to detect if a function is deprecated. - isDisabled: used to detect if a function is marked with @disable. - isFuture: used to detect if a

[committed] d: Implement expression-based contract syntax

2021-01-09 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd e598f69c0, adding support for an expression-based contract syntax. Contracts that consist of a single assertion can now be written more succinctly and multiple `in` or `out` contracts can be specified for the same function. Bootstrapped

[committed] d: Support deprecated, @disable, and user-defined attributes on enum members

2021-01-09 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end with upstream dmd 9bba772fa, adding support for `deprecated`, `@disable` and user-defined attributes to be applied to enum members. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards Iain. ---

[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] 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] 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

Re: [PATCH] libphobos: Allow building libphobos using Solaris/x86 assembler

2021-01-07 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of January 6, 2021 2:57 pm: > Hi Iain, > >>> This patch removes the disabling of libphobos when the Solaris/x86 >>> assembler is being used. >>> >>> Since r11-6373, D symbols are now compressed using back references, this >>> helped reduce the average symbol

<    2   3   4   5   6   7   8   9   10   11   >