[PATCH] i386: Fix up ix86_convert_const_wide_int_to_broadcast [PR108599]

2023-01-31 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled. The problem is that during RTL DSE we see a V4DI register is being loaded { 16, 16, 0, 0 } value and DSE mostly works in terms of scalar modes, so it calls movoi to set an OImode REG to (const_wide_int 0x100010) and ix86_convert_const_wide_in

[PATCH] i386: Fix up -Wuninitialized warnings in avx512erintrin.h [PR105593]

2023-01-31 Thread Jakub Jelinek via Gcc-patches
Hi! As reported in the PR, there are some -Wuninitialized warnings in avx512erintrin.h. One can see that by compiling sse-23.c testcase with -Wuninitialized (or when actually using those intrinsics). Those 6 spots use an uninitialized variable and pass it as one of the argument to a builtin with

RE: [PATCH] i386: Fix up -Wuninitialized warnings in avx512erintrin.h [PR105593]

2023-01-31 Thread Liu, Hongtao via Gcc-patches
> -Original Message- > From: Jakub Jelinek > Sent: Tuesday, January 31, 2023 4:09 PM > To: Liu, Hongtao ; Uros Bizjak > Cc: gcc-patches@gcc.gnu.org > Subject: [PATCH] i386: Fix up -Wuninitialized warnings in avx512erintrin.h > [PR105593] > > Hi! > > As reported in the PR, there are s

[PATCH] bbpart: Fix up ICE on asm goto [PR108596]

2023-01-31 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase we have asm goto in hot block with 2 successors, one cold to which it both falls through and has one of the label pointing to it and another hot successor with another label. Now, during bbpart we want to ensure that no blocks from one partition fall through into a b

Re: [PATCH] don't declare header-defined functions both static and inline

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 31, 2023 at 08:05:15AM +0100, Richard Biener via Gcc-patches wrote: > On Tue, Jan 31, 2023 at 4:39 AM Patrick Palka via Gcc-patches > wrote: > > > > Many functions defined in our headers are declared 'static inline' which > > is a vestige from when GCC's implementation language was C.

Re: [PATCH] bbpart: Fix up ICE on asm goto [PR108596]

2023-01-31 Thread Richard Biener via Gcc-patches
On Tue, 31 Jan 2023, Jakub Jelinek wrote: > Hi! > > On the following testcase we have asm goto in hot block with 2 successors, > one cold to which it both falls through and has one of the label > pointing to it and another hot successor with another label. > > Now, during bbpart we want to ensur

Re: [PATCH] testsuite: Fix pr108574-3.c failed in arch where sign defaults to unsigned.

2023-01-31 Thread Richard Biener via Gcc-patches
On Tue, 31 Jan 2023, Richard Biener wrote: > On Tue, 31 Jan 2023, Xianmiao Qu wrote: > > > In the architecture where sign defaults to unsigned, the 'f' will be zero > > extended to int type in the expression 'd = ~(f & ~2880764155)', then the > > 'd' will become -1 wich cause the case to fail. >

Re: [PATCH] i386: Fix up ix86_convert_const_wide_int_to_broadcast [PR108599]

2023-01-31 Thread Uros Bizjak via Gcc-patches
On Tue, Jan 31, 2023 at 9:02 AM Jakub Jelinek wrote: > > Hi! > > The following testcase is miscompiled. The problem is that during > RTL DSE we see a V4DI register is being loaded { 16, 16, 0, 0 } > value and DSE mostly works in terms of scalar modes, so it calls > movoi to set an OImode REG to (

Re: [PATCH] libsanitizer: Add __interceptor_sigsetjmp_internal

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Fri, Dec 16, 2022 at 01:31:32PM -0800, H.J. Lu via Gcc-patches wrote: > Add an internal alias to __interceptor_sigsetjmp to avoid R_X86_64_PC32 > relocation for "jmp __interceptor_sigsetjmp" with old assemblers. I think the patch is ok, but because libsanitizer is just downstream from sanitizer

Re: [PATCH] don't declare header-defined functions both static and inline

2023-01-31 Thread Richard Biener via Gcc-patches
On Tue, Jan 31, 2023 at 9:43 AM Jakub Jelinek wrote: > > On Tue, Jan 31, 2023 at 08:05:15AM +0100, Richard Biener via Gcc-patches > wrote: > > On Tue, Jan 31, 2023 at 4:39 AM Patrick Palka via Gcc-patches > > wrote: > > > > > > Many functions defined in our headers are declared 'static inline' w

[PING] Re: [PATCH 2/2] Corrected pr25521.c target matching.

2023-01-31 Thread Cupertino Miranda via Gcc-patches
Cupertino Miranda via Gcc-patches writes: > Thank you for the comments and suggestions. > I have changed the patch. > > Unfortunately in case of rx target I could not make > scan-assembler-symbol-section to match. I believe it is because the > .section and .global entries order is reversed in th

[PATCH (pushed)] libsanitizer: Regenerate configure

2023-01-31 Thread Martin Liška
libsanitizer/ChangeLog: * configure: Regenerate. --- libsanitizer/configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsanitizer/configure b/libsanitizer/configure index d4ee0fac3e7..e7984f96615 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure

RE: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443]

2023-01-31 Thread Kyrylo Tkachov via Gcc-patches
Hi Andre, > -Original Message- > From: Andre Vieira (lists) > Sent: Wednesday, January 25, 2023 5:41 PM > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ; Richard Earnshaw > > Subject: Re: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443] > > Looks like the first patch was mis

Re: [PATCH] don't declare header-defined functions both static and inline

2023-01-31 Thread Eric Botcazou via Gcc-patches
> 3) we have also gcc/ada/gcc-interface/*.h with > ada.h:#define INLINE static inline > gigi.h:static inline unsigned HOST_WIDE_INT > gigi.h:static inline bool > gigi.h:static inline bool > gigi.h:static inline bool > gigi.h:static inline tree > gigi.h:static inline tree > gigi.h:static inline tree

Re: [PATCH 3/3] tree-optimization/108385 - Add op2_range to pointer_plus.

2023-01-31 Thread Richard Biener via Gcc-patches
On Mon, Jan 30, 2023 at 8:47 PM Andrew MacLeod via Gcc-patches wrote: > > Implement op2_range for pointer_plus to determine the offset (operand 2) > is zero or non-zero based on equality/inequality between the LHS and op1. > > Fairly trivial fix for the PR, dependent on the first patch in the set

Re: [PATCH] modula2/108462 - duplicate install of static modula2 target libs

2023-01-31 Thread Richard Biener via Gcc-patches
On Mon, 23 Jan 2023, Richard Biener wrote: > The following addresses the fact that libgm2 installs static libraries > into two places, one performed by > > toolexeclib_LTLIBRARIES = libm2cor.la > > and one performed as part of the install-data-local rule to a > m2/m2cor subdirectory alongside Mo

Re: [Patch] OpenMP/Fortran: Fix loop-iter var privatization with !$OMP LOOP [PR108512]

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 24, 2023 at 04:24:07PM +0100, Tobias Burnus wrote: > gcc/fortran/ChangeLog: > > PR fortran/108512 > * openmp.cc (gfc_resolve_omp_do_blocks): Don't check 'inscan' > restrictions for loop as rejected elsewhere. > (gfc_resolve_do_iterator): Set a source location fo

For Modula-2 build-tree testing, also set up paths to compiler libraries (was: [PATCH] 17/19 modula2 front end: dejagnu expect library scripts)

2023-01-31 Thread Thomas Schwinge
Hi! On 2022-10-10T16:31:26+0100, Gaius Mulley via Gcc-patches wrote: > Here are the dejagnu expect library scripts for the gm2 > testsuite. This (or some variant thereof; haven't checked), became part of commit r13-4704-g1eee94d351774cdc2efc8ee508b82d065184c6ee "Merge modula-2 front end onto gc

Re: [Patch][v2] OpenMP/Fortran: Partially fix non-rect loop nests [PR107424]

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 25, 2023 at 03:47:18PM +0100, Tobias Burnus wrote: > updated patch included, i.e. avoiding 'count' for 'j' when a 'j.0' would > do (i.e. only local var without the different step calculation). I also > now reject if there is a non-unit step on the loop using an outer var. > > Eventuall

Re: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443]

2023-01-31 Thread Andre Vieira (lists) via Gcc-patches
Yeah that shouldn't be there, it's from an earlier version of the patch I wrote where I was experimenting changing the existing modes, I'll remove it from the ChangeLog. On 31/01/2023 09:53, Kyrylo Tkachov wrote: gcc/testsuite/ChangeLog:     * gcc.dg/rtl/arm/mve-vxbi.c: Use new pred

Re: [Patch] Fortran: Extend align-clause checks of OpenMP's allocate clause

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 13, 2022 at 05:38:22PM +0100, Tobias Burnus wrote: > I missed that 'align' needs to be a power of 2 - contrary to 'aligned', > which does not have this restriction for some odd reason. Yeah, odd. The C and C++ FEs indeed diagnose non-pow2p constants for align (and not for aligned clau

[PATCH] RISC-V: Add integer binary vv C/C++ API support

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong --- gcc/config/riscv/constraints.md | 10 + gcc/config/riscv/iterators.md | 14 +- gcc/config/riscv/predicates.md| 15 ++ .../riscv/riscv-vector-builtins-bases.cc | 48 + .../riscv/riscv-vector-builtins-bases.h |

Re: [Patch] OpenMP: Parse align clause in allocate directive in C/C++

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Tue, Dec 13, 2022 at 06:44:27PM +0100, Tobias Burnus wrote: > OpenMP: Parse align clause in allocate directive in C/C++ > > gcc/c/ChangeLog: > > * c-parser.cc (c_parser_omp_allocate): Parse align > clause and check for restrictions. > > gcc/cp/ChangeLog: > > * parser.cc (cp

[PATCH] RISC-V: Add srl.vv C API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vsrl_vv-1.c: New test. * gcc.target/riscv/rvv/base/vsrl_vv-2.c: New test. * gcc.target/riscv/rvv/base/vsrl_vv-3.c: New test. * gcc.target/riscv/rvv/base/vsrl_vv_m-1.c: New test. * gcc.

[PATCH] RISC-V: Add vsra.vv C API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vsra_vv-1.c: New test. * gcc.target/riscv/rvv/base/vsra_vv-2.c: New test. * gcc.target/riscv/rvv/base/vsra_vv-3.c: New test. * gcc.target/riscv/rvv/base/vsra_vv_m-1.c: New test. * gcc.

Re: [Patch] libgomp.texi: Reverse-offload updates (was: [Patch] libgomp: Handle OpenMP's reverse offloads)

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Sat, Dec 10, 2022 at 09:18:26AM +0100, Tobias Burnus wrote: > libgomp.texi: Reverse-offload updates > > libgomp/ > * libgomp.texi (5.0 Impl. Status): Update 'requires' and 'ancestor'. > (GCN): Add item about 'omp requires'. > (nvptx): Likewise; add item about reverse offload.

Re: [PATCH 1/2] testsuite: Run __bos tests to completion

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 05:25:53PM -0500, Siddhesh Poyarekar wrote: > gcc/testsuite/ChangeLog: > > * gcc.dg/builtin-dynamic-object-size-0.c: Move FAIL and nfail > into... > * gcc.dg/builtin-object-size-common.h: ... new file. > * g++.dg/ext/builtin-object-size1.C: Include >

[PATCH] RISC-V: Add binop constraint tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/binop_vv_constraint-1.c: New test. --- .../riscv/rvv/base/binop_vv_constraint-1.c| 132 ++ 1 file changed, 132 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/binop_vv

Re: [PATCH 2/2] tree-object-size: More consistent behaviour with flex arrays

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 21, 2022 at 05:25:54PM -0500, Siddhesh Poyarekar wrote: > The tree object size pass tries to fail when it detects a flex array in > the struct, but it ends up doing the right thing only when the flex > array is in the outermost struct. For nested cases (such as arrays > nested in a uni

[PATCH] RISC-V: Add vsrl.vv C++ API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * g++.target/riscv/rvv/base/vsrl_vv-1.C: New test. * g++.target/riscv/rvv/base/vsrl_vv-2.C: New test. * g++.target/riscv/rvv/base/vsrl_vv-3.C: New test. * g++.target/riscv/rvv/base/vsrl_vv_mu-1.C: New test. * g++

[PATCH] RISC-V: Add vsra.vv C++ API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * g++.target/riscv/rvv/base/vsra_vv-1.C: New test. * g++.target/riscv/rvv/base/vsra_vv-2.C: New test. * g++.target/riscv/rvv/base/vsra_vv-3.C: New test. * g++.target/riscv/rvv/base/vsra_vv_mu-1.C: New test. * g++

Re: [PATCH 2/2] tree-object-size: More consistent behaviour with flex arrays

2023-01-31 Thread Siddhesh Poyarekar
On 2023-01-31 07:46, Jakub Jelinek wrote: On Wed, Dec 21, 2022 at 05:25:54PM -0500, Siddhesh Poyarekar wrote: The tree object size pass tries to fail when it detects a flex array in the struct, but it ends up doing the right thing only when the flex array is in the outermost struct. For nested

[PATCH] vect: Fix single def-use cycle for ifn reductions [PR108608]

2023-01-31 Thread Richard Sandiford via Gcc-patches
The patch that added support for fmin/fmax reductions didn't handle single def-use cycles. In some ways, this seems like going out of our way to make things slower, but that's a discussion for another day. Tested on aarch64-linux-gnu & x86_64-linux-gnu. OK for trunk and the GCC 12 branch? Richa

Re: [PATCH] modula2/108462 - duplicate install of static modula2 target libs

2023-01-31 Thread Gaius Mulley via Gcc-patches
Richard Biener writes: > On Mon, 23 Jan 2023, Richard Biener wrote: > >> The following addresses the fact that libgm2 installs static libraries >> into two places, one performed by >> >> toolexeclib_LTLIBRARIES = libm2cor.la >> >> and one performed as part of the install-data-local rule to a >>

[COMMITTED] gccrs: session-manager: Add ast-pretty-expanded dump

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Allow the dump of prettified AST (Session::dump_ast_pretty): New * rust-session-manager.h: Add new output file for pretty AST dump Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/ru

[COMMITTED] gccrs: builtins: Add add_overflow builtin and refactor class

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * backend/rust-builtins.h: Refactor builtin context class and add overflow builtins. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/backend/rust-builtins.h | 51 ++-- 1 file changed, 36 insertions(+), 15 deletions

[COMMITTED] gccrs: parser: Parse RangeFullExpr without erroring out

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * parse/rust-parse-impl.h: Allow parsing full range expressions without erroring out. gcc/testsuite/ChangeLog: * rust/compile/parse_range.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/parse/rust-parse-impl.h

[COMMITTED] gccrs: backend: Add overflow checks to every arithmetic operation

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Insert overflow checks logic. (CompileExpr::array_copied_expr): Insert overflow checks logic. * backend/rust-compile-item.cc (CompileItem::visit): Insert overflow checks logic.

[COMMITTED] gccrs: macros: Handle matchers properly in repetitions

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle fragments differently based on whether or not we are currently trying to match a matcher in a repetition context. (MacroExpander::match_n_matches): Use new `in_repetition` argum

[COMMITTED] gccrs: dump: Add AST debugging using the AST::Dump class

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-ast-dump.h: Add shorthand `AST::Dump::debug` function to dump an AST node on `stderr`. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/ast/rust-ast-dump.h | 16 1 file changed, 16 insertions(+) diff --git a/gcc/ru

[COMMITTED] gccrs: lint: Do not emit unused warnings for public items

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * checks/lints/rust-lint-scan-deadcode.h: Do not report public items as dead code. gcc/testsuite/ChangeLog: * rust/compile/issue-1031.rs: Remove extraneous dead code warnings. * rust/compile/issue-1289.rs: Likewise. * rust/compile/test_

[COMMITTED] gccrs: Add missing location info to coercions

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::TypeCheckBase): Remove constructor. (TypeCheckBase::coercion_site): Add `Location` argument to function. * typecheck/rust-hir-type-check-base.h: Use `TypeCheckBase::co

[COMMITTED] gccrs: Create canonical process of compiling constant items

2023-01-31 Thread Arthur Cohen
From: Philip Herron In order to compile a block expression constant, the simplest way for us was to reuse what code we have and to generate an artifical function which does not get added to the translation unit. The constant then becomes a CALL_EXPR to this artifical function which we can pass to

[COMMITTED] gccrs: ast: Only expand expressions and types if the kind is right

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-ast.h: Add assertions and accessors for fragment nodes. * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion context typo when visiting `InherentImpl` items. (AttrVisitor::maybe_expand_expr): Use new Fragment accessor

[COMMITTED] gccrs: transcriber: Do not infinite loop if the current parsed node is an error

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (parse_many): Return early from parsing loop if we encounter an error, and emit that error in the meantime. Co-authored-by: philberty Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/expand/rust-macro-expand.cc

[COMMITTED] gccrs: ast: Add better assertion on AST fragments

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * ast/rust-ast.h: Improve assertions within ASTFragment API. Co-authored-by: philberty Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/ast/rust-ast.h | 47 ++--- 1 file changed, 39 insertions(+), 8 deletions(-)

[COMMITTED] gccrs: Add extra debugging for method call expressions

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Add more calls to `rust_debug` for development. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/typecheck/rust-hir-type-check-expr.cc | 12 1 f

[COMMITTED] gccrs: Refactor unify to hit a unify_site

2023-01-31 Thread Arthur Cohen
From: Philip Herron This allows us to enforce better error handling on unify sites gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::unify_site): Add better unification function with debug calls. * typecheck/rust-autoderef.cc (AutoderefCycle::cy

[COMMITTED] gccrs: Remove param_use_canonical_types checks ported from c++ front-end

2023-01-31 Thread Arthur Cohen
From: Philip Herron We are not fully setting TYPE_CANONICAL yet but we don't need to be as strict as the C++ front-end yet. param_use_canonical_types is a command line option we are not using either. gcc/rust/ChangeLog: * backend/rust-tree.cc (comptypes): Remove some C++ specific checks

[COMMITTED] gccrs: remove bad assertion

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * backend/rust-tree.cc (rs_type_quals): Comment out bad assertion Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/backend/rust-tree.cc | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/rust/backend/r

[COMMITTED] gccrs: Add new check for contains_associated_types

2023-01-31 Thread Arthur Cohen
From: Philip Herron We don't need to setup associated types when a trait does not contain any associated types. gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::contains_associated_types): Check if a type bound predicate contains assocated types.

[COMMITTED] gccrs: Unit structs are not concrete when they need substitutions

2023-01-31 Thread Arthur Cohen
From: Philip Herron Fixes #1518 gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix `is_concrete` for unit types with substitutions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/typecheck/rust-tyty.h | 5 + 1 file changed, 5 insertions(+) diff --git a/gc

[COMMITTED] gccrs: backend: correctly formulate the exit condition ...

2023-01-31 Thread Arthur Cohen
From: liushuyu ... previously the exit condition was treated the same as the loop condition (which is the inverse condition of the exit condition). Now this is corrected. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Properly formulate exit condition w

[COMMITTED] gccrs: add testcase to test component_ref and constructor codes in eval_constant_expression()

2023-01-31 Thread Arthur Cohen
From: Faisal Abbas <90.abbasfai...@gmail.com> gcc/testsuite/ChangeLog: * rust/compile/const7.rs: New test. Signed-off-by: Faisal Abbas <90.abbasfai...@gmail.com> Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/const7.rs | 12 1 file chan

[COMMITTED] gccrs: Fix duplicated function generation on higher ranked trait bounds

2023-01-31 Thread Arthur Cohen
From: Philip Herron Deuplicate function elimination can fail when we compile helpers during higher ranked trait bound monomorphization. This because the TyTy::BaseType info can be lost/reset during the compilation process. This adds a second mechanism to match based on the manged names which is a

[COMMITTED] gccrs: const generics: Make sure const generic types are visited properly

2023-01-31 Thread Arthur Cohen
...in all contexts. gcc/testsuite/ChangeLog: * rust/compile/const_generics_7.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/const_generics_7.rs | 17 + 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/r

[COMMITTED] gccrs: add testcase with struct to test component_ref and constructor codes..

2023-01-31 Thread Arthur Cohen
From: Faisal Abbas <90.abbasfai...@gmail.com> ..in eval_constant_expression() gcc/testsuite/ChangeLog: * rust/compile/const8.rs: New test. Signed-off-by: Faisal Abbas <90.abbasfai...@gmail.com> Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/const8.

[COMMITTED] gccrs: testsuite: add loop condition execution test

2023-01-31 Thread Arthur Cohen
From: liushuyu gcc/testsuite/ChangeLog: * rust/execute/torture/loop-condition-eval.rs: New test. Signed-off-by: Zixing Liu Tested on x86_64-pc-linux-gnu, committed on master. --- .../execute/torture/loop-condition-eval.rs| 21 +++ 1 file changed, 21 insertions(+)

[COMMITTED] gccrs: Statics are a coercion site

2023-01-31 Thread Arthur Cohen
From: Philip Herron Statics can be assigned to a block expression meaning they need to behave similarly to constant items. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Make static items behave more similarly to const items. Tested

[COMMITTED] gccrs: attributes: Add #[macro_use] as builtin

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * util/rust-attributes.cc: Add `macro_use` to list of builtin attributes. gcc/testsuite/ChangeLog: * rust/compile/macro_export_1.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/util/rust-attributes.cc | 1 +

[COMMITTED] gccrs: const generics: Forbid default values in Functions, Traits and Impls

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc (ConstChecker::ctx_to_str): Allow getting an error string from a specific constant context. (ConstChecker::ctx_allows_default): New function, check if a context allows default values for Const generics.

[COMMITTED] gccrs: rust: Add -frust-compile-until option

2023-01-31 Thread Arthur Cohen
This option helps ensure that we do not introduce regressions on various parts of the compilation pipeline. For example, a testcase (or testsuite from the `testing` project) might pass attribute checking, expansion and lowering, but fail during typechecking. Should a change suddenly make that testc

[COMMITTED] gccrs: module lowering: Do not append null pointers as items

2023-01-31 Thread Arthur Cohen
Some module items do not need to get lowered to HIR such as `macro_rules!` definitions. Hence, module lowering should act the same as crate lowering: Only emplace back the lowered item if it is a valid pointer gcc/rust/ChangeLog: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Do

[COMMITTED] gccrs: expand: eager evaluate macros inside builtin macros

2023-01-31 Thread Arthur Cohen
From: liushuyu gcc/rust/ChangeLog: * ast/rust-ast.h (class MacroInvocData): Store expander as member of the class. (class Expr): Add `is_literal` virtual method * ast/rust-expr.h: Override `is_literal` for `LiteralExpr`s. * expand/rust-macro-builtins.cc (t

[COMMITTED] gccrs: Static Items must be const evaluated

2023-01-31 Thread Arthur Cohen
From: Philip Herron Statics like constants need to have a singular value they are not functions to be lazy evaluated. So to evaluate a block expr we can just reuse our const code to resolve this to a singular value. gcc/rust/ChangeLog: * backend/rust-compile-item.cc (CompileItem::visit)

[COMMITTED] gccrs: Cleanup formatting of backend expression visitor

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * backend/rust-compile-expr.h: Formatting. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/backend/rust-compile-expr.h | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/rust/backend/rust-

[COMMITTED] gccrs: Add testcase for const-eval issue from rust-blog

2023-01-31 Thread Arthur Cohen
From: Philip Herron see: https://blog.rust-lang.org/2022/09/15/const-eval-safety-rule-revision.html gcc/testsuite/ChangeLog: * rust/compile/rust-const-blog-issue.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/rust-const-blog-issue.rs

[COMMITTED] gccrs: Add testcase to show forward declared items work

2023-01-31 Thread Arthur Cohen
From: Philip Herron Fixes #1006 gcc/testsuite/ChangeLog: * rust/compile/issue-1006.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/issue-1006.rs | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/rust/c

[COMMITTED] gccrs: backend: Expose Bvariable class through rust-gcc header

2023-01-31 Thread Arthur Cohen
gcc/rust/ChangeLog: * rust-gcc.cc (class Bvariable): Move class to `rust-gcc.h` header. * rust-gcc.h: New file. Tested on x86_64-pc-linux-gnu, committed on master. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/rust-gcc.cc | 30 +-- gcc/ru

[COMMITTED] gccrs: testsuite/rust: add a testcase for testing ...

2023-01-31 Thread Arthur Cohen
From: liushuyu ... builtin macro and decl macro mixed expansion gcc/testsuite/ChangeLog: * rust/compile/builtin_macro_recurse.rs: New test. Signed-off-by: Zixing Liu Tested on x86_64-pc-linux-gnu, committed on master. --- .../rust/compile/builtin_macro_recurse.rs | 21 +

[COMMITTED] gccrs: Desugar double borrows into two HIR:BorrowExpr's

2023-01-31 Thread Arthur Cohen
From: Philip Herron We simply hit a gcc_unreachable() on double borrows but it seems reasonable to just desugar the AST into a borrow of a borrow to foo. Instead of a borrow expression with a flag to be respected. Fixes #1506 gcc/rust/ChangeLog: * hir/rust-ast-lower-expr.h: Lower doubl

[COMMITTED] gccrs: Make constexpr constructors type-checking more permissive

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * backend/rust-constexpr.cc (eval_store_expression): Remove invalid assertion on constexpr constructors. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/backend/rust-constexpr.cc | 16 1 file changed, 8

[COMMITTED] gccrs: Refactor TypeResolution to be a simple query based system

2023-01-31 Thread Arthur Cohen
From: Philip Herron This patch refactors the type resolution system to introduce a new interface bool query_type (HirId, TyTy::BaseType** result) This is needed in order to properly support forward declared items. Our name resolution system has two parts: 1. Toplevel scan 2. Item resolut

[COMMITTED] gccrs: Add guards against getting data from an empty vector

2023-01-31 Thread Arthur Cohen
From: Philip Herron gcc/rust/ChangeLog: * typecheck/rust-tyctx.cc (TypeCheckContext::pop_return_type): Add guards around `std::vector.pop_back()`. (TypeCheckContext::peek_context): Likewise for `std::vector.back()`. Tested on x86_64-pc-linux-gnu, committed on master. --

[COMMITTED] gccrs: Add testcase to show forward declared items work via TypeAlias

2023-01-31 Thread Arthur Cohen
From: Philip Herron Fixes #1073 gcc/testsuite/ChangeLog: * rust/compile/issue-1073.rs: New test. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/testsuite/rust/compile/issue-1073.rs | 4 1 file changed, 4 insertions(+) create mode 100644 gcc/testsuite/rust/compile/i

[COMMITTED] gccrs: bugfix: initialize slice from array in const context

2023-01-31 Thread Arthur Cohen
From: Faisal Abbas <90.abbasfai...@gmail.com> gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit): Turn constant item typechecking into a coercion site instead of a unify site. gcc/testsuite/ChangeLog: * rust/compile/const6.rs: New

[COMMITTED] gccrs: rustc_attrs: Allow `rustc_inherit_overflow_checks` as a builtin..

2023-01-31 Thread Arthur Cohen
..attribute. We cannot yet handle this attribute, but we should not reject it either gcc/rust/ChangeLog: * util/rust-attributes.cc: Add `rustc_inherit_overflow_checks` to list of builtin attributes. gcc/testsuite/ChangeLog: * rust/compile/rustc_attr1.rs: New test. Test

[PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-01-31 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a flexible array member is embedded into another struct (possibly recursively). __builtin_object_size should treat such struct as flexible size per -fstrict-flex-arrays. PR tree-optimization/101832 gcc/ChangeLog: PR tree-optimizat

[PATCH 0/2]PR101832: Handle component_ref to a structure/union field including flexible array member for builtin_object_size

2023-01-31 Thread Qing Zhao via Gcc-patches
This is the patch for PR101832, to fix builtin_object_size to correctly handle component_ref to a structure/union field that includes a flexible array member. also includes a documentation update for the GCC extension on embedding a structure/union with flexible array member into another structure

[PATCH 2/2] Documentation Update.

2023-01-31 Thread Qing Zhao via Gcc-patches
Update documentation to clarify a GCC extension on structure with flexible array member being nested in another structure. gcc/ChangeLog: * doc/extend.texi: Document GCC extension on a structure containing a flexible array member to be a member of another structure. --- gcc/doc/e

Re: For Modula-2 build-tree testing, also set up paths to compiler libraries

2023-01-31 Thread Gaius Mulley via Gcc-patches
Thomas Schwinge writes: > Hi! > > On 2022-10-10T16:31:26+0100, Gaius Mulley via Gcc-patches > wrote: >> Here are the dejagnu expect library scripts for the gm2 >> testsuite. > > This (or some variant thereof; haven't checked), became part of > commit r13-4704-g1eee94d351774cdc2efc8ee508b82d0651

[PATCH] middle-end/108500 - replace recursive domtree DFS traversal

2023-01-31 Thread Richard Biener via Gcc-patches
The following replaces the recursive DFS traversal of the dominator tree in assign_dfs_numbers with a tree traversal using the fact that we have recorded parents. Bootstrapped and tested on x86_64-unknown-linux-gnu. This makes r13-5325 somewhat obsolete, though not computing the DFS numbers at al

Re: [PATCH] vect: Fix single def-use cycle for ifn reductions [PR108608]

2023-01-31 Thread Richard Biener via Gcc-patches
On Tue, Jan 31, 2023 at 2:08 PM Richard Sandiford via Gcc-patches wrote: > > The patch that added support for fmin/fmax reductions didn't > handle single def-use cycles. In some ways, this seems like > going out of our way to make things slower, but that's a > discussion for another day. > > Test

[PATCH, COMMITTED] PR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1

2023-01-31 Thread Philipp Tomsich
This adds a check for REG_P on SET_DEST for the new idiom recognizer for AARCH64_FUSE_ADDSUB_2REG_CONST1. The reported ICE is only observable with checking=rtl. Bootstrapped/regtested aarch64-linux, committed. PR target/108589 gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch_m

Re: [PATCH] middle-end/108500 - replace recursive domtree DFS traversal

2023-01-31 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 31, 2023 at 03:45:43PM +0100, Richard Biener wrote: > The following replaces the recursive DFS traversal of the dominator > tree in assign_dfs_numbers with a tree traversal using the fact > that we have recorded parents. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > Thi

Re: [PATCH v3] c++: fix ICE with -Wduplicated-cond [PR107593]

2023-01-31 Thread Jason Merrill via Gcc-patches
On 1/30/23 21:34, Marek Polacek wrote: On Mon, Jan 30, 2023 at 01:12:00PM -0500, Jason Merrill wrote: On 1/30/23 11:00, Marek Polacek wrote: On Fri, Jan 27, 2023 at 06:17:00PM -0500, Patrick Palka wrote: On Fri, 27 Jan 2023, Marek Polacek wrote: On Fri, Jan 27, 2023 at 05:15:00PM -0500, Patr

RE: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443]

2023-01-31 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Andre Vieira (lists) > Sent: Wednesday, January 25, 2023 5:41 PM > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ; Richard Earnshaw > > Subject: Re: [PATCH 3/3] arm: Fix MVE predicates synthesis [PR 108443] > > Looks like the first patch was missing a ch

Re: [PATCH] RISC-V: Add integer binary vv C/C++ API support

2023-01-31 Thread Kito Cheng via Gcc-patches
committed with comment log tweak, thanks! On Tue, Jan 31, 2023 at 8:07 PM wrote: > > From: Ju-Zhe Zhong > > --- > gcc/config/riscv/constraints.md | 10 + > gcc/config/riscv/iterators.md | 14 +- > gcc/config/riscv/predicates.md| 15 ++ > .../risc

Re: [PATCH] RISC-V: Add srl.vv C API tests

2023-01-31 Thread Kito Cheng via Gcc-patches
committed, thanks! On Tue, Jan 31, 2023 at 8:17 PM wrote: > > From: Ju-Zhe Zhong > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/base/vsrl_vv-1.c: New test. > * gcc.target/riscv/rvv/base/vsrl_vv-2.c: New test. > * gcc.target/riscv/rvv/base/vsrl_vv-3.c: New test. >

Re: [PATCH] RISC-V: Add vsra.vv C API tests

2023-01-31 Thread Kito Cheng via Gcc-patches
committed, thanks! On Tue, Jan 31, 2023 at 8:19 PM wrote: > > From: Ju-Zhe Zhong > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/base/vsra_vv-1.c: New test. > * gcc.target/riscv/rvv/base/vsra_vv-2.c: New test. > * gcc.target/riscv/rvv/base/vsra_vv-3.c: New test. >

Re: [PATCH] RISC-V: Add vsrl.vv C++ API tests

2023-01-31 Thread Kito Cheng via Gcc-patches
committed, thanks! On Tue, Jan 31, 2023 at 8:58 PM wrote: > > From: Ju-Zhe Zhong > > gcc/testsuite/ChangeLog: > > * g++.target/riscv/rvv/base/vsrl_vv-1.C: New test. > * g++.target/riscv/rvv/base/vsrl_vv-2.C: New test. > * g++.target/riscv/rvv/base/vsrl_vv-3.C: New test. >

Re: [PATCH] RISC-V: Add binop constraint tests

2023-01-31 Thread Kito Cheng via Gcc-patches
committed, thanks! On Tue, Jan 31, 2023 at 8:39 PM wrote: > > From: Ju-Zhe Zhong > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/base/binop_vv_constraint-1.c: New test. > > --- > .../riscv/rvv/base/binop_vv_constraint-1.c| 132 ++ > 1 file changed, 132 insert

Re: [PATCH] RISC-V: Add vsra.vv C++ API tests

2023-01-31 Thread Kito Cheng via Gcc-patches
committed, thanks! On Tue, Jan 31, 2023 at 9:00 PM wrote: > > From: Ju-Zhe Zhong > > gcc/testsuite/ChangeLog: > > * g++.target/riscv/rvv/base/vsra_vv-1.C: New test. > * g++.target/riscv/rvv/base/vsra_vv-2.C: New test. > * g++.target/riscv/rvv/base/vsra_vv-3.C: New test. >

Re: [PATCH] middle-end/108500 - replace recursive domtree DFS traversal

2023-01-31 Thread Richard Biener via Gcc-patches
> Am 31.01.2023 um 16:59 schrieb Jakub Jelinek via Gcc-patches > : > > On Tue, Jan 31, 2023 at 03:45:43PM +0100, Richard Biener wrote: >> The following replaces the recursive DFS traversal of the dominator >> tree in assign_dfs_numbers with a tree traversal using the fact >> that we have reco

[pushed] c++: Add fixed test [PR102870]

2023-01-31 Thread Marek Polacek via Gcc-patches
This was fixed by r12-7857: now we properly reject instead of crashing. PR c++/102870 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic184.C: New test. --- gcc/testsuite/g++.dg/cpp0x/variadic184.C | 12 1 file changed, 12 insertions(+) create mode 100644 gcc/testsui

[PATCH] PR tree-optimization/108356 - Ranger cache - always use range_from_dom when updating.

2023-01-31 Thread Andrew MacLeod via Gcc-patches
This turned out to be a more interesting problem than I wanted. the situation boils down to: # g_5 = PHI <0(2), 2(8)>   if (g_5 <= 1)     goto ; [INV] :   if (g_5 != 0)     goto ; [INV]   else     goto ; [INV]   :   c = 0;   :     goto ; [INV]  We globally know that g_5 is [0,0][2,2] we

[PATCH] c++: ICE with -Wlogical-op [PR107755]

2023-01-31 Thread Marek Polacek via Gcc-patches
Here we crash in the middle end because warn_logical_operator calls build_range_check which calls various fold_* functions and those don't work too well when we're still processing template trees. For instance here we crash because we're converting a RECORD_TYPE to bool. At this point VIEW_CONVERT

[PATCH] RISC-V: Add RVV shift.vx C/C++ API support

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/predicates.md (pmode_reg_or_uimm5_operand): New predicate. * config/riscv/riscv-vector-builtins-bases.cc: New class. * config/riscv/riscv-vector-builtins-functions.def (vsll): Ditto. (vsra): Ditto. (vsrl):

[PATCH] RISC-V: Add vsrl.vx C API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vsrl_vx-1.c: New test. * gcc.target/riscv/rvv/base/vsrl_vx-2.c: New test. * gcc.target/riscv/rvv/base/vsrl_vx-3.c: New test. * gcc.target/riscv/rvv/base/vsrl_vx_m-1.c: New test. * gcc.

[PATCH] RISC-V: Add vsra.vx C API tests

2023-01-31 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vsra_vx-1.c: New test. * gcc.target/riscv/rvv/base/vsra_vx-2.c: New test. * gcc.target/riscv/rvv/base/vsra_vx-3.c: New test. * gcc.target/riscv/rvv/base/vsra_vx_m-1.c: New test. * gcc.

  1   2   >