[committed] d: Fix ICE in build_deref, at d/d-codegen.cc:1650 [PR111650]

2024-04-19 Thread Iain Buclaw
Hi, This regression in the D front-end was found to be caused by in some cases the hidden closure parameter type being generated too early for nested functions. Better to update the type after the local closure/frame type has been completed. Bootstrapped and regression tested on

[committed] d: Merge upstream dmd, druntime b65767825f, phobos 92dc5a4e9.

2024-04-06 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd b65767825f, and the standard library with phobos 92dc5a4e9. Synchronizing with the upstream release of v2.108.0. D front-end changes: - Import dmd v2.108.0. D runtime changes: - Import druntime

Re: [PATCH] libphobos, Darwin: Enable libphobos for most Darwin.

2024-04-02 Thread Iain Buclaw
Excerpts from Iain Sandoe's message of April 2, 2024 1:51 pm: > I have been building and testing D/libphobos for some time and over > some GCC and OS releases. As discussed on IRC a while ago, I think > we're ready to enable this (it also avoids an annoying build fail at > stage 2 if one forgets

[committed] d: Merge upstream dmd, druntime 855353a1d9

2024-03-17 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd 855353a1d9. D front-end changes: - Import dmd v2.108.0-rc.1. - Add support for Named Arguments for functions. - Hex strings now convert to integer arrays. D runtime changes: - Import

[committed] d: Fix -fpreview=in ICEs with forward referenced parameter [PR112285]

2024-03-10 Thread Iain Buclaw
Hi, This patch removes the early lowering of D AST types as GCC trees in Target::preferPassByRef, fixing both PR12285 and PR12290. The way that the target hook preferPassByRef is implemented, it relied on the GCC "back-end" tree type to determine whether or not to use `ref' ABI for D `in'

Re: Frontend access to target features (was Re: [PATCH] libgccjit: Add ability to get CPU features)

2024-03-10 Thread Iain Buclaw
Excerpts from David Malcolm's message of März 5, 2024 4:09 pm: > On Thu, 2023-11-09 at 19:33 -0500, Antoni Boucher wrote: >> Hi. >> See answers below. >> >> On Thu, 2023-11-09 at 18:04 -0500, David Malcolm wrote: >> > On Thu, 2023-11-09 at 17:27 -0500, Antoni Boucher wrote: >> > > Hi. >> > > This

Re: [committed] d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]

2024-03-03 Thread Iain Buclaw
Excerpts from Andrew Pinski's message of März 3, 2024 11:49 pm: > On Sat, Mar 2, 2024 at 5:51 PM Iain Buclaw wrote: >> >> Hi, >> >> This patch fixes a wrong code issue in the D front-end where lowered >> struct comparisons would reinterpret fields with a differ

[committed] d: Merge upstream dmd, druntime f8bae04558, phobos ba2ade9dec

2024-03-03 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd f8bae04558, and the standard library with phobos ba2ade9dec D front-end changes: - Import dmd v2.108.1-beta-1. D runtime changes: - Import druntime v2.108.1-beta-1. Phobos changes: - Import phobos

Re: [committed] d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]

2024-03-03 Thread Iain Buclaw
Excerpts from Richard Biener's message of März 3, 2024 11:41 am: > > >> Am 03.03.2024 um 02:51 schrieb Iain Buclaw : >> >> Hi, >> >> This patch fixes a wrong code issue in the D front-end where lowered >> struct comparisons would reinterpret

[committed] d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]

2024-03-02 Thread Iain Buclaw
Hi, This patch fixes a wrong code issue in the D front-end where lowered struct comparisons would reinterpret fields with a different (usually bigger) alignment than the original. Use `build_aligned_type' to preserve the alignment when casting away for such comparisons. Bootstrapped and

[committed][GCC13] d: Fix callee destructor call invalidates the live object [PR113758]

2024-03-02 Thread Iain Buclaw
Hi, This patch backports a fix to code generation when passing objects by invisible reference that have a defined cpctor or dtor. When generating the argument, check the isCalleeDestroyingArgs hook, and force a TARGET_EXPR to be created if true, so that a reference to the live object isn't

[committed][GCC13] d: Fix internal compiler error: in make_import, at d/imports.cc:48 [PR113125]

2024-03-02 Thread Iain Buclaw
Hi, This patch backports an ICE triggered in the D front-end. The cause of the ICE was that TYPE_DECLs were only being generated for structs with members, not opaque structs. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, backported to releases/gcc-13, releases/gcc-12, and

[committed] d: Merge dmd, druntime ceff48bf7d, phobos dcbfbd43a

2024-02-25 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd ceff48bf7d, and the standard library with phobos dcbfbd43a. D front-end changes: - Import latest fixes from dmd v2.107.1-rc.1. D runtime changes: - Import latest fixes from druntime v2.107.1-rc.1.

Re: [PATCH v10 2/2] Add gcov MC/DC tests for GDC

2024-02-23 Thread Iain Buclaw
Excerpts from Jørgen Kvalsvik's message of Februar 23, 2024 12:18 pm: > This is a mostly straight port from the gcov-19.c tests from the C test > suite. The only notable differences from C to D are that D flips the > true/false outcomes for loop headers, and the D front end ties loop and > ternary

[committed] d: Add UTF BOM tests to gdc.dg testsuite

2024-02-19 Thread Iain Buclaw
Hi, This patch checks in a few combinations of UTF BOM/no-BOM tests to the gdc.dg testsuite. Some of these are part of the upstream DMD `gdc.test' testsuite, but they had been omitted because they get mangled by the lib/gdc-utils.exp helpers when parsing and staging the tests. Translate them

Re: [PATCH] testsuite: gdc: Require ucn in gdc.test/runnable/mangle.d etc. [PR104739]

2024-02-14 Thread Iain Buclaw
Excerpts from Rainer Orth's message of Februar 14, 2024 11:51 am: > gdc.test/runnable/mangle.d and two other tests come out UNRESOLVED on > Solaris with the native assembler: > > UNRESOLVED: gdc.test/runnable/mangle.d compilation failed to produce > executable > UNRESOLVED:

[committed] libphobos: Bump soname version to 5 [PR113667]

2024-02-12 Thread Iain Buclaw
Hi, This patch bumps the soname version of libphobos. Each major release is not binary compatible with the previous. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, committed to mainline. Regards, Iain. --- PR d/113667 libphobos/ChangeLog: * configure:

[committed] d: Fix internal compiler error: in make_import, at d/imports.cc:48 [PR113125]

2024-02-12 Thread Iain Buclaw
Hi, This patch fixes an ICE triggered in the D front-end. The cause of the ICE was that TYPE_DECLs were only being generated for structs with members, not opaque structs. PR d/113125 Bootstrapped and regression tested on x86_64-linux-gnu/-m32, committed to mainline. Regards, Iain.

[committed] d: Fix callee destructor call invalidates the live object [PR113758]

2024-02-12 Thread Iain Buclaw
Hi, This patch fixes code generation problem with passing objects by invisible reference - because of a defined cpctor or dtor. When generating the argument, check the isCalleeDestroyingArgs hook, and force a TARGET_EXPR to be created if true, so that a reference to the live object isn't passed

[committed] d: Merge dmd, druntime 11240a9663

2024-02-12 Thread Iain Buclaw
Hi, This patch merges the D front-end and core runtime library with upstream dmd 11240a9663. Included in the merge are the fix for PR113772, and new testsuite directives to enable fixing PR104739. D front-end changes: - Import latest fixes from dmd v2.107.0. D runtime changes:

[committed] d: Merge dmd, druntime a6f1083699, phobos 31dedd7da

2024-02-03 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd a6f1083699, and the standard library with phobos 31dedd7da. D front-end changes: - Import dmd v2.107.0. - Character postfixes can now also be used for integers of size two or four. D run-time

[committed] d: Merge dmd. druntime e770945277, phobos 6d6e0b9b9

2024-02-03 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd e770945277, and the standard runtime library with phobos 6d6e0b9b9. Synchronizing with the upstream release candidate as of 2024-01-27. D front-end changes: - Import latest fixes from dmd v2.107.0-beta.1. - Hex

Re: [PATCH] testsuite, GDC: Update link flags [PR112861].

2024-01-28 Thread Iain Buclaw
Excerpts from Iain Sandoe's message of Januar 28, 2024 4:02 pm: > Tested on i686, x86_64, aarch64 Darwin, x86_64, aarch64 Linux, > OK for trunk? > thanks, > Iain > OK. Thanks again! Iain.

Re: [PATCH] testsuite, libphobos: Update link flags [PR112864].

2024-01-28 Thread Iain Buclaw
Excerpts from Iain Sandoe's message of Januar 28, 2024 4:03 pm: > Tested on i686, x86_64, aarch64 Darwin, x86_64, aarch64 Linux, > OK for trunk? > thanks, > Iain > Thanks Iain! OK. Seems reasonable to me. Iain.

Re: [PATCH v9 2/2] Add gcov MC/DC tests for GDC

2023-12-31 Thread Iain Buclaw
Excerpts from Jørgen Kvalsvik's message of Dezember 31, 2023 4:51 pm: > This is a mostly straight port from the gcov-19.c tests from the C test > suite. The only notable differences from C to D are that D flips the > true/false outcomes for loop headers, and the D front end ties loop and > ternary

Re: [committed] d: Merge upstream dmd, druntime 2bbf64907c, phobos b64bfbf91

2023-12-11 Thread Iain Buclaw
Excerpts from Iain Buclaw's message of Dezember 11, 2023 11:07 am: > Hi, > > This patch merges the D front-end and runtime library with upstream dmd > 2bbf64907c, and the standard library with phobos b64bfbf91. > > Synchronizing with the upstream release of v2.106.0. > ... > diff --git

[committed] d: Merge upstream dmd, druntime 2bbf64907c, phobos b64bfbf91

2023-12-11 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd 2bbf64907c, and the standard library with phobos b64bfbf91. Synchronizing with the upstream release of v2.106.0. D front-end changes: - Import dmd v2.106.0. D runtime changes: - Import druntime v2.106.0.

Re: [PATCH v3 2/2] libphobos: Update build scripts for LoongArch64.

2023-12-08 Thread Iain Buclaw
Excerpts from Yang Yujie's message of Dezember 8, 2023 11:09 am: > libphobos/ChangeLog: > > * m4/druntime/cpu.m4: Support loongarch* targets. > * libdruntime/Makefile.am: Same. > * libdruntime/Makefile.in: Regenerate. > * configure: Regenerate. > --- > libphobos/configure

Re: [PATCH v2 3/3] libphobos: LoongArch hardware support.

2023-12-07 Thread Iain Buclaw
Excerpts from Yang Yujie's message of Dezember 1, 2023 8:46 am: > libphobos/ChangeLog: > > * src/std/math/hardware.d: Implement FP control. > --- > libphobos/src/std/math/hardware.d | 53 +++ > > diff --git a/libphobos/src/std/math/hardware.d >

Re: [PATCH v3 3/3] libruntime: Add fiber context switch code for LoongArch.

2023-12-07 Thread Iain Buclaw
Excerpts from Yang Yujie's message of Dezember 1, 2023 11:08 am: > libphobos/ChangeLog: > > * libdruntime/config/loongarch/switchcontext.S: New file. > --- OK. Thanks, Iain.

Re: [PATCH v3 2/3] libphobos: Update build scripts for LoongArch64.

2023-12-07 Thread Iain Buclaw
Excerpts from Yang Yujie's message of Dezember 1, 2023 11:08 am: > libphobos/ChangeLog: > > * m4/druntime/cpu.m4: Support loongarch* targets. > * libdruntime/Makefile.am: Same. > * libdruntime/Makefile.in: Regenerate. > * configure: Regenerate. > --- > libphobos/configure

Re: [PATCH v3 1/3] LoongArch: Adjust D version strings.

2023-12-07 Thread Iain Buclaw
Hi, Thanks for this. Excerpts from Yang Yujie's message of Dezember 1, 2023 11:08 am: > diff --git a/gcc/d/dmd/cond.d b/gcc/d/dmd/cond.d > index 568b639e0b6..02af0cc9e29 100644 > --- a/gcc/d/dmd/cond.d > +++ b/gcc/d/dmd/cond.d > @@ -693,10 +693,10 @@ extern (C++) final class VersionCondition :

Re: [committed] d: Merge upstream dmd ff57fec515, druntime ff57fec515, phobos 17bafda79.

2023-11-22 Thread Iain Buclaw
Excerpts from Rainer Orth's message of November 21, 2023 5:03 pm: > Rainer Orth writes: > >> either this patch or the previous one broke D bootstrap with GCC 9. On >> both i386-pc-solaris2.11 with gdc 9.4.0 and sparc-sun-solaris2.11 with >> gdc 9.3.0, stage 1 d21 fails to link with >> >>

Re: [committed] d: Merge upstream dmd ff57fec515, druntime ff57fec515, phobos 17bafda79.

2023-11-22 Thread Iain Buclaw
Excerpts from Rainer Orth's message of November 21, 2023 4:59 pm: > Hi Iain, > >> This patch merges the D front-end and runtime library with upstream dmd >> ff57fec515, and the standard library with phobos 17bafda79. >> >> Synchronizing with the upstream release candidate of v2.106.0. >> >> D

Re: [PATCH 2/3] Add generated .opt.urls files

2023-11-12 Thread Iain Buclaw
Excerpts from David Malcolm's message of November 10, 2023 10:42 pm: > gcc/d/ChangeLog: > * lang.opt.urls: New file, autogenerated by > regenerate-opt-urls.py. > --- > gcc/d/lang.opt.urls | 95 + > create mode 100644 gcc/d/lang.opt.urls > [abridged view of

[committed] d: Merge upstream dmd, druntime 643b1261bb, phobos 1c98326e7

2023-11-02 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd 643b1261bb, and standard library with phobos 1c98326e7. Synchronizing with the v2.106.0-beta.1 release. This is being done a little earlier than usual as there's a lot of internal moving code around within upstream at

[committed] d: Clean-up unused variable assignments after interface change

2023-10-31 Thread Iain Buclaw
Hi, The lowering done for invoking `new' on a single dimension array was moved from the code generator to the front-end semantic pass in r14-4996. This removes the detritus left behind in the code generator from that deletion. Bootstrapped and regression tested on x86_64-linux-gnu/-m32,

Re: [committed] d: Merge upstream dmd, druntime e48bc0987d, phobos 2458e8f82.

2023-10-30 Thread Iain Buclaw
Excerpts from Rainer Orth's message of Oktober 30, 2023 5:37 pm: > Hi Iain, > >> This patch merges the D front-end and runtime library with upstream dmd >> e48bc0987d, and standard library with phobos 2458e8f82. >> >> Synchronizing with the v2.106.0-beta.1 release. >> >> D front-end changes: >>

[committed] d: Fix ICE: verify_gimple_failed (conversion of register to a different size in 'view_convert_expr') [PR110712]

2023-10-29 Thread Iain Buclaw
Hi, This patch fixes an ICE cause by the way the D front-end generates its codegen around va_list types. Static arrays in D are passed around by value, rather than decaying to a pointer. On x86_64 __builtin_va_list is an exception to this rule, but semantically it's still treated as a static

[committed] d: Merge upstream dmd, druntime e48bc0987d, phobos 2458e8f82.

2023-10-29 Thread Iain Buclaw
Hi, This patch merges the D front-end and runtime library with upstream dmd e48bc0987d, and standard library with phobos 2458e8f82. Synchronizing with the v2.106.0-beta.1 release. D front-end changes: - Import dmd v2.106.0-beta.1. D runtime changes: - Import druntime v2.106.0-beta.1.

[committed] d: Fix ICE: in verify_gimple_in_seq on powerpc-darwin9 [PR112270]

2023-10-28 Thread Iain Buclaw
Hi, This patch fixes an ICE seen during stage2 on powerpc-darwin9 only. There were still some uses of GCC's boolean_type_node in the D front-end, which caused a type mismatch to trigger as D bool size is fixed to 1 byte on all targets. So two new nodes have been introduced - d_bool_false_node

[committed] d: Add warning for call expression without side effects

2023-10-28 Thread Iain Buclaw
Hi, In the last merge of the dmd front-end with upstream (r14-4830), this warning got removed from the semantic passes. Reimplement the warning for the code generation pass instead, where it cannot have an effect on conditional compilation. Bootstrapped and regression tested on

[committed] d: Merge upstream dmd f4be7f6f7b.

2023-10-22 Thread Iain Buclaw
Hi, This patch merges the D front-end with upstream dmd f4be7f6f7b. Synchronizing with the upstream development branch as of 2023-10-22. D front-end changes: - Fix bootstrap failure with i686-darwin9. ``` Undefined symbols for architecture i386: "gendocfile",

[committed] d: Forbid taking the address of an intrinsic with no implementation

2023-10-16 Thread Iain Buclaw
Hi, This code fails to link: import core.math; real function(real) fn = However, when called directly, the D intrinsic `sin()' is expanded by the front-end into the GCC built-in `__builtin_sin()'. This has been fixed to now also expand the function when a reference is taken. As there

[committed] d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.

2023-10-16 Thread Iain Buclaw
Hi, This patch merges the D front-end and run-time library with upstream dmd 4c18eed967, and standard library with phobos d945686a4. Synchronizing with the upstream development branch as of 2023-10-16. D front-end changes: - Import latest fixes to mainline. D runtime changes:

[committed] d: Merge upstream dmd, druntime f9efc98fd7, phobos a3f22129d.

2023-10-15 Thread Iain Buclaw
Hi, This patch merges the D front-end and run-time library with upstream dmd f9efc98fd7, and standard library with phobos a3f22129d. Synchronizing with the latest bug fixes in the v2.105.2 release. D front-end changes: - Import dmd v2.105.2. - A function with enum storage class

[committed] Fix ICE in set_cell_span, at text-art/table.cc:148 with D front-end and -fanalyzer

2023-10-14 Thread Iain Buclaw
Hi, The internal error in analyzer turned out to be caused by a subtly invalid tree representation of STRING_CSTs in the D front-end, fixed by including the terminating NULL as part of the TREE_STRING_POINTER. When adding a first analyzer test for D, it flagged up another subtle mismatch in one

[committed] d: Reduce code duplication of writing generated files.

2023-10-14 Thread Iain Buclaw
Hi, This is a small refactoring ahead of the next merge from upstream, where a few more front-end routines will stop doing the file handling themselves. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * d-lang.cc

Re: [PATCH 1/1] gcc/d: add LoongArch64 support for D frontend

2023-09-24 Thread Iain Buclaw
Excerpts from liushuyu's message of September 24, 2023 1:21 am: > > gcc/ChangeLog: > > * config.gcc: add loongarch-d.o to d_target_objs for LoongArch > architecture. > > gcc/config/ChangeLog: > > * loongarch/loongarch-d.cc > (loongarch_d_target_versions): add interface

[committed] d: Merge upstream dmd, druntime 4574d1728d, phobos d7e79f024.

2023-09-23 Thread Iain Buclaw
Hi, This patch merges the D front-end and run-time library with upstream dmd 4574d1728d, and standard library with phobos d7e79f024. Updating the latest changes from the v2.105.0 release. D front-end changes: - Import dmd v2.105.0. - Catch clause must take only `const' or

Re: [PATCHSET] Reintroduce targetrustm hooks

2023-09-13 Thread Iain Buclaw via Gcc-patches
Excerpts from Arthur Cohen's message of September 7, 2023 3:41 pm: > Alright, was not expecting to mess up this patchset so bad so here we go: > > This patchset reintroduces proper targetrustm hooks without the old > problematic mess of macros we had, which had been removed for the first > merge

Re: [PATCH] Allow target attributes in non-gnu namespaces

2023-09-13 Thread Iain Buclaw via Gcc-patches
Excerpts from Richard Sandiford via Gcc-patches's message of September 8, 2023 6:29 pm: > Currently there are four static sources of attributes: > > - LANG_HOOKS_ATTRIBUTE_TABLE > - LANG_HOOKS_COMMON_ATTRIBUTE_TABLE > - LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE > - TARGET_ATTRIBUTE_TABLE > > All of the

[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

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

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.

[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

[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

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

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

[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

[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

[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

[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

[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

[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: 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*)_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

[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

[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

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

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

[committed] d: Merge upstream dmd, druntime 5f7552bb28, phobos 67a47cf39.

2023-03-16 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 67a47cf39. Synchronizing the latest bug fixes in the upcoming v2.103.0 release. D front-end changes: - Import dmd v2.103.0-rc.1. D runtime changes: -

[committed] d: Fix closure fields don't get same alignment as local variable [PR109144]

2023-03-16 Thread Iain Buclaw via Gcc-patches
Hi, Local variables with both non-local references and explicit alignment did not propagate their alignment to either the closure field or closure frame type, resulting in the closure being misaligned. This is now correctly set-up when building the frame type. Bootstrapped and regression tested

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

[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: 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,

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

[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

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

[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

[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

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

Re: [PATCH 3/7] **/*.texi: Reorder index entries

2023-01-27 Thread Iain Buclaw via Gcc-patches
Excerpts from Arsen Arsenović via Gcc-patches's message of Januar 27, 2023 1:18 am: > > gcc/d/ChangeLog: > > * implement-d.texi: Reorder index entries around @items. > > --- > gcc/d/implement-d.texi | 66 ++--- > > diff --git a/gcc/d/implement-d.texi b/gcc/d/implement-d.texi >

Re: [PATCH v2] IBM zSystems: Fix TARGET_D_CPU_VERSIONS

2023-01-24 Thread Iain Buclaw via Gcc-patches
Excerpts from Stefan Schulze Frielinghaus's message of Januar 24, 2023 9:47 am: > In the context of D the interpretation of S390, S390X, and SystemZ is a > bit fuzzy. The wording S390X was wrongly deprecated in favour of > SystemZ by commit >

Re: Ping^3: [PATCH] d: Update __FreeBSD_version values [PR107469]

2023-01-23 Thread Iain Buclaw via Gcc-patches
Excerpts from Lorenzo Salvadore's message of Januar 10, 2023 5:10 pm: > Hello, > > Ping https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605685.html > > I would like to remind that Gerald Pfeifer already volunteered to commit this > patch > when it is approved. However the patch has not

Re: [PATCH] IBM zSystems: Fix TARGET_D_CPU_VERSIONS

2023-01-23 Thread Iain Buclaw via Gcc-patches
Excerpts from Stefan Schulze Frielinghaus via Gcc-patches's message of Januar 13, 2023 6:54 pm: > In the context of D the interpretation of S390, S390X, and SystemZ is a > bit fuzzy. The wording S390X was wrongly deprecated in favour of > SystemZ by commit >

Re: Add '-Wno-complain-wrong-lang', and use it in 'gcc/testsuite/lib/target-supports.exp:check_compile' and elsewhere (was: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' opt

2022-12-16 Thread Iain Buclaw via Gcc-patches
Excerpts from Thomas Schwinge's message of Dezember 16, 2022 3:10 pm: > > In the test suites, a number of existing test cases explicitly match the > "command-line option [...] is valid for [...] but not for [...]" > diagnostic with 'dg-warning'; I've left those alone. On the other hand, > I've

Re: Make '-frust-incomplete-and-experimental-compiler-do-not-use' a 'Common' option (was: Rust front-end patches v4)

2022-12-15 Thread Iain Buclaw via Gcc-patches
Excerpts from Jakub Jelinek via Gcc-patches's message of Dezember 15, 2022 12:16 pm: > We seem to have a problem in other testsuites too: > grep ' valid for .*but not for' */*.log | sort -u > gcc/gcc.log:/home/jakub/src/gcc/gcc/testsuite/gcc.dg/pragma-diag-6.c:2:30: > warning: option

[GCC-10][committed] libphobos: Fix std.path.expandTilde raising onOutOfMemory

2022-12-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports from mainline a fix for std.path.expandTilde erroneously raising onOutOfMemory after failed call to `getpwnam_r()'. Regression tested on x86_64-linux-gnu/-m32/-mx32, committed to releases/gcc-10 branch. Regards, Iain. --- libphobos/ChangeLog: * src/std/path.d

[GCC-11][committed] libphobos: Backport library and bindings fixes from mainline

2022-12-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports some fixes for the libphobos library from mainline that fix build and testsuite failures. Regression tested on x86_64-linux-gnu/-m32/-mx32, committed to releases/gcc-11 branch. D Runtime changes: - Fix MIPS64 bindings for CRuntime_UClibc. Phobos changes:

[GCC-12][committed] libphobos: Backport library and bindings fixes from mainline

2022-12-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports some fixes for the libphobos library from mainline that fix build and testsuite failures. Regression tested on x86_64-linux-gnu/-m32/-mx32, committed to releases/gcc-12 branch. D Runtime changes: - Fix MIPS64 bindings for CRuntime_UClibc. Phobos changes:

[committed] d: Fix undefined reference to nested lambda in template (PR108055)

2022-12-12 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a linker error caused by gdc not emitting all symbols. Sometimes, nested lambdas of templated functions get no code generation due to them being marked as instantianted outside of all modules being compiled in the current compilation unit. This despite enclosing template

[GCC-12][committed] d: Remove "final" and "override" from visitor method.

2022-12-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch removes "final" and "override" from the OverloadSet visitor method. This was added by the backport of an ICE in r12-8969. While harmless, it was not until r13-758 that "final" and "override" were introduced to all visitor methods in the D front-end. Removing it from the release

[committed] d: Fix internal compiler error: in visit, at d/imports.cc:72 (PR108050)

2022-12-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in the D front-end when importing symbols that have multiple overloads. The visitor for lowering IMPORTED_DECLs did not have an override for dealing with importing OverloadSet symbols. This has now been implemented in the code generator. Bootstrapped and regression

[committed] d: Expand bsr intrinsic as `clz(arg) ^ (argsize - 1)'

2022-12-11 Thread Iain Buclaw via Gcc-patches
Hi, This patch tweaks the code expansion of the D intrinsic bsr() function. As well as removing unnecessary casts, this results in less temporaries being generated during the initial gimple lowering pass. Otherwise the code generated is identical to the former intrinsic expansion. Bootstrapped

Re: [committed] onlinedocs: Add documentation links to gdc

2022-12-07 Thread Iain Buclaw via Gcc-patches
Hi Gerald, Excerpts from Gerald Pfeifer's message of Dezember 6, 2022 2:13 pm: > On Tue, 6 Dec 2022, Iain Buclaw wrote: >> Now that the D front-end documentation has been generated and pushed to >> the site after r13-4421, this can be added to the main index page. >> >

[committed] onlinedocs: Add documentation links to gdc

2022-12-06 Thread Iain Buclaw via Gcc-patches
Hi, Now that the D front-end documentation has been generated and pushed to the site after r13-4421, this can be added to the main index page. This is a simple copy from other entries, so have gone ahead and committed it. Regards, Iain. --- htdocs/onlinedocs/index.html | 6 ++ 1 file

Re: Rust front-end patches v4

2022-12-06 Thread Iain Buclaw via Gcc-patches
Excerpts from Richard Biener via Gcc-patches's message of Dezember 6, 2022 12:03 pm: > On Tue, Dec 6, 2022 at 11:11 AM wrote: >> >> This patchset contains the fixed version of our most recent patchset. We >> have fixed most of the issues noted in the previous round of reviews, and are >> keeping

Re: Ping: [PATCH] maintainer-scripts: Add gdc to update_web_docs_git

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi Gerald, Excerpts from Gerald Pfeifer's message of November 29, 2022 9:21 pm: > Hi Iain, > > On Tue, 29 Nov 2022, Iain Buclaw via Gcc-patches wrote: >> This looks obvious, however I don't know how things are generated for >> the online documentation site in order to say

  1   2   3   4   5   6   7   8   9   10   >