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. >> >> This is a simple copy

[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

[committed] d: Add language reference section to documentation files.

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This adds an initial body of documentation for the D front-end - other than the existing documentation for command-line usage/the man page. Documentation covers code generation choices specific to GNU D - what attributes are supported, intrinsics, pragmas, predefined versions, language

[committed] d: Update recipes for building html and pdf documentation

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch sorts out the include directories for building the gdc docs - we don't need to include anything from the toplevel docs directory. The html output directory has also been renamed from /d/ to /gdc/ to make it clearer that this is vendor-specific documentation. Tested by building

[committed] d: Separate documentation indices into options and keywords.

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch separates indexes at the end of the gdc documentation into an Options index and Keyword index, as per documentation manuals in other front-ends. Tested by building and checking pdf/info/man/html pages, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: *

[committed] d: Synchronize gdc documentation with options in d/lang.opt

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch synchronizes the documentation between lang.opt and gdc.texi. Tested by building and checking pdf/info/man/html pages, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * gdc.texi: Update gdc option documentation. * lang.opt (frevert=intpromote):

[GCC-12][committed] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch was applied to mainline back in August, but was held back from backporting until after 12.2 release to allow some more time for testing. There are no further regressions been found, so have backported to the releases/gcc-12 branch. Bootstrapped and regression tested on

[committed] d: Fix ICE on named continue label in an unrolled loop [PR107592]

2022-11-30 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE with using `continue' on a named label in an unrolled loop statement. Continue labels in an unrolled loop require a unique label per iteration. Previously this used the Statement body node for each unrolled iteration to generate a new entry in the label hash table.

Re: [PATCH] range-op: Implement floating point division fold_range [PR107569]

2022-11-30 Thread Iain Buclaw via Gcc-patches
Excerpts from Jakub Jelinek via Gcc-patches's message of November 11, 2022 10:09 am: > Hi! > > Here is the floating point division fold_range implementation, > as I wrote in the last mail, we could outline some of the common parts > into static methods with descriptive names and share them

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

2022-11-29 Thread Iain Buclaw via Gcc-patches
Ping. This looks obvious, however I don't know how things are generated for the online documentation site in order to say this won't cause any problems for whatever process is building these pages. Excerpts from Iain Buclaw's message of November 21, 2022 11:29 am: > Hi, > > This patch adds gdc

Re: [PATCH] d: respect --enable-link-mutex configure option

2022-11-22 Thread Iain Buclaw via Gcc-patches
Excerpts from Martin Liška's message of November 22, 2022 10:41 am: > I noticed the option is ignored because @DO_LINK_MUTEX@ > is not defined in d/Make-lang.in. > > Tested locally before and after the patch. > > Ready to be installed? > Thanks, > Martin > Fine on my end. Thanks! Iain.

[PATCH] maintainer-scripts: Add gdc to update_web_docs_git

2022-11-21 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds gdc to maintainer-scripts/update_web_docs_git so that it's built and uploaded to gcc.gnu.org/onlinedocs. One half of re-adding the gdc docs that were taken down after the revert to the Sphinx conversion. OK? Regards, Iain. --- PR web/107749

[committed] d: Adjust attr_register2.d to pass when compiling with -m32

2022-11-05 Thread Iain Buclaw via Gcc-patches
Hi, Noticed when running on x86_64-linux-gnu with `-m32', this test triggered a different kind of error. Adjusted the test to use a different register that is common between x86 and x86_64. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline. Regards, Iain.

[committed] d: Add support for vector comparison operators

2022-11-05 Thread Iain Buclaw via Gcc-patches
Hi, The front-end added semantic support to permit comparing two vector expressions. This removes the restriction in the code generator, as well as the intrisics that previously exposed the same operation. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline.

[committed] d: Make TARGET_D_MINFO_SECTION hooks in elfos.h the language default.

2022-10-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch makes the TARGET_D_MINFO_SECTION hooks defined in elfos.h the langauge default, removing the last of all TARGET_D_* macro definitions in common target headers. Now everything is either defined in the D language front-end, or D-specific target headers. The target macros

[PATCH] d: Remove D-specific version definitions from target headers

2022-10-17 Thread Iain Buclaw via Gcc-patches
Hi, This splits up the targetdm sources so that each file only handles one target platform. Having all logic kept in the headers means that they could become out of sync when a new target is added (loongarch*-*-linux*) or accidentally broken if some headers in tm_file are omitted or changed

Re: [PATCH Rust front-end v2 33/37] gccrs: add lang-spec.h

2022-10-14 Thread Iain Buclaw via Gcc-patches
Excerpts from herron.phi...@googlemail.com's message of August 24, 2022 1:59 pm: > From: Philip Herron > > This specifies the extensions of the Rust language. > --- > gcc/rust/lang-specs.h | 26 ++ > 1 file changed, 26 insertions(+) > create mode 100644

[committed] d: Include tm.h in all D target platform sources, remove memmodel.h

2022-09-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch re-adds tm.h to all D-specific target platform sources, previously removed by an earlier change that fixed up tm_d.h generation. The tm.h header would pull in config/elfos.h, which defines TARGET_D_MINFO_SECTION needed for the D module support in the front-end to emit data to the

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-07 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of September 7, 2022 2:40 pm: > Hi Iain, > >>> Yes, this is data related. The DSO registry picks up nothing in the >>> miscompiled stage2 compiler, leaving all data uninitialized. The stage1 >>> compiler works, and runs all module constructors ahead of

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-07 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Buclaw's message of September 6, 2022 11:41 pm: > Excerpts from Iain Buclaw's message of September 6, 2022 7:02 pm: >> Excerpts from Rainer Orth's message of September 6, 2022 4:25 pm: >>> Hi Iain, >>> > there is indeed ;-) The previous d21 emits > > binary

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-06 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Buclaw's message of September 6, 2022 7:02 pm: > Excerpts from Rainer Orth's message of September 6, 2022 4:25 pm: >> Hi Iain, >> there is indeed ;-) The previous d21 emits binary./266566/gcc/d21 version v2.100.1 predefs GNU D_Version2

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-06 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of September 6, 2022 4:25 pm: > Hi Iain, > >>> there is indeed ;-) The previous d21 emits >>> >>> binary./266566/gcc/d21 >>> version v2.100.1 >>> >>> predefs GNU D_Version2 LittleEndian GNU_DWARF2_Exceptions >>> GNU_StackGrowsDown GNU_InlineAsm assert

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-06 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of September 6, 2022 2:04 pm: > Hi Iain, > >> Is there a difference in output from `./gcc/d21 -quiet -v` ? >> >> Pay attention to any predefs that have suddenly appeared or disappeared. > > there is indeed ;-) The previous d21 emits > > binary

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-06 Thread Iain Buclaw via Gcc-patches
Excerpts from Rainer Orth's message of September 6, 2022 9:42 am: > Hi Iain, > >> Excerpts from Richard Biener's message of September 1, 2022 8:28 am: >>> On Wed, Aug 31, 2022 at 9:21 PM Iain Buclaw wrote: >>> >>> Ah yes - I think, even if a bit verbose, this is exactly how it was supposed >>>

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-09-02 Thread Iain Buclaw via Gcc-patches
Excerpts from Richard Biener's message of September 1, 2022 8:28 am: > On Wed, Aug 31, 2022 at 9:21 PM Iain Buclaw wrote: >> >> Excerpts from Joseph Myers's message of August 31, 2022 7:16 pm: >> > On Wed, 31 Aug 2022, Iain Buclaw via Gcc-patches wrote: >> > &

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-08-31 Thread Iain Buclaw via Gcc-patches
Excerpts from Joseph Myers's message of August 31, 2022 7:16 pm: > On Wed, 31 Aug 2022, Iain Buclaw via Gcc-patches wrote: > >> Excerpts from Joseph Myers's message of August 30, 2022 11:53 pm: >> > On Fri, 26 Aug 2022, Richard Biener via Gcc-patches wrote: >> > &

Re: [PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-08-31 Thread Iain Buclaw via Gcc-patches
Excerpts from Joseph Myers's message of August 30, 2022 11:53 pm: > On Fri, 26 Aug 2022, Richard Biener via Gcc-patches wrote: > >> I was hoping Joseph would chime in here - I recollect debugging this kind >> of thing and a thread about this a while back but unfortunately I do not >> remember the

[PATCH] wwwdocs: Add D language changes and caveats to gcc-12/changes.html

2022-08-17 Thread Iain Buclaw via Gcc-patches
Hi, This patch belatedly adds the new features and changes to the D front-end during the GCC 12 development cycle, as well as a bullet in the caveat section for D's new bootstrapping requirements. If nothing stands out being really wrong, I'll go ahead and commit it by end of week. OK?

[PATCH] d: Fix #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported (PR105659)

2022-08-16 Thread Iain Buclaw via Gcc-patches
Hi, Because targetdm contains hooks pertaining to both the target platform and cpu, it tries to pull in both platform and cpu headers via tm_d.h in the source file where TARGETDM_INITIALIZER is used. Since 12.0, this has caused problems when there is no platform (*-elf), resulting in

[committed] d: Update DIP links in gdc documentation to point at upstream repository

2022-08-16 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes the broken DIP links in the GDC documentation. The wiki links probably worked at some point in the distant past, but now the official location of tracking all D Improvement Proposals is on the upstream dlang/DIPs GitHub repository. Regtested, committed to mainline, and

[committed] d: Defer compiling inline definitions until after the module has finished.

2022-08-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch is a follow-up to r13-2002 and r12-8673 (PR d/106563), that instead pushes inline definitions onto a deferred list to be compiled after the current module has finished. This is to prevent the case of when generating the methods of a struct type, we don't accidentally emit an

[committed] d: Fix internal compiler error: Segmentation fault at gimple-expr.cc:88

2022-08-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE in the middle-end caused by the D front-end's code generation for the special enum representing native complex types. Because complex types are deprecated in the language, the new way to expose native complex types is by defining an enum with a basetype of a

[committed] d: Build internal TypeInfo types when module name is "object"

2022-08-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch is a fix-up for a previous change in r13-1070. If for whatever reason the module declaration doesn't exist in the object file, ensure that the internal definitions for TypeInfo and TypeInfo_Class are still created, otherwise an ICE could occur later if they are required for a

[committed] d: Field names of anonymous delegates should be same as regular delegate types.

2022-08-15 Thread Iain Buclaw via Gcc-patches
Hi, This patch adjusts the field names of delegate csts constructed inline. Doesn't change anything in the code generation or ABI, but makes it consistent with regular delegates as names would match up when inspecting tree dumps. Regression tested on x86_64-linux-gnu and committed to mainline.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2022-06-29 Thread Iain Buclaw via Gcc-patches
Hi, Casting from vector to static array is permitted in the D, and the front-end generates a reinterpret cast, but casting back the other way resulted in an error. This has been fixed to be properly handled in the code generation pass of VectorExp, and the conversion for lvalue and rvalue

[committed] d: Fix build on aarch64-suse-linux

2022-06-29 Thread Iain Buclaw via Gcc-patches
Hi, The variables being used to get the result out of TYPE_VECTOR_SUBPARTS were being flagged by -Werror=maybe-uninitialized. As they have already been checked for being constant earlier, use `to_constant' instead. This patch is based on feedback from Andreas. Given the error they got, this

Re: [committed] d: Add SIMD intrinsics module and compiler built-ins.

2022-06-29 Thread Iain Buclaw via Gcc-patches
Excerpts from Andreas Schwab's message of Juni 29, 2022 12:09 pm: > make[3]: Entering directory '/opt/gcc/gcc-20220629/Build/gcc' > /opt/gcc/gcc-20220629/Build/./prev-gcc/xg++ > -B/opt/gcc/gcc-20220629/Build/./prev-gcc/ -B/usr/aarch64-suse-linux/bin/ > -nostdinc++ >

[committed] d: Add SIMD intrinsics module and compiler built-ins.

2022-06-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds a SIMD intrinsics module, and compiler intrinsics. Vectors in D are exposed by the use of the `__vector(T[N])' type, and whilst most unary and binary operations work as you'd expect, there are some operations that are not possible without doing the operation unrolled, or

[committed] d: Use create_tmp_var_raw and get_callee_fndecl

2022-06-28 Thread Iain Buclaw via Gcc-patches
Hi, A couple of small patterns that repeat are generating a temporary, and getting a function out of a CALL_EXPR (there are other changes that are in the works where I ended up adding more repeats of these patterns). There are convenience functions for these in the common parts of gcc, use them

[committed] d: Add @simd and @simd_clones attributes to compiler and library

2022-06-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds a `@simd' attribute to the D front-end, which is equivalent to `__attribute__((simd))', and `@simd_clones' is a convenience alias to allow specifying whether the compiler should generated masked or non-masked simd clones. Bootstrapped and regression tested on

[committed] d: Give consistent error message when attribute argument not a string constant

2022-06-24 Thread Iain Buclaw via Gcc-patches
Hi, This patch adjusts all the "not a string" errors in the D attribute handlers to use the same format string for consistency. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * d-attribs.cc

[committed] d: Add `@register' attribute to compiler and library (PR105413)

2022-06-24 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds a new `@register' attribute to the D compiler and library. Addressing a feature request in PR105413. The `@register` attribute specifies that a local or `__gshared` variable is to be given a register storage-class in the C sense of the term, and will be placed into a

[committed] d: Construct indexes of ARRAY_TYPE using ARRAY_REF.

2022-06-24 Thread Iain Buclaw via Gcc-patches
Hi, This patch changes the D front-end code generation of index expressions to use an ARRAY_REF when the array expression is a ARRAY_TYPE. This is a small simplification over `((T *))[index]', which also allows eliding an unneccesary marking of TREE_ADDRESSABLE when the array expression is a

  1   2   3   4   5   6   >