[PATCH] except: Fix __builtin_eh_return_data_regno (-42) expansion [PR101195]

2024-01-30 Thread Jakub Jelinek
Hi! The expansion of this builtin emits an error if the argument is not INTEGER_CST, otherwise uses tree_to_uhwi on the argument (which is declared int) and then uses EH_RETURN_DATA_REGNO macro which on most targets returns INVALID_REGNUM for all values but some small number (2 or 4); if it return

[PATCH] tree-ssa-strlen: Fix up handle_store [PR113603]

2024-01-30 Thread Jakub Jelinek
Hi! Since r10-2101-gb631bdb3c16e85f35d3 handle_store uses count_nonzero_bytes{,_addr} which (more recently limited to statements with the same vuse) can walk earlier statements feeding the rhs of the store and call get_stridx on it. Unlike most of the other functions where get_stridx is called fir

[PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention

2024-01-30 Thread pan2 . li
From: Pan Li According to the issue as below. https://hub.fgit.cf/riscv-non-isa/riscv-elf-psabi-doc/pull/416 When the mode size of vls integer mode is less than 2 * XLEN, we will take the gpr for both the args and the return values. Instead of the reference. For example the below code: typedef

[committed] testsuite: Fix up pr113622-{2,3}.c for i686-linux [PR113622]

2024-01-30 Thread Jakub Jelinek
On Mon, Jan 29, 2024 at 01:05:51PM +0100, Richard Biener wrote: > * gcc.target/i386/pr113622-2.c: New testcase. > * gcc.target/i386/pr113622-3.c: Likewise. The 2 new tests FAIL for me on i686-linux: .../gcc/testsuite/gcc.target/i386/pr113622-2.c:5:14: error: data type of 'a' isn't sui

RE: [PATCH v1] RISC-V: Bugfix for vls integer mode calling convention

2024-01-30 Thread Li, Pan2
Thanks Kito for comments, rebase the upstream and always goes to GPR in V2. https://gcc.gnu.org/pipermail/gcc-patches/2024-January/644291.html Pan -Original Message- From: Kito Cheng Sent: Monday, January 29, 2024 9:23 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai;

Re: [PATCH] except: Fix __builtin_eh_return_data_regno (-42) expansion [PR101195]

2024-01-30 Thread Richard Biener
On Tue, 30 Jan 2024, Jakub Jelinek wrote: > Hi! > > The expansion of this builtin emits an error if the argument is not > INTEGER_CST, otherwise uses tree_to_uhwi on the argument (which is declared > int) and then uses EH_RETURN_DATA_REGNO macro which on most targets returns > INVALID_REGNUM for

Re: [PATCH] tree-ssa-strlen: Fix up handle_store [PR113603]

2024-01-30 Thread Richard Biener
On Tue, 30 Jan 2024, Jakub Jelinek wrote: > Hi! > > Since r10-2101-gb631bdb3c16e85f35d3 handle_store uses > count_nonzero_bytes{,_addr} which (more recently limited to statements > with the same vuse) can walk earlier statements feeding the rhs > of the store and call get_stridx on it. > Unlike m

[PATCH] riscv: Move UNSPEC_XTHEAD* from unspecv to unspec

2024-01-30 Thread Christoph Müllner
The UNSPEC_XTHEAD* macros ended up in the unspecv enum, which broke gcc/testsuite/gcc.target/riscv/xtheadfmv-fmv.c. The INSNs expect these unspecs to be not volatile. Further, there is not reason to have them defined volatile. So let's simply move the macros into the unspec enum. With this patch w

[pushed] aarch64: Handle debug references to removed registers [PR113636]

2024-01-30 Thread Richard Sandiford
In this PR, we entered early-ra with quite a bit of dead code. The code was duly removed (to avoid wasting registers), but there was a dangling reference in debug instructions, which caused an ICE later. Fixed by resetting a debug instruction if it references a register that is no longer needed by

[pushed] aarch64: Avoid allocating FPRs to address registers [PR113623]

2024-01-30 Thread Richard Sandiford
For something like: void foo (void) { int *ptr; asm volatile ("%0" : "=w" (ptr)); asm volatile ("%0" :: "m" (*ptr)); } early-ra would allocate ptr to an FPR for the first asm, thus leaving an FPR address in the second asm. The address was then reloaded by LRA to make it valid. But early-r

Re: [PATCH V2] rs6000: New pass for replacement of adjacent loads fusion (lxv).

2024-01-30 Thread Michael Meissner
On Sun, Jan 21, 2024 at 07:57:54PM +0530, Ajit Agarwal wrote: > > Hello All: > > New pass to replace adjacent memory addresses lxv with lxvp. > Added common infrastructure for load store fusion for > different targets. > > Common routines are refactored in fusion-common.h. > > AARCH64 load/stor

Re: [PATCH] riscv: Move UNSPEC_XTHEAD* from unspecv to unspec

2024-01-30 Thread Kito Cheng
Yeah, that should be put in unspec rather than unspecv, LGTM :) On Tue, Jan 30, 2024 at 5:29 PM Christoph Müllner wrote: > > The UNSPEC_XTHEAD* macros ended up in the unspecv enum, > which broke gcc/testsuite/gcc.target/riscv/xtheadfmv-fmv.c. > The INSNs expect these unspecs to be not volatile. >

Re: [PATCH]middle-end: check memory accesses in the destination block [PR113588].

2024-01-30 Thread Richard Biener
On Mon, 29 Jan 2024, Tamar Christina wrote: > Hi All, > > When analyzing loads for early break it was always the intention that > for the exit where things get moved to we only check the loads that can > be reached from the condition. Looking at the code I'm a bit confused that we always move

Re: [tree-ssa PATCH] PR target/113560: Enhance is_widening_mult_rhs_p.

2024-01-30 Thread Richard Biener
On Tue, Jan 30, 2024 at 8:33 AM Roger Sayle wrote: > > > This patch resolves PR113560, a code quality regression from GCC12 > affecting x86_64, by enhancing the middle-end's tree-ssa-math-opts.cc > to recognize more instances of widening multiplications. > > The widening multiplication perception

[PATCH] testsuite, asan, hwsan: Add libstdc++ deps where required.

2024-01-30 Thread Iain Sandoe
tested on i686, x86_64 (and aarch64) Darwin, x86_64, aarch64 Linux, OK for trunk? thanks Iain --- 8< --- We use the shared asan/hwasan from both C,C++,D and Fortran. The sanitizer libraries link to libstdc++. When we are using the C/gdc/gfortran driver, and the target might require a path to the

[PATCH] testsuite, ubsan: Add libstdc++ deps where required.

2024-01-30 Thread Iain Sandoe
tested on i686, x86_64 (and aarch64) Darwin, x86_64, aarch64 Linux, OK for trunk? thanks Iain --- 8< --- We use the ubsan tests from both C, C++, D and Fortran. the sanitizer libraries link to libstdc++. When we are using the C/gdc/gfortran driver, and the target might require a path to the libs

Re: [PATCH] Fortran: use name of array component in runtime error message [PR30802]

2024-01-30 Thread Mikael Morin
Le 29/01/2024 à 21:50, Harald Anlauf a écrit : Am 29.01.24 um 18:25 schrieb Harald Anlauf: I was talking about the generated format strings of runtime error messages. program p    implicit none    type t   real :: zzz(10) = 42    end type t    class(t), allocatable :: xx(:)    integer :: j

Re: [PATCH]AArch64: relax cbranch tests to accepted inverted branches [PR113502]

2024-01-30 Thread Richard Sandiford
Richard Biener writes: > On Mon, Jan 29, 2024 at 5:00 PM Richard Sandiford > wrote: >> >> Tamar Christina writes: >> > Hi All, >> > >> > Recently something in the midend had started inverting the branches by >> > inverting >> > the condition and the branches. >> > >> > While this is fine, it ma

Re: [PATCH] Fortran: use name of array component in runtime error message [PR30802]

2024-01-30 Thread Mikael Morin
Le 30/01/2024 à 11:38, Mikael Morin a écrit : Another (easier) way to clarify the data reference would be rephrasing the message so that the array part is separate from the scalar part, like so (there are too many 'of', but I lack inspiration): Index '0' of dimension 1 of component 'zz' of el

Re: [PATCH]AArch64: relax cbranch tests to accepted inverted branches [PR113502]

2024-01-30 Thread Richard Biener
On Tue, Jan 30, 2024 at 11:40 AM Richard Sandiford wrote: > > Richard Biener writes: > > On Mon, Jan 29, 2024 at 5:00 PM Richard Sandiford > > wrote: > >> > >> Tamar Christina writes: > >> > Hi All, > >> > > >> > Recently something in the midend had started inverting the branches by > >> > inv

[PATCH] tree-optimization/113659 - early exit vectorization and missing VUSE

2024-01-30 Thread Richard Biener
The following handles the case of the main exit going to a path without virtual use and handles it similar to the alternate exit handling. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/113659 * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop

Re: [PATCH v3 1/2] arm: Add define_attr to to create a mapping between MVE predicated and unpredicated insns

2024-01-30 Thread Richard Earnshaw (lists)
On 19/01/2024 14:40, Andre Vieira wrote: > > Reposting for testing purposes, no changes from v2 (other than rebase). We seem to have lost the ChangeLog for this hunk :( The code itself looks OK, though.

[PATCH] middle-end: Enhance conditional reduction vectorization by re-association in ifcvt [PR109088]

2024-01-30 Thread Juzhe-Zhong
This patch targets GCC-15. Consider this following case: unsigned int single_loop_with_if_condition (unsigned int *restrict a, unsigned int *restrict b, unsigned int *restrict c, unsigned int loop_size) { unsigned int result = 0; for (unsigned int i = 0; i < lo

Re: [PATCH v3 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2024-01-30 Thread Richard Earnshaw (lists)
On 19/01/2024 14:40, Andre Vieira wrote: > > Respin after comments from Kyrill and rebase. I also removed an if-then-else > construct in arm_mve_check_reg_origin_is_num_elems similar to the other > functions > Kyrill pointed out. > > After an earlier comment from Richard Sandiford I also added c

[PATCHSET] Update Rust frontend January 2024

2024-01-30 Thread arthur . cohen
Hi everyone, This is our first upstream of 2024. It includes commits up to the 25th of January, including fixes for some of the issues reported after our previous patchset. The fixes for little-endian platforms have yet to land as we are investigating a weird scan-assembler regression on our OSX

[COMMITTED 001/101] gccrs: Add visibility to trait item

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The compiler shall parse visibility modifiers on trait items and reject those at a later stage (ast validation). gcc/rust/ChangeLog: * ast/rust-item.h (struct Visibility): Move Visibility from here... * ast/rust-ast.h (struct Visibility): ...to here.

[COMMITTED 002/101] gccrs: Add a test to highlight public trait type parsing

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry This new test highlight the parser's behavior around public trait types. gcc/testsuite/ChangeLog: * rust/compile/trait_pub_type.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/trait_pub_type.rs | 6 ++ 1 file changed,

[COMMITTED 004/101] gccrs: Report self parameter parsing error kind

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Self parameter parsing errors may come from different situations, which should not be handled in the same way. It is now possible to differentiate a missing self parameter from a self pointer or a parsing error. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (

[COMMITTED 008/101] gccrs: forever-stack: Fix basic get logic

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Improve resolve_path API. * resolve/rust-forever-stack.hxx: Likewise and fix implementation. --- gcc/rust/resolve/rust-forever-stack.h | 19 +++-- gcc/rust/resolve/rust-forever-stack.hxx | 38 ++

[COMMITTED 011/101] gccrs: forever stack: Improve resolve_path implementation

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Do not copy segment when dereferencing iterator in `find_starting_point`. --- gcc/rust/resolve/rust-forever-stack.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/resolve/rus

[COMMITTED 003/101] gccrs: Fix error emission for self pointers

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Self pointer checking loop condition was inverted, the latter was therefore never executed. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop exit condition. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/par

[COMMITTED 010/101] gccrs: forever stack: Fix resolve_path signature

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Fix `ForeverStack::resolve_path` signature. * resolve/rust-forever-stack.hxx: Likewise. * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Use new API. (Early::visit_attributes):

[COMMITTED 013/101] gccrs: foreverstack: Add `to_rib` method

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: New method. * resolve/rust-forever-stack.hxx: Likewise. --- gcc/rust/resolve/rust-forever-stack.h | 2 ++ gcc/rust/resolve/rust-forever-stack.hxx | 20 +++- 2 files changed, 21 insertions(+

[COMMITTED 012/101] gccrs: foreverstack: Add `to_canonical_path` method

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: New method. * resolve/rust-forever-stack.hxx: Likewise. --- gcc/rust/resolve/rust-forever-stack.h | 25 ++- gcc/rust/resolve/rust-forever-stack.hxx | 90 - 2 files changed, 110 i

[COMMITTED 005/101] gccrs: Add new test for parsing errors on self pointers

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add new tests to highlight the behavior of errors thrown when meeting a self pointer. gcc/testsuite/ChangeLog: * rust/compile/self_const_ptr.rs: New test. * rust/compile/self_mut_ptr.rs: New test. * rust/compile/self_ptr.rs: New test. Signed-

[COMMITTED 006/101] gccrs: ast: Change *Path nodes API

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast.h: Change Path API to be more consistent. * ast/rust-path.h: Likewise. * ast/rust-ast-collector.cc (TokenCollector::visit): Use new API. * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Likewise.

[COMMITTED 014/101] gccrs: resolve: Format if properly

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Format. --- gcc/rust/resolve/rust-ast-resolve-path.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/rust/resolve/rust-ast-resolve-path.cc b/gcc/rust/resol

[COMMITTED 022/101] gccrs: Add a test regular variadic functions errors

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new regression test for the error message in regular function variadic errors during ast validation pass. gcc/testsuite/ChangeLog: * rust/compile/non_foreign_variadic_function.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/

[COMMITTED 015/101] gccrs: forever stack: Remove development debug info

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Remove debug log. --- gcc/rust/resolve/rust-forever-stack.hxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx index 65796172b0

[COMMITTED 020/101] gccrs: Add check for associated items on auto traits

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Reject rust code with associated items on auto traits. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add auto trait associated item check in AST validation pass. * parse/rust-parse-impl.h: Remove old error

[COMMITTED 033/101] gccrs: ctx: Add Labels ForeverStack to the resolver.

2024-01-30 Thread arthur . cohen
From: Arthur Cohen Not sure if dealing with "labels" is the proper way of doing so, so we might eventually change this to use `resolver.values` later on. gcc/rust/ChangeLog: * resolve/rust-name-resolution-context.h: Add a Labels stack. --- gcc/rust/resolve/rust-name-resolution-context.

[COMMITTED 007/101] gccrs: rib: Add Namespace enum

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-rib.h: Add Namespace enum. --- gcc/rust/resolve/rust-rib.h | 25 + 1 file changed, 25 insertions(+) diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h index 37bd90f1f75..4ffd00a5d6c 100644

[COMMITTED 018/101] gccrs: Reject auto traits with super trait

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Reject auto traits containing a super trait bound during AST validation pass. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Reject auto traits with super traits. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust

[COMMITTED 017/101] gccrs: Add regression test for generic auto traits

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Generics are forbidden on auto traits and an error should be emitted. This commit highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/generic_auto_trait.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/generic_

[COMMITTED 024/101] gccrs: Replace TOK suffix with KW

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry TOK suffix was chosen to disambiguate some identifiers with c++ reserved keyword. Even though this list lies within the rust-token header, this macro is used in many context sometimes unrelated with the lexer and tokens. This TOK suffix may appear surprising in such co

[COMMITTED 049/101] gccrs: Remove backend dependancy on resolution rib information

2024-01-30 Thread arthur . cohen
From: Philip Herron When making more desugaring for the HIR we can need to add new Let bindings which will require namesolution information but also rib information for which block the let binding is associated which was very unnessecary. This patch simply updates the BLOCK_CONTEXT of the current

[COMMITTED 009/101] gccrs: foreverstack: Specialize `get` for Namespace::Labels

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Add specific behavior for `ForeverStack::get` when dealing with labels. --- gcc/rust/resolve/rust-forever-stack.hxx | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --gi

[COMMITTED 035/101] gccrs: toplevel: Use DefaultResolver for Function

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use the DefaultResolver in the toplevel visitor. --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

[COMMITTED 021/101] gccrs: Emit an error on variadic non extern functions

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Variadic regular functions were recently added in the parser as they should be rejected in the ast validation pass. This commit add the ast validation pass rejecting this kind of variadic arguments. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (

[COMMITTED 030/101] gccrs: Replace some weak keyword raw value with constexpr

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Raw values may have typos or contain error, replacing those will improve the codebase. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value. * parse/rust-parse-impl.h (Parser::is_macro_rules_def): Likewise.

[COMMITTED 054/101] gccrs: Add a regression test for async const functions

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Functions that are both async and const shall be rejected during the AST validation pass. This new test highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/const_async_function.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsui

[COMMITTED 025/101] gccrs: Add edition separation for keywords

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry It might be required in the future to get only the keywords from a specific edition. To do so we need a mean to differentiate keywords based on their edition. This commit changes the existing keyword macro to allow such behavior. gcc/rust/ChangeLog: * lex/rus

[COMMITTED 052/101] gccrs: Allow const and async specifiers in functions

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry We need to account for const specifiers in async parsing as const can be used in the syntax before the async keyword. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_vis_item): Allow parsing async items in const. (Parser::parse_as

[COMMITTED 037/101] gccrs: late: Start setting up builtin types

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::setup_builtin_types): New function. (Late::go): Setup builtin types. * resolve/rust-late-name-resolver-2.0.h: * resolve/rust-name-resolution-context.cc (NameReso

[COMMITTED 056/101] gccrs: Add regression test for const fn in trait

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Const fn declaration in trait declarations shall emit an error. This new test highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/const_trait_fn.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/const_trait_fn.r

[COMMITTED 053/101] gccrs: Add async const function ast validation pass

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a check during AST validation pass to ensure functions are either const or async but not both. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add async const check. Signed-off-by: Pierre-Emmanuel Patry --- gc

[COMMITTED 026/101] gccrs: Treat underscore as a keyword

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make the underscore token a 2015 keyword. gcc/rust/ChangeLog: * lex/rust-token.h (enum PrimitiveCoreType): Change macro for underscore in token list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/lex/rust-token.h | 3 +-- 1 file changed, 1 inse

[COMMITTED 016/101] gccrs: Reject auto traits with generic parameters

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Generic parameters are not allowed on auto traits, the compiler should emit an error. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add check for generics on auto traits. * checks/errors/rust-ast-validation

[COMMITTED 040/101] gccrs: toplevel: Add comment about running the collector twice

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out): Add documentation comment. (TopLevel::go): Likewise. --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 8 1 file changed, 8 insertions(+)

[COMMITTED 061/101] gccrs: Add execution test for name resolution 2.0

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry We already have some compile tests but it lacked an execution test to ensure everything compiles correctly to the correct value. gcc/testsuite/ChangeLog: * rust/execute/torture/name_resolution.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- .../rust

[COMMITTED 058/101] gccrs: Change the attribute checker visitor to default one

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Make the attribute checker visitor inherit from the default visitor in order to keep visit behavior shared. gcc/rust/ChangeLog: * util/rust-attributes.cc (AttributeChecker::visit): Add visit function for crates. * util/rust-attributes.h (class

[COMMITTED 034/101] gccrs: nr2.0: Add base for late name resolution

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * Make-lang.in: Compile late name resolver. * resolve/rust-late-name-resolver-2.0.cc: New file. * resolve/rust-late-name-resolver-2.0.h: New file. --- gcc/rust/Make-lang.in | 1 + .../resolve/rust-late-name

[COMMITTED 019/101] gccrs: Add a regression test for super trait on auto trait

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new regression test to highlight the error behavior with a super trait on an auto trait. gcc/testsuite/ChangeLog: * rust/compile/auto_trait_super_trait.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/auto_trait_super

[COMMITTED 042/101] gccrs: early: Move `use` declaration resolving to TopLevel

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::visit): Remove visitors. * resolve/rust-early-name-resolver-2.0.h: Likewise. --- gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 16 gcc/rust/resolve/rust-early-n

[COMMITTED 065/101] gccrs: Generate error for const trait functions

2024-01-30 Thread arthur . cohen
From: Nobel Singh Fixes issue #2040 Add check to assure that a function cant be declared const inside trait impl blocks. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add check for const funtion. gcc/testsuite/ChangeLog: * rust/com

[COMMITTED 059/101] gccrs: Make early name resolver inherit from default one

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Many visit functions in the early name resolver are just plain old traversal visit functions like the ones from the default visitor. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver.cc (EarlyNameResolver::resolve_generic_args): Move function.

[COMMITTED 038/101] gccrs: late: Start storing mappings properly in the resolver

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Store mappings after having resolved them. * resolve/rust-late-name-resolver-2.0.h: Add `TypePath` visitor. --- .../resolve/rust-late-name-resolver-2.0.cc| 33 +

[COMMITTED 023/101] gccrs: Add ast validation check on union variant number

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Unions with zero fields are forbidden. Add regression test for empty unions. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add zero field check during ast validation pass. * checks/errors/rust-ast-validatio

[COMMITTED 045/101] gccrs: Add unsafety member to modules

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The rust syntax allows unsafe module even if those are rejected at a later stage. gcc/rust/ChangeLog: * ast/rust-item.h: Add safety status to Modules in the AST. * parse/rust-parse-impl.h (Parser::parse_module): Adapt constructors. Signed-off-by: Pie

[COMMITTED 066/101] gccrs: Renamed `WIN64` to `WIN_64`

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes issue #2768 gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::setup_abi_options): Renamed `WIN64` to `WIN_64` * util/rust-abi.cc (get_abi_from_string): Likewise (get_string_from_abi): Likewise * util/rust-abi.h (en

[COMMITTED 067/101] gccrs: Allow enabling lang_items and no_core features

2024-01-30 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/errors/rust-feature.cc (Feature::name_hash_map): Add entries for Name::LANG_ITEMS and Name::NO_CORE. * checks/errors/rust-feature.h (Feature::Name::LANG_ITEMS): New. (Feature::Name::NO_CORE): New. gcc/

[COMMITTED 039/101] gccrs: early: Resolve paths properly

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::insert_once): New function. (Early::visit): Likewise. * resolve/rust-early-name-resolver-2.0.h: Likewise. --- .../resolve/rust-early-name-resolver-2.0.cc | 30 +

[COMMITTED 027/101] gccrs: Add await keyword

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The 2018 edition await keyword was missing from the keyword list. gcc/rust/ChangeLog: * lex/rust-token.h (enum PrimitiveCoreType): Add await keyword definition. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/lex/rust-token.h | 1 + 1 file change

[COMMITTED 046/101] gccrs: Parse module safety

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Unsafe module are rejected at a later stage but could not be parsed properly. This commit changes the parser in order to allow unsafe module in the AST. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_vis_item): Dispatch to parse module w

[COMMITTED 062/101] gccrs: Make function bodies truly optional

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Missing body on a function should be rejected at a later stage in the compiler, not during parsing. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt defintion getter. * ast/rust-ast-visitor.cc (DefaultASTVisitor::

[COMMITTED 082/101] gccrs: ast: Fix lifetime type parsing

2024-01-30 Thread arthur . cohen
From: Jakub Dupak There was a mismatch whether lifetime 'static is parsed as "static" or "'static". gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched pattern. Signed-off-by: Jakub Dupak --- gcc/rust/parse/rust-parse-impl.h | 4 ++-- 1 file chan

[COMMITTED 041/101] gccrs: ast: Add NodeId to UseTree base class

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-item.h (class UseTree): Add `node_id` member. --- gcc/rust/ast/rust-item.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 2c0e45962ce..3480d126bc0 100

[COMMITTED 029/101] gccrs: Add a list of weak keyword

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Retrieving a weak keyword value is done using raw values. Introducing a list of weak keywords means this could change. gcc/rust/ChangeLog: * util/rust-keyword-values.h (class WeakKeywords): Add new class with weak keyword constexpr. Signed-off-by: Pi

[COMMITTED 050/101] gccrs: Remove class AST::InherentImplItem

2024-01-30 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (class InherentImplItem): Remove. * ast/rust-ast.h (class InherentImplItem): Remove. (class SingleASTNode): Store pointer to AssociatedItem instead of InherentImplItem. * ast

[COMMITTED 069/101] gccrs: Make expand visitor inherit from default visitor

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Many visit functions in the expand visitor simply visit their components like the default visitor. Making the expand visitor inherit from the default visitor allows us to keep all visitor in sync without having to change every visitor. gcc/rust/ChangeLog: * e

[COMMITTED 084/101] gccrs: ast: Full lifetime elision handling

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_generic_param): Lifetime elision control. (Parser::parse_lifetime_where_clause_item): Lifetime elision control. (Parser::parse_type_param_bound): Lifetime elision control. (Parser::par

[COMMITTED 044/101] gccrs: Create base class for TupleStructItems and TuplePatternItems

2024-01-30 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * hir/tree/rust-hir-pattern.h (class TupleItems): New. (class TupleStructItems): Inherit from TupleItems. (class TuplePatternItems): Likewise. Signed-off-by: Owen Avery --- gcc/rust/hir/tree/rust-hir-pattern.h | 47 +

[COMMITTED 031/101] gccrs: Introduce a proper keyword list

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The old "keyword" list was used for the lexer, and could therefore not be used with keyword spanning over multiple tokens as those tokens should remain lexed as is. Hence the introduction of a new list macro for keyword exclusive tasks. This also means we can no longer

[COMMITTED 060/101] gccrs: Add multiple regression test in name resolution

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Local variables and functions or global variables have different resolution when binded to a variable. This was not covered before, even though it was handled by the new name resolution. This commit highlight this behavior from the new name resolution mechanism. gcc/t

[COMMITTED 073/101] gccrs: TyTy: Fix missed nodiscard

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix nodiscard to warn unused. Signed-off-by: Jakub Dupak --- gcc/rust/typecheck/rust-tyty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.

[COMMITTED 091/101] gccrs: Handle `async` keyword for regular implementations

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2788 gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_inherent_impl_item): Added switch-case for ASYNC token. gcc/testsuite/ChangeLog: * rust/compile/issue-2788.rs: New test. Signed-off-by: Kushal Pal --- gcc/rust/parse/rust-parse

[COMMITTED 043/101] gccrs: toplevel: Resolve `use` declarations

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out): New functions. (TopLevel::handle_use_dec): New function. (flatten_rebind): Likewise. (flatten_list): Likewise. (flatten_glob): Like

[COMMITTED 028/101] gccrs: Replace some keyword raw values

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Raw values cannot be understood easily by most tools. This commit replace some raw values with their variable counterpart. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Replace raw value with keyword call. * ast/rust

[COMMITTED 068/101] gccrs: Make default resolver inherit from default visitor

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The default resolver put some scope in place but mostly has traversal functions similar to the default ast visitor, making it inherit from the default visitor allows us to avoid code duplication. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (Default

[COMMITTED 080/101] gccrs: Handle `async` qualifier inside trait

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2778 gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_trait_impl_item): Handled `async` items Signed-off-by: Kushal Pal --- gcc/rust/parse/rust-parse-impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/parse/rust-parse-imp

[COMMITTED 095/101] gccrs: Test: fix missing lifetime in a test

2024-01-30 Thread arthur . cohen
From: Jakub Dupak This test did not compile with rustc. gcc/testsuite/ChangeLog: * rust/compile/torture/utf8_identifiers.rs: add mising lifetime Signed-off-by: Jakub Dupak --- gcc/testsuite/rust/compile/torture/utf8_identifiers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[COMMITTED 048/101] gccrs: Add a regression test for unsafe module validation

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new test to check for unsafe modules during AST validation pass. gcc/testsuite/ChangeLog: * rust/compile/unsafe_module.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/unsafe_module.rs | 2 ++ 1 file changed, 2 insert

[COMMITTED 032/101] gccrs: Added support to Parse ASYNC function

2024-01-30 Thread arthur . cohen
From: M V V S Manoj Kumar Fixes issue #2650 The parser now parses ASYNC functions. Added ASYNC case to parse_item Added a new function parse_async_item which is called in parse_vis_item to handle the ASYNC case. Parse_async_item also checks the current Rust edition and generates an error if the e

[COMMITTED 077/101] gccrs: TyTy: SubstitutionRef cast specialization

2024-01-30 Thread arthur . cohen
From: Jakub Dupak Allows skipping parent check when casting. gcc/rust/ChangeLog: * typecheck/rust-tyty.h (BaseType::is): Cast API. (SubstitutionRef>): Cast API. (BaseType::as): Cast API. (BaseType::try_as): Cast API. Signed-off-by: Jakub Dupak --- gcc/rust/typ

[COMMITTED 079/101] gccrs: split rust-mangle.cc into two files

2024-01-30 Thread arthur . cohen
From: Raiki Tamura gcc/rust/ChangeLog: * Make-lang.in: Add .o files * backend/rust-mangle.cc (struct V0Path): moved to splitted files (v0_path): Likewise. (legacy_mangle_name): Likewise. (legacy_mangle_canonical_path): Likewise. (legacy_hash): Like

[COMMITTED 101/101] gccrs: Fix output line ending patterns.

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/testsuite/ChangeLog: * rust/execute/torture/builtin_macros1.rs: Fix output pattern. * rust/execute/torture/coercion3.rs: Likewise. * rust/execute/torture/issue-2080.rs: Likewise. * rust/execute/torture/issue-2179.rs: Likewise. * rust

[COMMITTED 036/101] gccrs: nr2.0: Store mappings in NameResolutionContext

2024-01-30 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-name-resolution-context.h: Store a reference to the mappings. * resolve/rust-name-resolution-context.cc (NameResolutionContext::NameResolutionContext): Likewise. --- gcc/rust/resolve/rust-name-resolution-conte

[COMMITTED 055/101] gccrs: Add AST validation check for const in trait

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new check in AST validation pass that checks that no function declaration in traits are declared const. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add const check. * checks/errors/rust-ast-validati

[COMMITTED 076/101] gccrs: TyTy: Common interface for fucntion-like types

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * typecheck/rust-tyty.h (class ClosureType): Inherit interface. (class FnPtr): Inherit interface. (class FnType): Inherit interface. (class CallableTypeInterface): New interface. (BaseType::is): Detect interface member

[COMMITTED 083/101] gccrs: ast: Unify explicitly and implicitly elided lifettimes

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * ast/rust-ast.h: Elided lifetime static constructor * ast/rust-type.h: Default lifetime to elided. * parse/rust-parse-impl.h (Parser::parse_lifetime_param): Use elided lifetime. (Parser::parse_lifetime): Use elided lifetime/

  1   2   3   >