Re: [PATCH] [testsuite] [ppc] expect vectorization in gen-vect-11c.c

2023-04-05 Thread Kewen.Lin via Gcc-patches
Hi Alexandre, on 2023/4/6 13:20, Alexandre Oliva wrote: > Hello, Kewen, > > On Mar 27, 2023, "Kewen.Lin" wrote: > >> on 2023/3/25 16:35, Alexandre Oliva wrote: > >>> The first loop in main gets stores "vectorized" on powerpc into >>> full-word stores, even without any vector instruction suppor

[PATCH] c++, coroutines: Fix block nests when the function has no top-level bind.

2023-04-05 Thread Iain Sandoe via Gcc-patches
I spotted this problem while trying to collate my WIP patches (sorry for not spotting it when the original patch was discussed). Although we do not yet have any regression filed against this (AFAIK), it's only a matter of time - so I'd suggest that we should apply to 13. Tested on x86_64-darwin2

[PATCH 5/5] RISC-V: Add ZCMP push/pop testcases.

2023-04-05 Thread Jiawei
Add Zcmp extension testcases, zcmpe means Zcmp with RVE extension. Co-Authored by: Nandni Jamnadas Co-Authored by: Yulong Shi Co-Authored by: Shihua Liao Co-Authored by: Sinan Lin gcc/testsuite/ChangeLog: * gcc.target/riscv/zc-zcmp-push-pop-1.c: New test. * gcc.target/riscv/z

[PATCH 1/5] RISC-V: Minimal support for ZC extensions.

2023-04-05 Thread Jiawei
This patch is the minimal support for ZC* extensions, include the extension name, mask and target defination. Also define the dependencies with Zca and Zce extension. Notes that all ZC* extensions depend on the Zca extension. Zce includes all relevant ZC* extensions for microcontrollers using. Zce

[PATCH 4/5] RISC-V: Add Zcmp extension supports.

2023-04-05 Thread Jiawei
Add Zcmp extension instructions support. Generate push/pop with follow steps: 1. preprocessing: 1.1. if there is no push rtx, then just return. e.g. (note 5 1 22 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn/f 22 5 23 2 (set (reg/f:SI 2 sp) (plus:SI (reg/f:SI 2 sp) (const_int -

[PATCH 0/5] RISC-V: Support ZC* extensions.

2023-04-05 Thread Jiawei
RISC-V Code Size Reduction(ZC*) extensions is a group of extensions which define subsets of the existing C extension (Zca, Zcd, Zcf) and new extensions(Zcb, Zcmp, Zcmt) which only contain 16-bit encodings.[1] The implementation of the RISC-V Code Size Reduction extension in GCC is an important st

[PATCH 3/5] RISC-V: Add ZC* test for march args being passed.

2023-04-05 Thread Jiawei
From: Charlie Keaney Add all ZC* extensions march args tests. Co-Authored by: Nandni Jamnadas Co-Authored by: Jiawei Co-Authored by: Mary Bennett Co-Authored by: Simon Cook gcc/testsuite/ChangeLog: * gcc.target/riscv/arch-20.c: New test. * gcc.target/riscv/arch-21.c: New te

[PATCH 2/5] RISC-V: Enable compressible features when use ZC* extensions.

2023-04-05 Thread Jiawei
This patch enables the compressible features with ZC* extensions. Since all ZC* extension depends on the Zca extension, it's sufficient to only add the target Zca to extend the target RVC. Co-Authored by: Mary Bennett Co-Authored by: Nandni Jamnadas Co-Authored by: Simon Cook gcc/ChangeLog:

[PATCH] [testsuite] [ppc] skip ppc-fortran if fortran is disabled

2023-04-05 Thread Alexandre Oliva via Gcc-patches
Skip ppc-fortran.exp if a trivial fortran program cannot be compiled. Regstrapped on x86_64-linux-gnu and ppc64-linux-gnu. Also tested on ppc64-vx7r2 with gcc-12, with the Fortran language disabled. Ok to install? for gcc/testsuite/ChangeLog * gcc.target/powerpc/ppc-fortran/ppc-for

Re: [PATCH] [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double

2023-04-05 Thread Kewen.Lin via Gcc-patches
Hi Alexandre, on 2023/4/6 12:43, Alexandre Oliva wrote: > Hello, Kewen, > > Thanks for the feedback. > > On Mar 27, 2023, "Kewen.Lin" wrote: > >> on 2023/3/25 16:37, Alexandre Oliva via Gcc-patches wrote: >>> >>> When long double is 64-bit wide, as on vxworks, the rs6000 backend >>> defines ne

[PATCHv3, rs6000] rs6000: correct vector sign extend built-ins on Big Endian [PR108812]

2023-04-05 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch removes byte reverse operation before vector integer sign extension on big endian. These built-ins require to sign extend the element of the input vector that would fall in the least significant portion of the result element. So both BE and LE should do the same operation and the b

Re: [PATCH] [testsuite] [ppc] expect vectorization in gen-vect-11c.c

2023-04-05 Thread Alexandre Oliva via Gcc-patches
Hello, Kewen, On Mar 27, 2023, "Kewen.Lin" wrote: > on 2023/3/25 16:35, Alexandre Oliva wrote: >> The first loop in main gets stores "vectorized" on powerpc into >> full-word stores, even without any vector instruction support, so the >> test's expectation of no loop vectorization is not met.

RE: [PATCH] Check hard_regno_mode_ok before setting lowest memory move cost for the mode with different reg classes.

2023-04-05 Thread Liu, Hongtao via Gcc-patches
> -Original Message- > From: Vladimir Makarov > Sent: Wednesday, April 5, 2023 8:59 PM > To: Jeff Law ; Liu, Hongtao > ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH] Check hard_regno_mode_ok before setting lowest > memory move cost for the mode with different reg classes. > > > On 4/

Re: [PATCH] [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double

2023-04-05 Thread Alexandre Oliva via Gcc-patches
Hello, Kewen, Thanks for the feedback. On Mar 27, 2023, "Kewen.Lin" wrote: > on 2023/3/25 16:37, Alexandre Oliva via Gcc-patches wrote: >> >> When long double is 64-bit wide, as on vxworks, the rs6000 backend >> defines neither the __ibm128 type nor the __SIZEOF_IBM128__ macro, but >> pr99708.

[PATCH] Fix typo in -param=vect-induction-float= attributes

2023-04-05 Thread Andrew Pinski via Gcc-patches
There was a typo in the attributes of the option -param=vect-induction-float= for IntegerRange. This fixes that typo. Committed to GCC 12 branch as obvious after a build/test. gcc/ChangeLog: PR tree-optimization/109427 * params.opt (-param=vect-induction-float=): Fix opti

[PATCH] Fix typo in -param=vect-induction-float= attributes

2023-04-05 Thread Andrew Pinski via Gcc-patches
There was a typo in the attributes of the option -param=vect-induction-float= for IntegerRange. This fixes that typo. Committed as obvious after a build/test. gcc/ChangeLog: PR tree-optimization/109427 * params.opt (-param=vect-induction-float=): Fix option attribute typo

Re: Re: [PATCH v2] RISC-V: Add Z*inx imcompatible check in gcc.

2023-04-05 Thread jiawei
> -原始邮件- > 发件人: "Jeff Law" > 发送时间: 2023-04-05 09:30:43 (星期三) > 收件人: "Hans-Peter Nilsson" , Jiawei > 抄送: gcc-patches@gcc.gnu.org, kito.ch...@sifive.com, pal...@dabbelt.com, christoph.muell...@vrull.eu, wuwei2...@iscas.ac.cn > 主题: Re: [PATCH v2] RISC-V: Add Z*inx imcompatible check in g

Re: 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899]

2023-04-05 Thread Alexandre Oliva via Gcc-patches
On Apr 5, 2023, Thomas Schwinge wrote: > Given the two "OK"s that you got end of last week, are you going to push > that anytime soon, please? Apologies for the delay. > With... > Co-authored-by: Thomas Schwinge > ... added, I suppose. I wrote the patch based on your report, before eve

Re: [PATCH 0/2] Support Intel AMX-COMPLEX

2023-04-05 Thread Hongtao Liu via Gcc-patches
On Mon, Apr 3, 2023 at 4:51 PM Haochen Jiang via Gcc-patches wrote: > > Hi all, > > These patch aims to add Intel AMX-COMPLEX instructions. Also we added > AMX-COMPLEX to -march=graniterapids. > > The information is based on newly released > Intel Architecture Instruction Set Extensions and Future

Re: [PATCH] Introduce -nolibstdc++ option

2023-04-05 Thread Alexandre Oliva via Gcc-patches
On Mar 30, 2023, Gerald Pfeifer wrote: > On Thu, 30 Mar 2023, Alexandre Oliva wrote: >> How about this, does this seem useful? > I like it - helpful and easy to understand. :-) 'k, I'm putting it in, thanks On Mar 30, 2023, Arsen Arsenović wrote: > IMO, yes - in fact, the libstdc++ manual e

Re: [PATCH] PR tree-optimization/109417 - Check if dependency is valid before using in may_recompute_p.

2023-04-05 Thread Jeff Law via Gcc-patches
On 4/5/23 14:10, Andrew MacLeod via Gcc-patches wrote: When a statement is first processed, any SSA_NAMEs that are dependencies are cached for quick future access. if we ;later rewrite the statement (say propagate a constant into it), its possible the ssa-name in this cache is no longer act

Ping^7: [PATCH] jit: Install jit headers in $(libsubincludedir) [PR 101491]

2023-04-05 Thread Lorenzo Salvadore via Gcc-patches
Hello, Ping https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606450.html Thanks, Lorenzo Salvadore > From f8e2c2ee89a7d8741bb65163d1f1c20edcd546ac Mon Sep 17 00:00:00 2001 > From: Lorenzo Salvadore develo...@lorenzosalvadore.it > > Date: Wed, 16 Nov 2022 11:27:38 +0100 > Subject: [PATCH

[PATCH v2 8/8] RISCV: Weaken mem_thread_fence

2023-04-05 Thread Patrick O'Neill
This change brings atomic fences in line with table A.6 of the ISA manual. Relax mem_thread_fence according to the memmodel given. 2023-04-05 Patrick O'Neill * riscv.cc: Expose helper functions to sync.md. * riscv-protos.h: Likewise. * sync.md (mem_thread_fence_1): Chang

[PATCH v2 7/8] RISCV: Weaken atomic stores

2023-04-05 Thread Patrick O'Neill
This change brings atomic stores in line with table A.6 of the ISA manual. 2023-04-05 Patrick O'Neill PR target/89835 * sync.md (atomic_store): Use simple store instruction in combination with a fence. * pr89835.c: New test. Signed-off-by: Patrick O'Neill

[PATCH v2 3/8] RISCV: Enforce atomic compare_exchange SEQ_CST

2023-04-05 Thread Patrick O'Neill
This patch enforces SEQ_CST for atomic compare_exchange ops. Replace Fence/LR.aq/SC.aq pairs with strong SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2023-04-05 Patrick O'Neill * sync.md: Change FENCE/LR.aq/SC.aq into sequentially consistent LR.aqrl/SC

[PATCH v2 2/8] RISCV: Enforce Libatomic LR/SC SEQ_CST

2023-04-05 Thread Patrick O'Neill
Replace LR.aq/SC.rl pairs with the SEQ_CST LR.aqrl/SC.rl pairs recommended by table A.6 of the ISA manual. 2023-04-05 Patrick O'Neill * atomic.c: Change LR.aq/SC.rl pairs into sequentially consistent LR.aqrl/SC.rl pair. Signed-off-by: Patrick O'Neill --- libgcc/config/riscv/at

[PATCH v2 6/8] RISCV: Weaken compare_exchange LR/SC pairs

2023-04-05 Thread Patrick O'Neill
Introduce the %I and %J flags for setting the .aqrl bits on LR/SC pairs as needed. Atomic compare and exchange ops provide success and failure memory models. C++17 and later place no restrictions on the relative strength of each model, so ensure we cover both by using a model that enforces the ord

[PATCH v2 5/8] RISCV: Eliminate AMO op fences

2023-04-05 Thread Patrick O'Neill
Atomic operations with the appropriate bits set already enfore release semantics. Remove unnecessary release fences from atomic ops. This change brings AMO ops in line with table A.6 of the ISA manual. 2023-04-05 Patrick O'Neill * riscv.cc (riscv_memmodel_needs_amo_acquire): Change func

[PATCH v2 4/8] RISCV: Add AMO release bits

2023-04-05 Thread Patrick O'Neill
This patch sets the relevant .rl bits on amo operations. 2023-04-05 Patrick O'Neill * riscv.cc (riscv_print_operand): change behavior of %A to include release bits. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/riscv.cc | 7 ++- 1 file changed, 6 insertions(+), 1 del

[PATCH v2 1/8] RISCV: Eliminate SYNC memory models

2023-04-05 Thread Patrick O'Neill
Remove references to MEMMODEL_SYNC_* models by converting via memmodel_base(). 2023-04-05 Patrick O'Neill * atomic.c: Remove MEMMODEL_SYNC_* cases and sanitize memmodel input with memmodel_base Signed-off-by: Patrick O'Neill --- gcc/config/riscv/riscv.cc | 11 +++ 1 f

[PATCH v2 0/8] RISCV: Implement ISA Manual Table A.6 Mappings

2023-04-05 Thread Patrick O'Neill
This patchset aims to bring the RISCV atomics implementation in line with the recommended mapping present in table A.6 of the ISA manual. https://github.com/riscv/riscv-isa-manual/blob/c7cf84547b3aefacab5463add1734c1602b67a49/src/memory.tex#L1083-L1157 The current mapping in GCC is not internal

Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Paul Richard Thomas via Gcc-patches
Hi Harald, Quite right - good spot. There was an 'else' that turned out to be unnecessary. Thanks Paul On Wed, 5 Apr 2023 at 19:50, Harald Anlauf wrote: > Hi Paul, > > On 4/5/23 08:53, Paul Richard Thomas via Gcc-patches wrote: > > Hi All, > > > > This is a first in my recent experience - a

Re: [PATCH] c++: satisfaction and ARGUMENT_PACK_SELECT [PR105644]

2023-04-05 Thread Patrick Palka via Gcc-patches
On Mon, 3 Apr 2023, Jason Merrill wrote: > On 4/3/23 10:49, Patrick Palka wrote: > > This testcase demonstrates we can legitimately enter satisfaction with > > an ARGUMENT_PACK_SELECT argument, which is problematic because we can't > > store such arguments in the satisfaction cache (or any other h

[PATCH] PR tree-optimization/109417 - Check if dependency is valid before using in may_recompute_p.

2023-04-05 Thread Andrew MacLeod via Gcc-patches
When a statement is first processed, any SSA_NAMEs that are dependencies are cached for quick future access. if we ;later rewrite the statement (say propagate a constant into it), its possible the ssa-name in this cache is no longer active.   Normally this is not a problem, but the changed to

Re: [RFA][Bug target/108892 ][13 regression] Force re-recognition after changing RTL structure of an insn

2023-04-05 Thread Segher Boessenkool
Hi again, On Wed, Apr 05, 2023 at 11:43:30AM -0600, Jeff Law wrote: > On 4/5/23 11:38, Segher Boessenkool wrote: > >Right. But it seems to me it has been there all those years? Does the > >new testcase fail on older branches? Even if not, it seems clear it is > >wrong on the older branches as w

Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Harald Anlauf via Gcc-patches
On 4/5/23 20:50, Harald Anlauf via Gcc-patches wrote: can you have a look again at the logic in the hunk touching trans-stmt.cc (gfc_trans_allocate)?  I haven't checked in detail, but it seems possible that you get a stale tmp in the gfc_prepend_expr_to_block if (code->ext.alloc.expr3_not_explici

Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Harald Anlauf via Gcc-patches
Hi Paul, On 4/5/23 08:53, Paul Richard Thomas via Gcc-patches wrote: Hi All, This is a first in my recent experience - a very old bug that produces too many finalizations! It results from a bit of a fix up, where class objects are allocated using the derived typespec, rather than a source or mo

Re: [RFA][Bug target/108892 ][13 regression] Force re-recognition after changing RTL structure of an insn

2023-04-05 Thread Jeff Law
On 4/5/23 11:38, Segher Boessenkool wrote: On Wed, Apr 05, 2023 at 09:07:30AM -0600, Jeff Law wrote: On 4/5/23 08:21, Segher Boessenkool wrote: On Wed, Mar 29, 2023 at 07:48:00AM -0600, Jeff Law wrote: So as mentioned in the PR the underlying issue here is combine changes the form of an exi

Re: [RFA][Bug target/108892 ][13 regression] Force re-recognition after changing RTL structure of an insn

2023-04-05 Thread Segher Boessenkool
On Wed, Apr 05, 2023 at 09:07:30AM -0600, Jeff Law wrote: > On 4/5/23 08:21, Segher Boessenkool wrote: > >On Wed, Mar 29, 2023 at 07:48:00AM -0600, Jeff Law wrote: > >>So as mentioned in the PR the underlying issue here is combine changes > >>the form of an existing insn, but fails to force re-reco

Re: [PATCH] c++: 'typename T::X' vs 'struct T::X' lookup [PR109420]

2023-04-05 Thread Andrew Pinski via Gcc-patches
On Wed, Apr 5, 2023 at 10:32 AM Patrick Palka via Gcc-patches wrote: > > On Wed, 5 Apr 2023, Patrick Palka wrote: > > > r13-6098-g46711ff8e60d64 made make_typename_type no longer ignore > > non-types during the lookup, unless the TYPENAME_TYPE in question was > > followed by the :: scope resolutio

Re: [PATCH] c++: 'typename T::X' vs 'struct T::X' lookup [PR109420]

2023-04-05 Thread Patrick Palka via Gcc-patches
On Wed, 5 Apr 2023, Patrick Palka wrote: > r13-6098-g46711ff8e60d64 made make_typename_type no longer ignore > non-types during the lookup, unless the TYPENAME_TYPE in question was > followed by the :: scope resolution operator. But there is another > exception to this rule: we need to ignore non

Re: [PATCH] dse: Handle SUBREGs of word REGs differently for WORD_REGISTER_OPERATIONS targets [PR109040]

2023-04-05 Thread Jeff Law via Gcc-patches
On 4/5/23 10:48, Jakub Jelinek wrote: On Wed, Apr 05, 2023 at 10:17:59AM -0600, Jeff Law wrote: It is true that an instruction like (insn 8 7 9 2 (set (reg:HI 141) (subreg:HI (reg:SI 142) 0)) "aauu.c":6:18 181 {*movhi_internal} (nil)) can appear in the IL on WORD_REGISTER_OPE

[PATCH] c++: 'typename T::X' vs 'struct T::X' lookup [PR109420]

2023-04-05 Thread Patrick Palka via Gcc-patches
r13-6098-g46711ff8e60d64 made make_typename_type no longer ignore non-types during the lookup, unless the TYPENAME_TYPE in question was followed by the :: scope resolution operator. But there is another exception to this rule: we need to ignore non-types during the lookup also if the TYPENAME_TYPE

Ping: [PATCH, V3] PR target/105325, Make load/cmp fusion know about prefixed loads

2023-04-05 Thread Michael Meissner via Gcc-patches
Ping patch: | Date: Mon, 27 Mar 2023 23:19:55 -0400 | From: Michael Meissner | Subject: [PATCH, V3] PR target/105325, Make load/cmp fusion know about prefixed loads | Message-ID: -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: meiss...@linux.ibm.com

Re: [PATCH] dse: Handle SUBREGs of word REGs differently for WORD_REGISTER_OPERATIONS targets [PR109040]

2023-04-05 Thread Jakub Jelinek via Gcc-patches
On Wed, Apr 05, 2023 at 10:17:59AM -0600, Jeff Law wrote: > > It is true that an instruction like > > (insn 8 7 9 2 (set (reg:HI 141) > > (subreg:HI (reg:SI 142) 0)) "aauu.c":6:18 181 {*movhi_internal} > > (nil)) > > can appear in the IL on WORD_REGISTER_OPERATIONS target, but I thin

Re: [PATCH] dse: Handle SUBREGs of word REGs differently for WORD_REGISTER_OPERATIONS targets [PR109040]

2023-04-05 Thread Jeff Law via Gcc-patches
On 4/5/23 08:51, Jakub Jelinek wrote: On Wed, Apr 05, 2023 at 07:14:23AM -0600, Jeff Law wrote: The following testcase is miscompiled on riscv since the addition of *mvconst_internal define_insn_and_split. I believe the bug is in DSE. We have: (insn 36 35 39 2 (set (mem/c:SI (plus:SI (reg/f:

[committed] hppa: Fix 22_locale/locale/cons/12658_thread-2.cc on hppa

2023-04-05 Thread John David Anglin
Committed to trunk. Dave --- Fix 22_locale/locale/cons/12658_thread-2.cc on hppa. 2023-04-05 John David Anglin libstdc++-v3/ChangeLog: * testsuite/22_locale/locale/cons/12658_thread-2.cc: Double timeout factor on hppa*-*-*. diff --git a/libstdc++-v3/testsuite/22_locale/loca

Re: [RFA][Bug target/108892 ][13 regression] Force re-recognition after changing RTL structure of an insn

2023-04-05 Thread Jeff Law
On 4/5/23 08:21, Segher Boessenkool wrote: Hi! On Wed, Mar 29, 2023 at 07:48:00AM -0600, Jeff Law wrote: So as mentioned in the PR the underlying issue here is combine changes the form of an existing insn, but fails to force re-recognition. As a result other parts of the compiler blow up.

[committed] hppa: Add assember CFI directives to millicode division and remainder routines

2023-04-05 Thread John David Anglin
Committed to trunk after testing on hppa-unknown-linux-gnu. Dave --- Add assember CFI directives to millicode division and remainder routines. The millicode division and remainder routines trap division by zero. The unwinder needs these directives to unwind divide by zero traps. 2023-04-05 Joh

Re: [PATCH] dse: Handle SUBREGs of word REGs differently for WORD_REGISTER_OPERATIONS targets [PR109040]

2023-04-05 Thread Jakub Jelinek via Gcc-patches
On Wed, Apr 05, 2023 at 07:14:23AM -0600, Jeff Law wrote: > > The following testcase is miscompiled on riscv since the addition > > of *mvconst_internal define_insn_and_split. > > I believe the bug is in DSE. We have: > > (insn 36 35 39 2 (set (mem/c:SI (plus:SI (reg/f:SI 65 frame) > >

Re: [RFA][Bug target/108892 ][13 regression] Force re-recognition after changing RTL structure of an insn

2023-04-05 Thread Segher Boessenkool
Hi! On Wed, Mar 29, 2023 at 07:48:00AM -0600, Jeff Law wrote: > So as mentioned in the PR the underlying issue here is combine changes > the form of an existing insn, but fails to force re-recognition. As a > result other parts of the compiler blow up. [snip] > The fix is trivial, reset the I

[committed 86/88] gccrs: Added AST Node AST::InlineAsm

2023-04-05 Thread arthur . cohen
From: M V V S Manoj Kumar Addresses #1567 Created a AST node InlineAsm similar to the one found in rustc. As there is no Symbol struct/class in gccrs I have made every instance of Symbol a string. gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.

[committed 88/88] gccrs: Fix issue with parsing unsafe block expression statements

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_stmt): Handle unsafe expression statements. gcc/testsuite/ChangeLog: * rust/compile/issue-1422.rs: New test. Signed-off-by: Owen Avery --- gcc/rust/parse/rust-parse-impl.h | 10

[committed 83/88] gccrs: add test case to show our query-type system is working

2023-04-05 Thread arthur . cohen
From: Philip Herron Fixes #1361 Signed-off-by: Philip Herron gcc/testsuite/ChangeLog: * rust/compile/issue-1361.rs: New test. --- gcc/testsuite/rust/compile/issue-1361.rs | 8 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/rust/compile/issue-1361.rs diff

[committed 87/88] gccrs: Address unsafe with/without block handling ambiguity

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling. Signed-off-by: Owen Avery --- gcc/rust/parse/rust-parse-impl.h | 15 +++ 1 file changed, 3 insertions(+), 12 de

[committed 75/88] gccrs: Support for Sized builtin marker trait

2023-04-05 Thread arthur . cohen
From: Philip Herron When implementing general bounds checking as part of unify calls, we did not check associated types on bounds which lead to alot of missed error checking. This now recursively checks the bounds and the associated types with a decent error message. This also required us to impl

[committed 82/88] gccrs: rename rust-hir-full-tests.cc

2023-04-05 Thread arthur . cohen
From: SainiAditya1 gcc/rust/Changelog: * hir/tree/rust-hir-full-test.cc: Moved to... * hir/tree/rust-hir.cc: ...here. * Make-lang.in: Rename rust-hir-full-test. Signed-off-by: SainiAditya1 --- gcc/rust/Make-lang.in| 2 +- gcc/rust/hi

[committed 85/88] gccrs: diagnostic: Refactor Error class

2023-04-05 Thread arthur . cohen
From: Arthur Cohen The class now allows for more variants including a `Hint` one which then gets emitted by calling `rust_inform`. This allows us to display hints/tips/notes in backtracking contexts such as the parser. gcc/rust/ChangeLog: * rust-diagnostics.h (struct Error): Add new Kin

[committed 79/88] gccrs: Fix formatting

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-pattern.h: Fix formatting. Signed-off-by: Owen Avery --- gcc/rust/ast/rust-pattern.h | 70 ++--- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/r

[committed 80/88] gccrs: Add AST::AltPattern class

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add AltPattern visitor. * ast/rust-ast-dump.h: (Dump::visit): Add AltPattern visitor. * ast/rust-ast-full-decls.h (class AltPattern): Add declaration. * ast/rust-ast

[committed 84/88] gccrs: ast: Refactor TraitItem to keep Location info

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast.h: Keep location in TraitItem base class * ast/rust-item.h (class TraitItemFunc): Use base class location instead. (class TraitItemMethod): Likewise. (class TraitItemConst): Likewise. (class TraitItemT

[committed 76/88] gccrs: Fix regression in testcase

2023-04-05 Thread arthur . cohen
From: Philip Herron Fixes #776 Signed-off-by: Philip Herron gcc/testsuite/ChangeLog: * rust/compile/torture/traits10.rs: Fix test-case --- .../rust/compile/torture/traits10.rs | 64 ++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/gcc/testsu

[committed 77/88] gccrs: Add trailing newline

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.h: Add trailing newline before EOF. Signed-off-by: Owen Avery --- gcc/rust/checks/errors/rust-feature-gate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/checks/errors/rust-feature-g

[committed 78/88] gccrs: builtins: Return empty list of tokens instead of nullptr

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not return nullptr token in expansion of `include!()` gcc/testsuite/ChangeLog: * rust/compile/empty.in: New test. * rust/compile/include_empty.rs: New test

[committed 73/88] gccrs: Extract query_type from TypeCheckBase to be a simple extern

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * Make-lang.in: add new dependancy * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor * typecheck/rust-hir-type-check-base.h: refactor * typecheck/rust-hir-type-chec

[committed 72/88] gccrs: Implemented UTF-8 checking for include_str!()

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * expand/rust-macro-builtins.cc (MacroBuiltin::include_str_handler): Add check for valid UTF-8. gcc/testsuite/ChangeLog: * rust/compile/builtin_macro_include_str.rs: Include test of invalid UTF-8. * rust/compile/inval

[committed 68/88] gccrs: Simplify WildcardPattern let statement handling

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * backend/rust-compile-pattern.cc (CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements. * backend/rust-compile-var-decl.h: (CompileVarDecl::visit): Remove variable declaration for WildcardPatter

[committed 71/88] gccrs: Add support for parsing empty tuple patterns.

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns. gcc/testsuite/ChangeLog: * rust/compile/parse_empty_tuple_pattern.rs: New test. Signed-off-by: Owen Avery --- gcc/rust/pars

[committed 67/88] gccrs: Add test

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/variadic.rs: New test. Signed-off-by: Owen Avery --- gcc/testsuite/rust/compile/variadic.rs | 8 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/rust/compile/variadic.rs diff --git a/gcc/testsuite/rus

[committed 65/88] gccrs: Add feature gate for "rust-intrinsic".

2023-04-05 Thread arthur . cohen
From: mxlol233 This commit implemented a feature gate to check `intrinsics`. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc: Add implementation for `void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature` construction process in `FeatureGate::ch

[committed 64/88] gccrs: Update copyright years.

2023-04-05 Thread arthur . cohen
From: Thomas Schwinge gcc/rust/ChangeLog: * ast/rust-ast-fragment.cc: Update copyright years. * ast/rust-ast-fragment.h: Likewise. * ast/rust-macro.cc: Likewise. * checks/errors/rust-feature-gate.cc: Likewise. * checks/errors/rust-feature-gate.h: Likewise.

[committed 63/88] gccrs: cli: Update safety warning message

2023-04-05 Thread arthur . cohen
From: Pierre-Emmanuel Patry The compiler's warning message about the safety flag did not match cargo-gccrs environment variable name anymore. gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Update the environment variable name. Signed-off-by: Pierre-Emma

[committed 60/88] gccrs: macros: Perform macro expansion in a fixed-point fashion.

2023-04-05 Thread arthur . cohen
From: Arthur Cohen This commit changes our macro expansion system from an eager and recursive macro expansion to a fixed-point like system. Instead of, when seeing a macro invocation, expanding it and all of the macros within it, we now perform multiple passes of expansion on the entire crate. T

[committed 62/88] gccrs: typecheck: Refactor rust-hir-trait-reference.h

2023-04-05 Thread arthur . cohen
From: Pierre-Emmanuel Patry Move function body to their own cc file instead of keeping them in the header file. gcc/rust/ChangeLog: * Make-lang.in: Add `rust-hir-trait-reference.o`. * typecheck/rust-hir-trait-reference.h: Remove multiple function body. * typecheck/rust-h

[committed 57/88] gccrs: rust-item: include rust-expr.h

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-item.h (class BlockExpr): Remove forward declaration of class `BlockExpr`. --- gcc/rust/ast/rust-item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index

[committed 59/88] gccrs: expansion: Add `get_token_slice` to `MacroInvocLexer` class

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-invoc-lexer.cc (MacroInvocLexer::get_token_slice): Add API to retrieve token slices when lexing macro expansions. * expand/rust-macro-invoc-lexer.h: Declare `get_token_slice`. --- gcc/rust/expand/rust-macro-invoc

[committed 81/88] gccrs: Fix up DejaGnu directives in 'rust/compile/issue-1830_{bytes, str}.rs' test cases [#1838]

2023-04-05 Thread arthur . cohen
From: Thomas Schwinge 'dg-excess-errors' "indicates that the test is expected to fail due to compiler messages that are not handled by 'dg-error', [etc.]". It's argument doesn't specify the message to match but just just a comment. Here, however, we'd like to match specific compiler messages, s

[committed 58/88] gccrs: parser: Expose parse_macro_invocation as public API

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * parse/rust-parse.h: Move `parse_macro_invocation` to public API. --- gcc/rust/parse/rust-parse.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 2f767bb2a53..

[committed 55/88] gccrs: Add general TypeBounds checks

2023-04-05 Thread arthur . cohen
From: Philip Herron Existing tests are updated to use libcore copy and clone implementation. Addresses #1725 Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-unify.cc (UnifyRules::go): ensure the bounds are checked gcc/testsuite/ChangeLog: * rust/compile/t

[committed 50/88] gccrs: Refactor the type unification code

2023-04-05 Thread arthur . cohen
From: Philip Herron This refactors the unification systems to be a consistent interface using switch statements and simple functions instead of the old clunky visitor system. This is more maintainable as it is harder to miss cases when we can take advantages of switch statements. Signed-off-by:

[committed 74/88] gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * hir/tree/rust-hir-item.h: implement virtual function * hir/tree/rust-hir.h: add virtual function --- gcc/rust/hir/tree/rust-hir-item.h | 17 - gcc/rust/hir/tree/rust-hir.h | 2 ++ 2 fi

[committed 56/88] gccrs: Add support for TuplePattern in let statements

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * hir/tree/rust-hir-pattern.h (TuplePatternItemsRanged::get_lower_patterns): Add method. (TuplePatternItemsRanged::get_upper_patterns): Add method. * backend/rust-compile-pattern.cc (CompilePatternLet::visit): Implement

[committed 48/88] gccrs: Add missing param subst callback

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.cc: add missing callback --- gcc/rust/typecheck/rust-tyty-subst.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/typecheck/rust-tyty-subst.cc b/gcc/rust/typecheck/rust-tyty

[committed 54/88] gccrs: Remove bad error message on checking function arguments

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove error message gcc/testsuite/ChangeLog: * rust/compile/func3.rs: update test case --- gcc/rust/typecheck/rust-tyty-call.cc | 5 - gcc/tes

[committed 70/88] gccrs: testsuite: Add empty string macro test

2023-04-05 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add two new tests with empty string for include_str and include_bytes macros. gcc/testsuite/ChangeLog: * rust/compile/issue-1830_bytes.rs: New test. * rust/compile/issue-1830_str.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/

[committed 53/88] gccrs: Fix higher ranked trait bounds computation of self

2023-04-05 Thread arthur . cohen
From: Philip Herron This updates the higher ranked trait bounds computation to handle ambigious cases. When we have a slice for example: let slice = &a[1..3]; This works by reusing the Index operator overload from libcore, so when the index range of 1..3 is computed, the type system needs to

[committed 45/88] gccrs: Rename header rust-hir-trait-ref.h to rust-hir-trait-reference.h

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-trait-ref.h: Moved to... * typecheck/rust-hir-trait-reference.h: ...here. * typecheck/rust-hir-trait-resolve.cc: refactor * typecheck/rust-hir-trait-resolve.h (RUST_HIR_TRA

[committed 69/88] gccrs: lex: Prevent directories in RAIIFile

2023-04-05 Thread arthur . cohen
From: Pierre-Emmanuel Patry RAIIFile constructor was accepting directory filename. This lead to unattended directory opening in some part of the code (load_file_bytes) wich resulted in ice. Since RAIIFile are used for the lexer, removing the ability to open directories with RAIIFile fixes those i

[committed 43/88] gccrs: Refactor all code out of the rust-tyty.h header

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-type-check.h: refactor * typecheck/rust-tyctx.cc (TypeCheckContext::iterate): refactor (TypeCheckContext::have_loop_context): likewise (TypeCheckContext::push_new_loop_cont

[committed 39/88] gccrs: Refactor all substitution mapper code implementation into its own CC file

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-substitution-mapper.cc (SubstMapper::SubstMapper): refactor (SubstMapper::Resolve): likewise (SubstMapper::InferSubst): likewise (SubstMapper::have_generic_args): likewise

[committed 49/88] gccrs: Remove monomorphization hack to setup possible associated types

2023-04-05 Thread arthur . cohen
From: Philip Herron During CallExpr argument type checking we may be calling a default implementation of a trait function this will require any possible associated types to be resolved and setup. This monomoprhization call does this but it will premtivly do extra unification of types which will t

[committed 66/88] gccrs: Add variadic argument type checking

2023-04-05 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Add variadic argument type checking. (TypeCheckCallExpr::visit): Fix comment spelling ("varadic"). gcc/testsuite/ChangeLog: * rust/execute/torture/overflow1.rs: Fix te

[committed 47/88] gccrs: Clear the substitution callbacks when copying ArgumentMappings

2023-04-05 Thread arthur . cohen
From: Philip Herron When we set the callback on substitutions this is not safe to be copied around since we store the used argument mappings and can reuse them in different contexts. This clears the callback on copy's to make it safer. Signed-off-by: Philip Herron gcc/rust/ChangeLog:

[committed 46/88] gccrs: Refactor handle_substitutions to take a reference

2023-04-05 Thread arthur . cohen
From: Philip Herron This patch changes the recusive substitution code to take a reference instead of a copy. This is important as the callback field is going to be made non-copyable in a future patch and this pipeline is for recursive substitutions so its ok to reuse the same mappings here. Sign

[committed 61/88] gccrs: expander: Add documentation for `expand_eager_invocations`

2023-04-05 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::expand_eager_invocations): Add documentation explaining the algorithm. --- gcc/rust/expand/rust-macro-expand.cc | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git

[committed 41/88] gccrs: Refactor PathProbe into cc file

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-path-probe.cc (PathProbeType::PathProbeType): refactor (PathProbeType::Probe): likewise (PathProbeType::visit): likewise (PathProbeType::process_enum_item_for_candiates):

[committed 44/88] gccrs: Rename rust-tyctx.cc to rust-typecheck-context.cc

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * Make-lang.in: update name * typecheck/rust-tyctx.cc: Moved to... * typecheck/rust-typecheck-context.cc: ...here. --- gcc/rust/Make-lang.in | 2 +- gcc/rust/

[committed 42/88] gccrs: Refactor PathProbeType code into CC file

2023-04-05 Thread arthur . cohen
From: Philip Herron Signed-off-by: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-path-probe.cc (PathProbeCandidate::Candidate::Candidate): refactor (PathProbeCandidate::PathProbeCandidate): likewise (PathProbeCandidate::as_string): likewise (PathProbeC

[committed 35/88] gccrs: Add another test case for passing associated type-bounds

2023-04-05 Thread arthur . cohen
From: Philip Herron This demonstrates that this also works for custom algebraic data types too. gcc/testsuite/ChangeLog: * rust/execute/torture/issue-1720-2.rs: New test. Signed-off-by: Philip Herron --- .../rust/execute/torture/issue-1720-2.rs | 30 +++ 1 file c

[committed 52/88] gccrs: Add missing Sized, Copy and Clone lang item mappings

2023-04-05 Thread arthur . cohen
From: Philip Herron We need these lang items to be defined and later down the line the mappings will be used to implement proper copy and clone logic. Fixes #1786 Signed-off-by: Philip Herron gcc/rust/ChangeLog: * util/rust-lang-item.h: gcc/testsuite/ChangeLog: * rust/compi

  1   2   >