Re: [PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns

2022-10-26 Thread Uros Bizjak via Gcc-patches
On Wed, Oct 26, 2022 at 8:59 PM H.J. Lu wrote: > > In i386.md, neg patterns which set MODE_CC register like > > (set (reg:CCC FLAGS_REG) > (ne:CCC (match_operand:SWI48 1 "general_reg_operand") (const_int 0))) > > can lead to errors when operand 1 is a constant value. If FLAGS_REG in > > (set

Re: [PATCH V2] rs6000: Support to build constants by li/lis+oris/xoris

2022-10-26 Thread Jiufu Guo via Gcc-patches
Jiufu Guo writes: > index 000..ebd9ea88993 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr106708.c > @@ -0,0 +1,12 @@ > +/* PR target/106708 */ > +/* { dg-do compile } } */ Typo, should be: +/* { dg-do compile } */> BR, Jeff(Jiufu)

[PATCH v2] Add -gcodeview option

2022-10-26 Thread Mark Harmstone
Changed to double dashes as per https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604287.html. --- gcc/common.opt | 4 gcc/doc/invoke.texi | 7 +++ gcc/gcc.cc | 4 gcc/opts.cc | 3 +++ 4 files changed, 18 insertions(+) diff --git a/gcc/common.opt b/gcc/co

Re: [PATCH] Add -gcodeview option

2022-10-26 Thread Mark Harmstone
On 25/10/22 09:21, Martin Storsjö wrote: Btw, stylistically, should we strive towards using double dashes for the pdb option? I think that's the most canonical way for such getopt options (even though it doesn't make any practical difference). I've started trying to update various users to pref

Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend

2022-10-26 Thread Andrew Pinski via Gcc-patches
On Fri, Sep 23, 2022 at 2:26 AM Tamar Christina via Gcc-patches wrote: > > Hi All, > > This is an RFC to figure out how to deal with targets that don't have native > comparisons against QImode values. > > Booleans, at least in C99 and higher are 0-1 valued. This means that we only > really need t

Re: [PATCH 2/3]AArch64 Promote function arguments using a paradoxical subreg when beneficial.

2022-10-26 Thread Andrew Pinski via Gcc-patches
On Fri, May 13, 2022 at 10:14 AM Tamar Christina via Gcc-patches wrote: > > Hi All, > > The PROMOTE_MODE always promotes 8 and 16-bit parameters to 32-bits. > This promotion is not required for the ABI which states: > > > ``` > C.9 If the argument is an Integral or Pointer Type, the size of th

Re: [v4 PATCH 0/4] RISC-V: Support z*inx extensions.

2022-10-26 Thread Kito Cheng via Gcc-patches
Verified with qemu, committed to master, thanks! On Thu, Oct 20, 2022 at 5:43 PM jiawei wrote: > > Zfinx extension[1] had already ratified. Here is the > implementation patch set that reuse floating point pattern and ban > the use of fpr when use z*inx as a target. > > Current works can be find i

Re: [v4 PATCH 3/4] RISC-V: Limit regs use for z*inx extension.

2022-10-26 Thread Kito Cheng via Gcc-patches
Hmmm 2 issue, but I fixed that anyway, otherwise LGTM. > From: Jiawei > > Limit z*inx abi support with 'ilp32','ilp32e','lp64' only. > Use GPR instead FPR when 'zfinx' enable, Only use even registers > in RV32 when 'zdinx' enable. > Enable FLOAT16 when Zhinx/Zhinxmin enabled. > > Co-Authored-By:

Re: [PATCH v3] Re: OpenMP: Generate SIMD clones for functions with "declare target"

2022-10-26 Thread Sandra Loosemore
On 10/20/22 08:07, Jakub Jelinek wrote: Thus, IMHO it is exactly the pass_omp_simd_clone pass where you want to implement this auto-simdization discovery, guarded with #ifdef ACCEL_COMPILER and the new option (which means it will be done only for gcn and not on the host right now). I'm running

[committed] wwwdocs: style: Remove link to validator.w3.org in footer

2022-10-26 Thread Gerald Pfeifer
Martin reported that the link to validator.w3.org we had on every page (hidden in the footer) is not working any more. This used to be a nice feature, where following that link "hidden" in a full stop would validate the respective page. Alas due to abuse by marketing tools and increased focus on p

Re: [PATCH zero-call-used-regs] Add leafy mode for zero-call-used-regs

2022-10-26 Thread Alexandre Oliva via Gcc-patches
On Oct 25, 2022, Qing Zhao wrote: >> 'all' for leaf functions is likely wasteful. If no other functions are >> called, one can determine exactly which registers might carry >> information out and thus need zeroing, and 'used' is thus likely enough, >> depending on the purpose of register scrubbi

[committed] analyzer: fixes to file-descriptor handling

2022-10-26 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-3515-g57bbf3a403bb1e. gcc/analyzer/ChangeLog: * sm-fd.cc (fd_state_machine::on_open): Transition to "unchecked" when the mode is symbolic, rather than just on integer constants. (fd_state_

[committed] analyzer: add sm-fd.dot

2022-10-26 Thread David Malcolm via Gcc-patches
Add a .dot file to document the file descriptor state machine. gcc/analyzer/ChangeLog: * sm-fd.dot: New file. Signed-off-by: David Malcolm --- gcc/analyzer/sm-fd.dot | 109 + 1 file changed, 109 insertions(+) create mode 100644 gcc/analyzer/sm-fd

Re: Rust frontend patches v3

2022-10-26 Thread David Malcolm via Gcc-patches
On Wed, 2022-10-26 at 10:17 +0200, arthur.co...@embecosm.com wrote: > This is the fixed version of our previous patch set for gccrs - We've > adressed > the comments raised in our previous emails. [...snip...] (Caveat: I'm not a global reviewer) Sorry if this is answered in the docs in the patch

Re: [PATCH Rust front-end v3 35/46] gccrs: Add metadata ouptput pass

2022-10-26 Thread David Malcolm via Gcc-patches
%{On Wed, 2022-10-26 at 10:18 +0200, arthur.co...@embecosm.com wrote: > From: Philip Herron > > Extern crates statements to tell the front-end to look for another > library. > The mechanism here is heavily inspired from gccgo, so when we compile > a > library for example we invoke: > [...snip..

Re: [PATCH Rust front-end v3 20/46] gccrs: Add wrapper for make_unique

2022-10-26 Thread David Malcolm via Gcc-patches
On Wed, 2022-10-26 at 10:17 +0200, arthur.co...@embecosm.com wrote: > From: Philip Herron > > This is a wrapper for make_unique we can likely get rid of this as > there > are other implementations available or simply keep using the > unique_ptr > constructor. [CCing Jonathan] As it happens, I j

[PATCH v3] Add gcc/make-unique.h

2022-10-26 Thread David Malcolm via Gcc-patches
Changed in v3: added include of v2: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604137.html v1: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598189.html On Tue, 2022-07-12 at 07:48 +0100, Jonathan Wakely wrote: > On Tue, 12 Jul 2022, 01:25 David Malcolm, > wrote: > > > On Fri,

Re: [PATCH] IRA: Make sure array is big enough

2022-10-26 Thread Vladimir Makarov via Gcc-patches
On 2022-10-25 06:01, Torbjörn SVENSSON wrote: In commit 081c96621da, the call to resize_reg_info() was moved before the call to remove_scratches() and the latter one can increase the number of regs and that would cause an out of bounds usage on the reg_renumber global array. Without this patch

Re: [PATCH v3] bpf: add preserve_field_info builtin

2022-10-26 Thread David Faust via Gcc-patches
On 10/26/22 12:33, Jose E. Marchesi wrote: > > Hi David. > > Thanks for the updates. > OK for master. > Pushed, thanks.

Re: [PATCH] Fortran: BOZ literal constants are not compatible to any type [PR103413]

2022-10-26 Thread Mikael Morin
Hello, Le 26/10/2022 à 21:15, Harald Anlauf via Fortran a écrit : Dear all, a BOZ as source-expression in an ALLOCATE statement could lead to an ICE when the allocate-object was a CLASS variable. Since a BOZ has no type, we can handle it as type incompatible with any type. This is also what th

Re: [PATCH v3] bpf: add preserve_field_info builtin

2022-10-26 Thread Jose E. Marchesi via Gcc-patches
Hi David. Thanks for the updates. OK for master. >>> I'm not sure whether this behavior is a known limitation or an >>> oversight. In my opinion it makes more sense to error at compile time, >>> becuase even after the loader patches the return value it still will >>> not be correct for these ca

[PATCH v3] bpf: add preserve_field_info builtin

2022-10-26 Thread David Faust via Gcc-patches
>> I'm not sure whether this behavior is a known limitation or an >> oversight. In my opinion it makes more sense to error at compile time, >> becuase even after the loader patches the return value it still will >> not be correct for these cases. >> >> So for now I've set these cases to error out,

[PATCH] Fortran: BOZ literal constants are not compatible to any type [PR103413]

2022-10-26 Thread Harald Anlauf via Gcc-patches
Dear all, a BOZ as source-expression in an ALLOCATE statement could lead to an ICE when the allocate-object was a CLASS variable. Since a BOZ has no type, we can handle it as type incompatible with any type. This is also what the Cray compiler does for the code in the testcase. Regtested on x86_

[PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns

2022-10-26 Thread H.J. Lu via Gcc-patches
In i386.md, neg patterns which set MODE_CC register like (set (reg:CCC FLAGS_REG) (ne:CCC (match_operand:SWI48 1 "general_reg_operand") (const_int 0))) can lead to errors when operand 1 is a constant value. If FLAGS_REG in (set (reg:CCC FLAGS_REG) (ne:CCC (const_int 2) (const_int 0)))

Re: [PATCH v4] c++: Implement -Wdangling-reference [PR106393]

2022-10-26 Thread Jason Merrill via Gcc-patches
On 10/26/22 14:26, Marek Polacek wrote: On Wed, Oct 26, 2022 at 12:42:27PM -0400, Jason Merrill wrote: On 10/26/22 12:10, Marek Polacek wrote: As before, I've tested this patch twice, once with -Wdangling-reference enabled by default, once with -Wdangling-reference enabled by -Wextra. The coupl

[PATCH v4] c++: Implement -Wdangling-reference [PR106393]

2022-10-26 Thread Marek Polacek via Gcc-patches
On Wed, Oct 26, 2022 at 12:42:27PM -0400, Jason Merrill wrote: > On 10/26/22 12:10, Marek Polacek wrote: > > As before, I've tested this patch twice, once with -Wdangling-reference > > enabled by default, once with -Wdangling-reference enabled by -Wextra. > > The couple of FAILs I saw were true pos

RE: [PATCH] [X86_64]: Enable support for next generation AMD Zen4 CPU

2022-10-26 Thread Alexander Monakov
On Wed, 26 Oct 2022, Kumar, Venkataramanan wrote: > > Looking at znver1.md again, I think the problem is caused by incorrect > > modeling of division instructions: they have descriptions like > > > > (define_insn_reservation "znver1_idiv_DI" 41 > > (and (eq_attr "cpu" "znve

Re: [PING] options: Clarify 'Init' option property usage for streaming optimization (was: [PATCH] options, lto: Optimize streaming of optimization nodes)

2022-10-26 Thread Joseph Myers
On Wed, 26 Oct 2022, Thomas Schwinge wrote: > Hi! > > Ping. For convenience, I've re-attached > "options: Clarify 'Init' option property usage for streaming optimization". > (I've re-verified: "No functional change; no change in generated files.") OK. -- Joseph S. Myers jos...@codesourcery.co

RE: [PATCH] [X86_64]: Enable support for next generation AMD Zen4 CPU

2022-10-26 Thread Kumar, Venkataramanan via Gcc-patches
[AMD Official Use Only - General] Hi Alexander, Thank you for looking in to this issue. > -Original Message- > From: Alexander Monakov > Sent: Tuesday, October 25, 2022 12:18 AM > To: Jan Hubička > Cc: Kumar, Venkataramanan ; Jakub > Jelinek ; Richard Biener > ; Joshi, Tejas Sanjay > ;

Re: [PATCH] xtensa: Fix out-of-bounds array access

2022-10-26 Thread Max Filippov via Gcc-patches
On Tue, Oct 25, 2022 at 11:27 PM Takayuki 'January June' Suwa wrote: > > On 2022/10/26 5:09, Jan-Benedict Glaw wrote: > > I didn't yet actually check the warning, it may be bogus. > > This "problem" can occur in the following two places calling > xtensa_split_DI_reg_imm(): > > - (define_expand "m

Re: [PATCH] c++: Fix excess precision related ICE on invalid binop [PR107382, PR107383]

2022-10-26 Thread Jason Merrill via Gcc-patches
On 10/26/22 04:23, Jakub Jelinek wrote: Hi! The following tests ICE in the gcc_assert (common); in cp_build_binary_op. I've missed that while for * common is set always, while for +, - and / it is in some cases not. If it is not, then if (!result_type && arithmetic_types_p && (s

Re: [PATCH v3] c++: Implement -Wdangling-reference [PR106393]

2022-10-26 Thread Jason Merrill via Gcc-patches
On 10/26/22 12:10, Marek Polacek wrote: On Tue, Oct 25, 2022 at 11:53:51AM -0400, Jason Merrill via Gcc-patches wrote: On 10/25/22 11:21, Marek Polacek wrote: On Mon, Oct 24, 2022 at 01:30:42PM -0400, Jason Merrill wrote: On 10/21/22 19:28, Marek Polacek wrote: It doesn't warn when the functi

Re: [PATCH v3] c++: parser - Support for target address spaces in C++

2022-10-26 Thread Jason Merrill via Gcc-patches
On 10/26/22 03:18, Paul Iannetta wrote: On Wed, Oct 19, 2022 at 02:55:21PM -0400, Jason Merrill wrote: On 10/18/22 13:01, Paul Iannetta wrote: Thank you very much for the detailed review. On Tue, Oct 18, 2022 at 10:24:23AM -0400, Jason Merrill wrote: On 10/18/22 03:37, Paul Iannetta wrote: O

[PATCH v3] c++: Implement -Wdangling-reference [PR106393]

2022-10-26 Thread Marek Polacek via Gcc-patches
On Tue, Oct 25, 2022 at 11:53:51AM -0400, Jason Merrill via Gcc-patches wrote: > On 10/25/22 11:21, Marek Polacek wrote: > > On Mon, Oct 24, 2022 at 01:30:42PM -0400, Jason Merrill wrote: > > > On 10/21/22 19:28, Marek Polacek wrote: > > > > It doesn't warn when the function in question is a member

Re: [PATCH] ipa-visibility: remove assert in TLS optimization [PR107353]

2022-10-26 Thread Martin Jambor
Hi, On Wed, Oct 26 2022, Alexander Monakov wrote: > When upgrading TLS access model based on optimized symbol visibility > status, we attempted to assert that recomputing the model would not > weaken it. It turns out that C, C++, and Fortran front-ends all can > (unintentionally) assign a stronger

Re: [PATCH 10/15 V2] arm: Implement cortex-M return signing address codegen

2022-10-26 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 14/09/2022 15:20, Andrea Corallo via Gcc-patches wrote: >> Hi all, >> >> this patch enables address return signature and verification based on >> Armv8.1-M Pointer Authentication [1]. >> >> To sign the return address, we use the PAC R12, LR, SP instruction >> upon

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-10-26 Thread Richard Sandiford via Gcc-patches
Sorry for the slow response. I wanted to find some time to think about this a bit more. Prathamesh Kulkarni writes: > On Fri, 30 Sept 2022 at 21:38, Richard Sandiford > wrote: >> >> Richard Sandiford via Gcc-patches writes: >> > Prathamesh Kulkarni writes: >> >> Sorry to ask a silly question

Re: RFC - VRP1 default mode

2022-10-26 Thread Jeff Law via Gcc-patches
On 10/26/22 08:24, Andrew MacLeod wrote: Figured I would ask what you guys think of making ranger the default for the VRP1 pass now. With partial equivalences and the other bits I checked in the past few weeks I'm not aware of much that the legacy VRP pass gets that ranger doesn't.  The onl

RFC - VRP1 default mode

2022-10-26 Thread Andrew MacLeod via Gcc-patches
Figured I would ask what you guys think of making ranger the default for the VRP1 pass now. With partial equivalences and the other bits I checked in the past few weeks I'm not aware of much that the legacy VRP pass gets that ranger doesn't.  The only exception to that which I am aware of is t

[PATCH] ipa-visibility: remove assert in TLS optimization [PR107353]

2022-10-26 Thread Alexander Monakov
When upgrading TLS access model based on optimized symbol visibility status, we attempted to assert that recomputing the model would not weaken it. It turns out that C, C++, and Fortran front-ends all can (unintentionally) assign a stronger model than what can be derived from the declaration. Let'

[COMMITTED] Check if varying may also be non-negative.

2022-10-26 Thread Andrew MacLeod via Gcc-patches
When strict enums are in use, we don't always get ranges reduced sufficiently thru casts and such.  Ranger vrp has been missing the odd case because I didn't notice that gimple_stmt_nonnegative_warnv_p() use to be called on all integral results that were varying, not just calls like it was doin

[PING] options: Clarify 'Init' option property usage for streaming optimization (was: [PATCH] options, lto: Optimize streaming of optimization nodes)

2022-10-26 Thread Thomas Schwinge
Hi! Ping. For convenience, I've re-attached "options: Clarify 'Init' option property usage for streaming optimization". (I've re-verified: "No functional change; no change in generated files.") Grüße Thomas On 2022-03-31T15:22:59+0200, I wrote: > Hi! > > On 2020-11-18T10:36:35+0100, Jakub Je

Document 'distclean-stage[N]'

2022-10-26 Thread Thomas Schwinge
Hi! OK to push the attached patch to "Document 'distclean-stage[N]'"? Grüße Thomas - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesells

[PATCH V2] rs6000: Support to build constants by li/lis+oris/xoris

2022-10-26 Thread Jiufu Guo via Gcc-patches
Hi, PR106708 constaint some constants which can be support by li/lis + oris/xoris. For constant C: if '(c & 0x80008000ULL) == 0x8000ULL' or say: 32(0) || 1(1) || 15(x) || 1(0) || 15(x), we could use li+oris to build constant 'C'. Here N(M) means N continuous bit M, x for M means it is

RE: [PATCH] ix86: Suggest unroll factor for loop vectorization

2022-10-26 Thread Cui, Lili via Gcc-patches
Hi Richard, > +@item x86-vect-unroll-min-ldst-threshold > +The vectorizer will check with target information to determine whether > +unroll it. This parameter is used to limit the mininum of loads and > +stores in the main loop. > > It's odd to "limit" the minimum number of something. I think th

Re: [PATCH] Aarch64: Do not define DONT_USE_BUILTIN_SETJMP

2022-10-26 Thread Richard Sandiford via Gcc-patches
Eric Botcazou via Gcc-patches writes: > Hi, > > we have been using an Ada compiler for the Aarch64 architecture configured > with SJLJ exceptions as for the other architectures for some time, and have > not run into any problems so far so the setting looks obsolete now. > > OK for the mainline?

[PATCH] docs: document sanitizers can trigger warnings

2022-10-26 Thread Martin Liška
PR sanitizer/107298 gcc/ChangeLog: * doc/invoke.texi: Document sanitizers can trigger warnings. --- gcc/doc/invoke.texi | 4 1 file changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 64f77e8367a..1ffbba16a72 100644 --- a/gcc/doc/invoke.tex

Re: [PATCH] [x86_64] Zhaoxin lujiazui enablement

2022-10-26 Thread Martin Liška
On 10/26/22 11:06, Mayshao-oc wrote: > > Hi Martin: >     Thanks for your patch,  I comment the questions below. Hi. :) > >> Hello. > >> I noticed this patch set which is kind of related to >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107364. > >> And I have a couple of questions: > >>1

Re: [PATCH] OpenMP: Duplicate checking for map clauses in Fortran (PR107214)

2022-10-26 Thread Tobias Burnus
Hi Julian, I had a first quick lock at this patch, I should have a closer look later. However, I stumbled over the following: On 20.10.22 18:14, Julian Brown wrote: typedef struct gfc_symbol { ... struct gfc_symbol *old_symbol; unsigned mark:1, comp_mark:1, data_mark:1, dev_mark:1, gen_m

[OG12][committed] Handle operator new with alignment in USM transform

2022-10-26 Thread Hafiz Abid Qadeer
This patch fixes an issue where alignment argument for new operator was being ignored in the unified shared memory transform. Thanks, -- Hafiz Abid Qadeer Siemens/CodeSourceryFrom af4162aac4086eb953139f7796bbb2ad232c8975 Mon Sep 17 00:00:00 2001 From: Hafiz Abid Qadeer Date: Tue, 25 Oct 2022 15

Re: [PATCH 1/2] Allow subtarget customization of CC1_SPEC

2022-10-26 Thread Sebastian Huber
On 04/10/2022 11:47, Sebastian Huber wrote: On 08/09/2022 07:33, Sebastian Huber wrote: On 04/08/2022 15:02, Sebastian Huber wrote: On 22/07/2022 15:02, Sebastian Huber wrote: gcc/ChangeLog: * gcc.cc (SUBTARGET_CC1_SPEC): Define if not defined. (CC1_SPEC): Define to SUBTARGET_CC1_SPEC

Re: [PATCH] [x86_64] Zhaoxin lujiazui enablement

2022-10-26 Thread Mayshao-oc
Hi Martin: Thanks for your patch, I comment the questions below. > Hello. > I noticed this patch set which is kind of related to > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107364. > And I have a couple of questions: >1) I noticed you drop AVX and F16C features for the newly added "l

Re: [PATCH] RISC-V: Fix a mistake in previous patch.

2022-10-26 Thread Kito Cheng via Gcc-patches
Committed with title tweak, thanks On Tue, Oct 25, 2022 at 9:53 PM wrote: > > From: Ju-Zhe Zhong > > I noticed that I have made a mistake in previous patch: > > https://patchwork.sourceware.org/project/gcc/patch/20220817071950.271762-1-juzhe.zh...@rivai.ai/ > > The previous statement before

Re: [PATCH] RISC-V: Support load/store in mov pattern for RVV modes.

2022-10-26 Thread Kito Cheng via Gcc-patches
Verified and committed to trunk, thanks! And don't forgot changelog next time :P On Mon, Oct 24, 2022 at 10:09 AM wrote: > > From: Ju-Zhe Zhong > > --- > gcc/config.gcc| 2 +- > gcc/config/riscv/constraints.md | 22 + > gcc/config/riscv/predicate

Re: [PATCH 9/15] arm: Set again stack pointer as CFA reg when popping if necessary

2022-10-26 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 27/09/2022 16:24, Kyrylo Tkachov via Gcc-patches wrote: >> >>> -Original Message- >>> From: Andrea Corallo >>> Sent: Tuesday, September 27, 2022 11:06 AM >>> To: Kyrylo Tkachov >>> Cc: Andrea Corallo via Gcc-patches ; Richard >>> Earnshaw ; nd >>> Subject

Re: [PATCH] RISC-V: Fix typo.

2022-10-26 Thread Kito Cheng via Gcc-patches
Committed with title tweak , thanks On Mon, Oct 24, 2022 at 10:24 PM wrote: > > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * config/riscv/riscv-modes.def (ADJUST_BYTESIZE): Fix typo. > > --- > gcc/config/riscv/riscv-modes.def | 46 > 1 file changed, 23 in

[PATCH] c++: Fix excess precision related ICE on invalid binop [PR107382, PR107383]

2022-10-26 Thread Jakub Jelinek via Gcc-patches
Hi! The following tests ICE in the gcc_assert (common); in cp_build_binary_op. I've missed that while for * common is set always, while for +, - and / it is in some cases not. If it is not, then if (!result_type && arithmetic_types_p && (shorten || common || short_compare)) condition

Re: [PATCH Rust front-end v3 01/46] Use DW_ATE_UTF for the Rust 'char' type

2022-10-26 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 26, 2022 at 10:17:26AM +0200, arthur.co...@embecosm.com wrote: > @@ -25201,6 +25215,13 @@ gen_compile_unit_die (const char *filename) > } >else if (strcmp (language_string, "GNU F77") == 0) > language = DW_LANG_Fortran77; > + else if (strcmp (language_string, "GNU Rust")

[PATCH Rust front-end v3 46/46] gccrs: Add README, CONTRIBUTING and compiler logo

2022-10-26 Thread arthur . cohen
From: Philip Herron We still need to write out documentation section but these README's will help in the mean time. --- gcc/rust/CONTRIBUTING.md | 130 +++ gcc/rust/README.md | 264 +++ gcc/rust/logo.png| Bin 0 -> 70864 bytes 3 f

[PATCH Rust front-end v3 44/46] gccrs: Add compiler driver

2022-10-26 Thread arthur . cohen
From: Philip Herron Our compiler driver is pretty simple so far, the key piece to enforce is that a compilation unit in Rust is the whole crate so the process for compiling rust means pointing the compiler at the main entry point such as src/lib.rs or src/main.rs where the expansion pass takes ov

[PATCH Rust front-end v3 43/46] gccrs: Add lang.opt

2022-10-26 Thread arthur . cohen
From: Philip Herron We have some rust specific langugage options note -fwrapv is enabled by default in the code. We are trying to respect options such as -Wunused-result which we get by porting over c++ no-discard for rust's must-use attribute, so we have enabled these by default directly here. -

[PATCH Rust front-end v3 42/46] gccrs: Add lang-spec.h

2022-10-26 Thread arthur . cohen
From: Philip Herron This specifies the extensions of the Rust language. --- gcc/rust/lang-specs.h | 26 ++ 1 file changed, 26 insertions(+) create mode 100644 gcc/rust/lang-specs.h diff --git a/gcc/rust/lang-specs.h b/gcc/rust/lang-specs.h new file mode 100644 index 000

[PATCH Rust front-end v3 39/46] gccrs: These are wrappers ported from reusing gccgo

2022-10-26 Thread arthur . cohen
From: Philip Herron The wrappers over linemap and location will eventually disappear here but served as a useful starting point for us. We have wrappers over the diagnostics system which we might be able to get rid of as well. --- gcc/rust/rust-diagnostics.cc | 244 ++

Re: [PATCH] RISC-V: Recognized Svinval and Svnapot extensions

2022-10-26 Thread Kito Cheng via Gcc-patches
verified and committed On Tue, Oct 25, 2022 at 2:18 PM Monk Chiang wrote: > > gcc/ChangeLog: > > * common/config/riscv/riscv-common.cc (riscv_ext_version_table): > Add svinval and svnapot extension. > (riscv_ext_flag_table): Ditto. > * config/riscv/riscv-opts.h (MA

[PATCH Rust front-end v3 40/46] gccrs: Add GCC Rust front-end Make-lang.in

2022-10-26 Thread arthur . cohen
From: Philip Herron This is the Makefile for our front-end. --- gcc/rust/Make-lang.in | 399 ++ 1 file changed, 399 insertions(+) create mode 100644 gcc/rust/Make-lang.in diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in new file mode 100644 ind

[PATCH Rust front-end v3 35/46] gccrs: Add metadata ouptput pass

2022-10-26 Thread arthur . cohen
From: Philip Herron Extern crates statements to tell the front-end to look for another library. The mechanism here is heavily inspired from gccgo, so when we compile a library for example we invoke: gccrs -g -O2 -frust-crate=mylib -c src/lib.rs -o src/mylib.o All going well this object file w

Re: [PATCH] RISC-V: Add h extension support

2022-10-26 Thread Kito Cheng via Gcc-patches
Thanks for the review, committed :) On Mon, Oct 24, 2022 at 11:05 PM Jeff Law via Gcc-patches wrote: > > > On 10/24/22 03:55, Kito Cheng wrote: > > `h` was the prefix of multi-letter extension name, but it become a > > extension in later RISC-V isa spec. > > > > Fortunately we don't have any exte

Re: [PATCH] i386: Enable small loop unrolling for O2

2022-10-26 Thread Hongyu Wang via Gcc-patches
> Does this setting benefit all targets? IIRC, in the past all > benchmarks also enabled -funroll-loops, so it looks to me that > unrolling small loops by default is a good compromise. The idea to unroll small loops can be explained from the x86 micro-architecture. Modern x86 processors has multi

[PATCH Rust front-end v3 32/46] gccrs: Add privacy checks

2022-10-26 Thread arthur . cohen
From: Arthur Cohen This pass is responsible for resolving the privacy of items and verifying that access to these items is performed within the limits of that privacy. By default, items in Rust are private and only public to the current module and its submodules. However, the user can annotate an

[PATCH Rust front-end v3 45/46] gccrs: Compiler proper interface kicks off the pipeline

2022-10-26 Thread arthur . cohen
From: Philip Herron This is a wrapper to get out of C land in the rust-lang.cc and into our class hierarchy for the rust front-end. We expect that the front-end only support one source file input as the expansion pass will attempt to resolve that relative pass and parse accordingly. The main mis

[PATCH Rust front-end v3 33/46] gccrs: Add dead code scan on HIR

2022-10-26 Thread arthur . cohen
From: Thomas Young In order to find dead code we use a depth first search and keep liveness variables, after type resolution. In this case, if a function is unused and it calls another function the 2nd function is now unused since the caller is not used etc. The algorithm is a depth first search.

[PATCH Rust front-end v3 34/46] gccrs: Add unused variable scan

2022-10-26 Thread arthur . cohen
From: Philip Herron This is a simple walk_tree which acts on the monomorphized code. By walking the compiled translation unit of functions. --- gcc/rust/checks/lints/rust-lint-unused-var.cc | 98 +++ gcc/rust/checks/lints/rust-lint-unused-var.h | 36 +++ 2 files changed, 134

[PATCH Rust front-end v3 41/46] gccrs: Add config-lang.in

2022-10-26 Thread arthur . cohen
From: Philip Herron This was a copy paste from gccgo front-end, we do not use any of the target_libs yet but we will need these when we support the libpanic crate. --- gcc/rust/config-lang.in | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 gcc/rust/c

[PATCH Rust front-end v3 30/46] gccrs: Add unsafe checks for Rust

2022-10-26 Thread arthur . cohen
From: Arthur Cohen The UnsafeChecker visitor verifies that unsafe actions are only performed in unsafe contexts. Otherwise, an error should be reported to the user and the compilation pipeline should be halted. These contexts, which include unsafe blocks or unsafe functions, are allowed to perfor

[PATCH Rust front-end v3 21/46] gccrs: Add port of FNV hash used during legacy symbol mangling

2022-10-26 Thread arthur . cohen
From: Philip Herron This hash was ported from the go runime as we needed a hash for the legacy symbol mangling system. Which means all symbols in Rust contain a hash of some metadata for uniqueness on generic functions. --- gcc/rust/util/fnv-hash.h | 95

[PATCH Rust front-end v3 28/46] gccrs: Add Rust type information

2022-10-26 Thread arthur . cohen
From: Philip Herron Contains abstractions over Rust's types, used when performing the HIR's type-resolution. --- gcc/rust/typecheck/rust-tyty.cc | 2885 +++ gcc/rust/typecheck/rust-tyty.h | 2533 +++ 2 files changed, 5418 insertions(+) create

[PATCH Rust front-end v3 38/46] gccrs: Add HIR to GCC GENERIC lowering entry point

2022-10-26 Thread arthur . cohen
From: Philip Herron This patch contains the entry point and utilities used for the lowering of HIR nodes to `tree`s. It also contains a constant evaluator, ported over from the C++ frontend. Co-authored-by: David Faust Co-authored-by: Faisal Abbas <90.abbasfai...@gmail.com> --- gcc/rust/backen

[PATCH Rust front-end v3 26/46] gccrs: Add helpers mappings canonical path and lang items

2022-10-26 Thread arthur . cohen
From: Philip Herron These are various helper classes used in the compiler pipeline. --- gcc/rust/util/rust-canonical-path.h | 195 + gcc/rust/util/rust-common.h | 53 ++ gcc/rust/util/rust-hir-map.cc | 980 ++ gcc/rust/util/rust-hir-map.h

[PATCH Rust front-end v3 25/46] gccrs: Add attributes checker

2022-10-26 Thread arthur . cohen
From: Arthur Cohen The attribute checker is responsible for checking the validity of various attributes including built-in ones. It is currently unfinished and will receive some modifications, as well as become the host of some existing code in the compiler which needs to be refactored. One of it

[PATCH Rust front-end v3 31/46] gccrs: Add const checker

2022-10-26 Thread arthur . cohen
From: Arthur Cohen Similarly to the unsafe checker, constant evaluation can only be performed in a few contexts and include restrictions on the Rust language. Should the user fail to uphold those conditions, errors will be reported and the compilation pipeline interrupted. These contexts are as

[PATCH Rust front-end v3 23/46] gccrs: Add Base62 implementation

2022-10-26 Thread arthur . cohen
From: Arthur Cohen Used for V0 symbol mangling scheme which. --- gcc/rust/util/rust-base62.cc | 46 gcc/rust/util/rust-base62.h | 34 ++ 2 files changed, 80 insertions(+) create mode 100644 gcc/rust/util/rust-base62.cc create mode 1

[PATCH Rust front-end v3 24/46] gccrs: Add implementation of Optional

2022-10-26 Thread arthur . cohen
From: Arthur Cohen Add an Optional class to improve error handling --- gcc/rust/util/rust-optional-test.cc | 110 +++ gcc/rust/util/rust-optional.h | 278 2 files changed, 388 insertions(+) create mode 100644 gcc/rust/util/rust-optional-test.cc create

[PATCH Rust front-end v3 22/46] gccrs: Add Rust ABI enum helpers

2022-10-26 Thread arthur . cohen
From: Philip Herron This is a simple helper over an enum of possible ABI options in Rust. --- gcc/rust/util/rust-abi.cc | 72 +++ gcc/rust/util/rust-abi.h | 45 2 files changed, 117 insertions(+) create mode 100644 gcc/rust/util/rust

[PATCH Rust front-end v3 18/46] gccrs: Add HIR definitions and visitor framework

2022-10-26 Thread arthur . cohen
From: Philip Herron This patch implements the classes mentionned in the previous HIR patch, as well as a set of visitor frameworks used in handling that HIR. --- gcc/rust/hir/tree/rust-hir-full-decls.h | 232 + gcc/rust/hir/tree/rust-hir-full-test.cc | 5292 +++ gcc/rust/hir

[PATCH Rust front-end v3 20/46] gccrs: Add wrapper for make_unique

2022-10-26 Thread arthur . cohen
From: Philip Herron This is a wrapper for make_unique we can likely get rid of this as there are other implementations available or simply keep using the unique_ptr constructor. --- gcc/rust/util/rust-make-unique.h | 35 1 file changed, 35 insertions(+) create m

[PATCH Rust front-end v3 09/46] gccrs: Add definitions of Rust Items in AST data structures

2022-10-26 Thread arthur . cohen
From: The Other This adds the proper definitions of our AST Item nodes. Co-authored-by: Philip Herron --- gcc/rust/ast/rust-item.h | 4382 ++ 1 file changed, 4382 insertions(+) create mode 100644 gcc/rust/ast/rust-item.h diff --git a/gcc/rust/ast/rust-item

[PATCH Rust front-end v3 12/46] gccrs: Add Lexer for Rust front-end

2022-10-26 Thread arthur . cohen
From: The Other The lexer is refered to as a ManagedTokenSource within the parser, this lexer does not currently support unicode but serves as a starting point to do so. Co-authored-by: Philip Herron Co-authored-by: Arthur Cohen Co-authored-by: Mark Wielaard --- gcc/rust/lex/rust-codepoint.h

[PATCH Rust front-end v3 03/46] gccrs: Add Debug info testsuite

2022-10-26 Thread arthur . cohen
From: Philip Herron This testsuite is specifically about testcases which scan the asm debug info for results. Co-authored-by: Tom Tromey --- gcc/testsuite/rust/debug/chartype.rs | 10 ++ .../rust/debug/custom_link_section.rs | 13 gcc/testsuite/rust/debug/debug.ex

[PATCH Rust front-end v3 07/46] gccrs: Add gcc-check-target check-rust

2022-10-26 Thread arthur . cohen
From: Philip Herron This allows us to invoke the rust testsuite. ChangeLog: * Makefile.def: Add Rust language. * Makefile.in: Regenerate via autogen. --- Makefile.def | 1 + Makefile.in | 8 2 files changed, 9 insertions(+) diff --git a/Makefile.def b/Makefile.def ind

[PATCH Rust front-end v3 11/46] gccrs: Add Rust AST visitors

2022-10-26 Thread arthur . cohen
From: The Other This patch contains the basic framework of our AST visitors, as well as one aimed at pretty-printing and exporting these AST nodes Co-authored-by: Philip Herron Co-authored-by: Arthur Cohen --- gcc/rust/ast/rust-ast-dump.cc| 1089 ++ gcc/rust/as

[PATCH Rust front-end v3 02/46] gccrs: Add nessecary hooks for a Rust front-end testsuite

2022-10-26 Thread arthur . cohen
From: Philip Herron This copy's over code from other front-end testsuites to enable testing for the rust front-end specifically. Co-authored-by: Marc Poulhiès Co-authored-by: Thomas Schwinge --- gcc/testsuite/lib/rust-dg.exp | 49 + gcc/testsuite/lib/rust.exp| 186 +++

[PATCH Rust front-end v3 04/46] gccrs: Add link cases testsuite

2022-10-26 Thread arthur . cohen
From: Philip Herron This testsuite is heavily inspired from the lto testsuite which uses a pattern that each file is compiled to an object file and finally linked together. Since rust does not have headers/prototypes we rely on the ordering here so that all files numbered greater than zero get co

[PATCH Rust front-end v3 06/46] gccrs: Add execution test cases

2022-10-26 Thread arthur . cohen
From: Philip Herron This is similar to the compile/torture/*.rs test cases but all of these are dg-execute testcases so they get compiled, linked and executed by default, all the while being compiled with the matrix of torture options. The only caveat here is that currently gccrs does not curren

Rust frontend patches v3

2022-10-26 Thread arthur . cohen
This is the fixed version of our previous patch set for gccrs - We've adressed the comments raised in our previous emails. This patch set does not contain any work that was not previously included, such as closure support, the constant evaluator port, or the better implementation of target hooks b

[PATCH Rust front-end v3 01/46] Use DW_ATE_UTF for the Rust 'char' type

2022-10-26 Thread arthur . cohen
From: Tom Tromey The Rust 'char' type should use the DWARF DW_ATE_UTF encoding. --- gcc/dwarf2out.cc | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index e3920c898f5..a8bccbabca4 100644 --- a/gcc/dwarf2out.cc +++ b/

Re: [PATCH] [PR tree-optimization/107394] Canonicalize global franges as they are read back.

2022-10-26 Thread Aldy Hernandez via Gcc-patches
Updated tested patch. Aldy On Tue, Oct 25, 2022 at 11:02 PM Aldy Hernandez wrote: > > [Richi/Jakub/FP experts, does this sound like the right solution, or am I > missing some subtle IPA/inlining issue?] > > The problem here is that we're inlining a global range with NANs into > a function that h

[PATCH] riscv/RTEMS: Add RISCV_GCOV_TYPE_SIZE

2022-10-26 Thread Sebastian Huber
The RV32A extension does not support 64-bit atomic operations. For RTEMS, use a 32-bit gcov type for RV32. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_gcov_type_size): New. (TARGET_GCOV_TYPE_SIZE): Likewise. * config/riscv/rtems.h (RISCV_GCOV_TYPE_SIZE): New. --- gcc/c

Re: [PATCH v3] c++: parser - Support for target address spaces in C++

2022-10-26 Thread Paul Iannetta via Gcc-patches
On Wed, Oct 19, 2022 at 02:55:21PM -0400, Jason Merrill wrote: > On 10/18/22 13:01, Paul Iannetta wrote: > > Thank you very much for the detailed review. > > > > On Tue, Oct 18, 2022 at 10:24:23AM -0400, Jason Merrill wrote: > > > On 10/18/22 03:37, Paul Iannetta wrote: > > > > On Fri, Oct 14, 202