[committed] d: Recognize pragma(inline) in the code generator.

2020-04-26 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds recognition of pragma(inline) in the code generator. Pragma inline affects whether functions are inlined or not. If at the declaration level, it affects the functions declared in the block it controls. If inside a function, it affects the function it is enclosed by. Support

Re: [committed] d: Merge upstream dmd 09db0c41e, druntime e68a5ae3.

2020-04-26 Thread Iain Buclaw via Gcc-patches
On 25/04/2020 22:50, Segher Boessenkool wrote: > Hi! > > On Sat, Apr 25, 2020 at 02:20:19AM +0200, Iain Buclaw via Gcc-patches wrote: >> +// Parse DoubleDoubles as a pair of doubles. >> +// The layout of the type is: >> +//

[committed] d: Merge upstream dmd 09db0c41e, druntime e68a5ae3.

2020-04-24 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd 09db0c41e, and the D runtime library with upstream druntime e68a5ae3. * New core.math.toPrec templates have been added as an intrinsic. Some floating point algorithms, such as Kahan-Babuska-Neumaier Summation, require rou

[committed] d: Fix order of precedence for -defaultlib and -debuglib

2020-04-24 Thread Iain Buclaw via Gcc-patches
Hi, The order of precedence used by the upstream reference compiler for determining what library to link against is: - No library if -nophoboslib or -fno-druntime was seen. - The library passed to -debuglib if -g was also seen. - The library passed to -defaultlib - The in-tree libgphobos library.

[committed] libphobos: Remove GDCFLAGSX variable from configure scripts.

2020-04-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch changes the testsuite to compile all tests with the same GDCFLAGS as used to build the library. Notably, this would now be using "-O2", whereas before the testsuite was compiling all tests with "-O0". That we are now compiling with "-O2", there is a possibility of previously hidd

Re: [PATCH, libphobos] Fix compilation dependencies on s390x-linux-musl

2020-04-21 Thread Iain Buclaw via Gcc-patches
On 13/04/2020 15:36, Iain Buclaw via Gcc-patches wrote: > On 08/04/2020 10:14, Iain Buclaw via Gcc-patches wrote: >> On 28/01/2020 05:00, Mathias Lang wrote: >>> diff -Nurp a/libphobos/configure.ac b/libphobos/configure.ac >>> --- a/libphobos/configure.ac >&

[PATCH] doc: Document all D-specific configuration options.

2020-04-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds documentation for --enable-libphobos-checking and --with-libphobos-druntime-only options. Does it read and explain clearly enough? Regards Iain. gcc/ChangeLog: * doc/install.texi (D-Specific Options): Document --enable-libphobos-checking and --with-libphobos

[committed] d/dmd: Merge upstream dmd 62ce36f37 (PR94623)

2020-04-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with dmd upstream 62ce36f37. Adjusts the hardcoded index of Error.bypassException. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain --- gcc/d/dmd/MERGE| 2 +- gcc/d/dmd/dinterpret.c |

[committed] libphobos: Fix option name for --with-libphobos-druntime-only.

2020-04-20 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes the option --with-libphobos-druntime-only to match the help text, as the prefixing 'libphobos' was intentional. Tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Fix option

[committed] libphobos: Remove undefined DRUNTIME_GC from configure scripts

2020-04-20 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes up a previous commit that removed DRUNTIME_GC from m4/druntime.m4 Committed to mainline. Regards Iain. --- libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Remove DRUNTIME_GC. --- libphobos/configure| 1 - libphobos/configure.ac | 1 - 2 f

[committed] libphobos: Merge upstream phobos bf0d0a37c (PR94455)

2020-04-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges libphobos with upstream phobos bf0d0a37c. Fixes std.array.Appender and RefAppender to use .opSlice() instead of data() Previously, Appender.data() was used to extract a slice of the Appender's array. Now use the [] slice operator instead. The same goes for RefAppender. Bo

[committed] libphobos: Merge upstream phobos 99003a75a

2020-04-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges libphobos with upstream phobos 99003a75a. Fixes hasLength unittest to pass on X32. Bootstrapped and regression tested on x86_64-linux-gnu with target_board configurations {-m64,-m32,-mx32}. Committed to mainline. Regards Iain. --- libphobos/src/MERGE |

[committed 2/2] d/dmd: Merge upstream dmd ba99ee345 (PR94642)

2020-04-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with dmd upstream ba99ee345. Initializes the VectorArrayExp::size field with the correct value, fixing PR94642. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/dmd/MERGE| 2

[committed 1/2] d/dmd: Merge upstream dmd 09be6ee14 (PR94653)

2020-04-19 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with dmd upstream 09be6ee14. Initializes ncost before use, which was caught by valgrind, fixing PR94653. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/dmd/MERGE | 2 +- g

[committed] d: Fix FAIL in gdc.dg/runnable.d on X32 targets (PR94609)

2020-04-19 Thread Iain Buclaw via Gcc-patches
Hi, Patch fixes test failure seen on X32 where a nested struct was passed in registers, rather than via invisible reference. Now, all non-POD structs are passed by invisible reference, not just those with a user-defined copy constructor/destructor. Bootstrapped and regression tested on x86_64-li

[PATCH] libphobos: Add --with-libphobos-druntime-only option.

2020-04-18 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds a new configure option --with-libphobos-druntime-only. The intended purpose of the option is both for targets that don't support phobos yet, and for gdc itself to support bootstrapping itself as a self-hosted D compiler. The libphobos testsuite has been updated to only add li

Re: [PATCH] testsuite: Add check_effective_target_d_runtime_has_std_library procedure

2020-04-18 Thread Iain Buclaw via Gcc-patches
On 15/04/2020 17:26, Rainer Orth wrote: > Hi Richard, > >> Iain Buclaw via Gcc-patches writes: >>> Hi, >>> >>> This patch adds an effect target d_runtime_has_std_library to >>> target-supports.exp, and some preliminary uses of it. >>> &

Re: [PATCH] testsuite: Add check_effective_target_d_runtime_has_std_library procedure

2020-04-15 Thread Iain Buclaw via Gcc-patches
On 15/04/2020 17:17, Richard Sandiford wrote: > Iain Buclaw via Gcc-patches writes: >> Hi, >> >> This patch adds an effect target d_runtime_has_std_library to >> target-supports.exp, and some preliminary uses of it. >> >> The current check_effective_targ

Re: [PATCH] libiberty: Update D symbol demangling for latest ABI spec.

2020-04-15 Thread Iain Buclaw via Gcc-patches
Ping. On 04/04/2020 13:33, Iain Buclaw wrote: > Hi, > > Some small improvements and clarifications have been done in the D ABI > specification to remove all ambiguities found in the current grammar, > this implementation now more closely resembles the spec, whilst > maintaining compatibility with

[PATCH] testsuite: Add check_effective_target_d_runtime_has_std_library procedure

2020-04-14 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds an effect target d_runtime_has_std_library to target-supports.exp, and some preliminary uses of it. The current check_effective_target_d_runtime procedure returns false if the target is without any core runtime library for D. This additional procedure is for targets where the

Re: [PATCH, libphobos] Fix compilation dependencies on s390x-linux-musl

2020-04-13 Thread Iain Buclaw via Gcc-patches
On 08/04/2020 10:14, Iain Buclaw via Gcc-patches wrote: > On 28/01/2020 05:00, Mathias Lang wrote: >> diff -Nurp a/libphobos/configure.ac b/libphobos/configure.ac >> --- a/libphobos/configure.ac >> +++ b/libphobos/configure.ac >> @@ -140,6 +140,14 @@ case ${host} in

[committed] d: Merge front-end with upstream dmd d0d4f02a0

2020-04-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd d0d4f02a0. Removes the implementation of __traits(argTypes), which only supported x86_64 targets. The only use of this trait is an unused va_arg() function, this has been removed as well. Bootstrapped and regression tested o

[committed] libphobos: Use libdruntime as a convenience library for libphobos.

2020-04-10 Thread Iain Buclaw via Gcc-patches
Hi, As a prerequesite for PR94304, it becomes easier to manage selectively compiling sublibraries when there's only one library to link to. So a druntime convenience library is built to be part of phobos, however separate druntime library is still built and installed, to allow linking only to the

[committed] libphobos: Remove --enable-druntime-gc configure option.

2020-04-09 Thread Iain Buclaw via Gcc-patches
Hi, This is yet another old option that would have been somewhat useful back before the D front-end implementation was able to support compiling without the Druntime library. Now however, -fno-druntime makes the gcstub package redundant, so the option has been removed, along with the package itse

Re: [committed] libphobos: Add --enable-libphobos-checking configure option (PR94305)

2020-04-09 Thread Iain Buclaw via Gcc-patches
On 09/04/2020 12:02, Matthias Klose wrote: > On 4/9/20 12:47 AM, Iain Buclaw via Gcc-patches wrote: >> Hi, >> >> As GDCFLAGS is overriden by the top-level make file with '-O2 -g', >> libphobos ends up always being built with all contracts, invariants, and >

[committed] libphobos: Add --enable-libphobos-checking configure option (PR94305)

2020-04-08 Thread Iain Buclaw via Gcc-patches
Hi, As GDCFLAGS is overriden by the top-level make file with '-O2 -g', libphobos ends up always being built with all contracts, invariants, and asserts compiled in. This adds a new configurable that defaults to omit compiling any run-time checks into the library using '-frelease'. Other choices

[committed] libphobos: Remove --enable-thread-lib configure option.

2020-04-08 Thread Iain Buclaw via Gcc-patches
Hi, This is another old option that doesn't make sense as a configurable. So the option has been removed, and the check for AC_SEARCH_LIBS moved into the main configure.ac file. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- libphobos/Change

[committed] libphobos: Remove --enable-unix configure option.

2020-04-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes --enable-unix, an old option that predates the D2 library, and now is not useful on its own as all posix modules require the compiler to predefine version(Posix) anyway. So the option has been removed, and the logic moved into DRUNTIME_OS_SOURCES, where the conditional DRUN

Re: [PATCH, libphobos] Fix compilation dependencies on s390x-linux-musl

2020-04-08 Thread Iain Buclaw via Gcc-patches
On 28/01/2020 05:00, Mathias Lang wrote: > Hi, > > This patch fixes GDC on s390x-linux-musl targets. It was specifically > tested under Alpine Linux (see > https://gitlab.alpinelinux.org/alpine/aports/commit/c123e0f14ab73976a36c651d47d134f249413f29 > ). > The patch fixes two issues: First, Musl al

[committed] libphobos: Always build with warning flags enabled

2020-04-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch moves WARN_DFLAGS from GDCFLAGS to AM_DFLAGS so it is always included in the build and testsuite of libphobos. Currently, this doesn't happen as GDCFLAGS is overriden by it being set at the top-level. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainlin

[committed] libphobos: Merge upstream phobos fb4f6a713

2020-04-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the libphobos implementation with the upstream phobos fb4f6a713. Improves the versioning of IeeeFlags and FloatingPointControl code and unit-tests, making it clearer which targets can and cannot support it. Bootstrapped and regression tested on x86_64-linux-gnu, and committ

Re: [PATCH] S/390: Fix PR91628

2020-04-07 Thread Iain Buclaw via Gcc-patches
On 07/04/2020 16:33, Stefan Liebler wrote: > On 4/1/20 6:20 PM, Stefan Liebler wrote: >> On 4/1/20 12:50 PM, Iain Buclaw wrote: >>> >>> >>> On 01/04/2020 08:28, Stefan Liebler wrote: ping >>> >>> Hi Stefan, >>> >>> As I've already said, I think that the name should be __ibmz_get_tls_of

Re: [PATCH] S/390: Fix layout of struct sigaction_t

2020-04-07 Thread Iain Buclaw via Gcc-patches
On 01/04/2020 18:20, Stefan Liebler wrote: > On 4/1/20 12:54 PM, Iain Buclaw wrote: >> On 01/04/2020 08:28, Stefan Liebler wrote: >>> ping >>> >> >> Thanks, I'll send the patch upstream, as it's the same there. >> >> Looks OK to me. >> >> Regards >> Iain. >> > > Thanks for committing the patch ups

[committed] d: Always set ASM_VOLATILE_P on asm statements (PR94425)

2020-04-07 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the special treatment of 'asm pure' blocks, as the need for code correctness outweighs the need for optimization around these statements. Bootstrapped and regression tested on x86_64-linux-gnu. Committed to mainline. Regards Iain. --- gcc/d/ChangeLog: * toir.cc (

[PATCH] libiberty: Update D symbol demangling for latest ABI spec.

2020-04-04 Thread Iain Buclaw via Gcc-patches
Hi, Some small improvements and clarifications have been done in the D ABI specification to remove all ambiguities found in the current grammar, this implementation now more closely resembles the spec, whilst maintaining compatibility with the old ABI. Three new rules have been added to the ABI.

[committed] d: Fix new tests gdc.dg/pr93038.d and gdc.dg/pr93038b.d in r10-7320 fail

2020-04-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch adjusts another test in gdc.dg that was reported to be failing in PR94315. The scan-file match is likely too strict to always succeed, so instead have split it up into a set of smaller matches. Tested on x86_64-linux-gnu and committed to mainline. Regards Iain. --- gcc/testsuit

[committed] d: Fix gdc.dg/pr92216.d FAILs on 32-bit targets

2020-04-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes the test for PR92216 to also succeed on 16 and 32-bit targets. The symbol being scanned for only matched on 64-bit targets where the this pointer offset is 16. Tested on x86_64-linux-gnu with -m32 and -mx32. Also checked avr-gcc for what output comes from a 16-bit compiler.

Re: [PATCH] S/390: Fix layout of struct sigaction_t

2020-04-01 Thread Iain Buclaw via Gcc-patches
On 01/04/2020 08:28, Stefan Liebler wrote: > ping > Thanks, I'll send the patch upstream, as it's the same there. Looks OK to me. Regards Iain.

Re: [PATCH] S/390: Fix PR91628

2020-04-01 Thread Iain Buclaw via Gcc-patches
On 01/04/2020 08:28, Stefan Liebler wrote: > ping > Hi Stefan, As I've already said, I think that the name should be __ibmz_get_tls_offset to make clear that it is an internal function. Other than that, looks good to me. Iain.

[committed] d: Merge UDAs between function prototype and definitions (PR90136)

2020-03-31 Thread Iain Buclaw via Gcc-patches
Hi, This change fixes the symbol merging in get_symbol_decl to also consider prototypes. This allows the ability to set user defined attributes on the prototype of a function, which then get applied to the definition, if found later in the compilation. The lowering of UDAs to GCC attributes has

[committed] d: Add always_inline to the internal attribute table.

2020-03-31 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds always_inline to the d_langhook_common_attribute_table. The attribute is not directly accessible from user code, rather it is indirectly added from the @forceinline attribute. Even so, a handler should be present for it to prevent false positive warnings. Said warnings are no

[committed] d: Use memset to fill alignment holes with zeroes.

2020-03-31 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes the manual insertion of padding for fields in constructed struct literals, and instead uses memset() on the declaration being initialized. When compiling optimized builds, the intent is usually missed, and alignment holes end up with non-zero values in them anyway. Bootstr

[[committed]] d: Use d_comdat_linkage on generated internal decl.

2020-03-31 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds weak linkage to internal TypeInfo data on top of the existing DECL_COMDAT, which helps in the unlikely event that two of the same TypeInfo data ends up in multiple places. Tested on x86_64-linux-gnu and committed to mainline. Regards Iain --- gcc/d/ChangeLog: * type

[committed] testsuite: Handle more kinds of gdc.test test flags and directives.

2020-03-29 Thread Iain Buclaw via Gcc-patches
Hi, This is the last of the small QA improvements to the dejagnu test files for running the D2 testsuite. This patch adds cases for JSON and D header file generation flags in the testsuite, and sets up the test accordingly to only compile, then check that the expected output file exists. Support

[committed] testsuite: Move C++ tests in gdc.test into own subdirectory.

2020-03-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with dmd upstream 3e10e2dd2. Tests have been moved into runnable_cxx as part of the merge with dmd. The extra flags required for tests that mix C++ and D are now limited to only a small subset of tests, rather than applied to all across gdc.dg

[committed] testsuite: Split up gdc-test.exp into each subdirectory

2020-03-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch splits up gdc-test.exp into multiple test scipts, one for each subdirectory containing test files, instead of having one test script to manage them all. This allows removing some workarounds, such as the need to create symlinks in the test run directory. Tested on x86_64-linux-gnu

[committed] d: Generate phony targets for content imported files (PR93038)

2020-03-22 Thread Iain Buclaw via Gcc-patches
Hi, This patch is an addition to the last change, which started including content imported files in the make dependency list. Now phony targets are also written out if -MP is given. Bootstrapped and regression tested on x86_64-linux-gnu. Committed to trunk. Regards Iain. --- gcc/d/ChangeLog:

[PATCH] d: Fix missing dependencies in depfile for imported files (PR93038)

2020-03-21 Thread Iain Buclaw via Gcc-patches
Hi, A new field for tracking imported files was added to the front-end, this makes use of it by writing all such files in the make dependency list, fixing PR 93038. Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk. Regards Iain. --- gcc/d/ChangeLog: 2020-03-22 Iain Buclaw

[PATCH d] Committed fix for ICE in add_symbol_to_partition_1 at lto/lto-partition.c:215 (PR94920)

2020-03-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch addresses two problems with TypeInfo initializer generation. 1. D array fields pointing to compiler generated data are referencing public symbols with no unique prefix, which can lead to duplicate definition errors in some hard to reduce cases. To avoid name clashes, all symbols t

[PATCH lto/91027][D] Committed fix for SEGV in hash_table::find_slot_with_hash

2020-03-20 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes LTO bug with the D front-end. As DECL_ASSEMBLER_NAME is set on the TYPE_DECL, so TYPE_CXX_ODR_P must also be set on the type. The addition of merge_aggregate_types is not strictly needed now, but it fixes a problem introduced in newer versions of the dmd front-end where temp

[PATCH d] Committed merge upstream dmd d1a606599

2020-03-19 Thread Iain Buclaw via Gcc-patches
Fixes long standing regression in the D front-end implemention, adds a new field to allow retrieving a list of all content imports from the code generator, and fixes a recently introduced test to use old-style syntax for contracts. Bootstrapped and tested on x86_64-linux-gnu, and committed to trun

Re: [PATCH, d] Committed merge with upstream dmd e9420cfbf

2020-03-19 Thread Iain Buclaw via Gcc-patches
On 15/03/2020 14:32, Rainer Orth wrote: > Hi Ian, > >> This patch merges the D front-end implementation with dmd upstream e9420cfbf. > [...] >> Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk. > > this merge introduced a regression on Solaris (SPARC and x86): > > +UNRESOLVED:

[PATCH d/92309] Committed fix for assignment to anonymous union member corrupts sibling members in struct

2020-03-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a logic bug in the adjustment of nested fields in anonymous aggregates in the D front-end, closing PR d/92309. Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk. Regards Iain. --- gcc/d/ChangeLog: PR d/92309 * types.cc (fixup_anonymous_off

[PATCH] d: Committed fix multiple definition error when using mixins and interfaces.

2020-03-16 Thread Iain Buclaw via Gcc-patches
Hi, When generating thunks in the D front-end, they need not necesarily be in the same compilation unit as the module where the target function is declared. When this happens, don't make the thunk public. Later on expand_thunk will be called with force_gimple_thunk=true, so the thunk can never b

[PATCH PR d/92792]: Committed reset libtool_VERSION to 1:0:0

2020-03-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch resets the libphobos soversion. Firstly, because Phobos, being template heavy, makes no attempt at being backwards compatible with previous versions. Even improvements in attribute inference in the compiler can have the effect of changing the mangling of many symbols, which is wha

[PATCH libphobos]: Committed merge upstream druntime and phobos

2020-03-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the libphobos implementation with upstream druntime 6c45dd3a, and phobos 68cc18adb. This change surrounds the gcc-style asm operands with parentheses, as the old style of optionally omitting is now deprecated. This is being applied first before the changes to the compiler t

[PATCH d]: Committed merge with upstream dmd

2020-03-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the D front-end implementation with upstream dmd b061bd744. Fixes an ICE in the parser, and deprecates a previously allowed style of syntax that deviated from GNU-style extended asm. Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk. Regards Iain. --- g

[PATCH libphobos] Committed merge with upstream druntime 7915b6a3

2020-03-14 Thread Iain Buclaw via Gcc-patches
Hi, This patch merges the libphobos implementation with upstream druntime 7915b6a3. Includes port fixes for Musl on ARM, AArch64, and SystemZ targets. Bootstrapped and tested on x86_64-linux-gnu, and committed to trunk. Regards Iain. --- diff --git a/libphobos/libdruntime/MERGE b/libphobos/

<    1   2   3   4   5   6