Re: [PATCH] gcc: m68k: fix PR target/107645

2022-11-12 Thread Max Filippov via Gcc-patches
On Sat, Nov 12, 2022 at 11:42 AM Jeff Law wrote: > ISTM that we'd need to strip the unspec and process its argument > instead. I tried that first, the result was more ICEs because that pattern wasn't recognized at later stages. Then I read the change to the comment over the symbolic_operand predi

[r13-3923 Regression] FAIL: gcc.dg/fold-overflow-1.c scan-assembler-times 2139095040 2 on Linux/x86_64

2022-11-12 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, 2f7f9edd28d75a85a33599978f23811e679e443d is the first bad commit commit 2f7f9edd28d75a85a33599978f23811e679e443d Author: Jakub Jelinek Date: Sat Nov 12 09:33:01 2022 +0100 range-op: Implement floating point multiplication fold_range [PR107569] caused FAIL: gcc.dg/fold-ov

[r13-3924 Regression] FAIL: gcc.dg/pr95115.c execution test on Linux/x86_64

2022-11-12 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, 2d5c4a16dd833aa083f13dd3e78e3ef38afe6ebb is the first bad commit commit 2d5c4a16dd833aa083f13dd3e78e3ef38afe6ebb Author: Jakub Jelinek Date: Sat Nov 12 09:35:16 2022 +0100 range-op: Implement floating point division fold_range [PR107569] caused FAIL: gcc.dg/pr95115.c exe

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/7/22 15:07, Palmer Dabbelt wrote: On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: On 11/2/22 18:26, Palmer Dabbelt wrote: I also tried to remove that restriction but it looks like it can't work because we can't create pseudo-registers during shrink wrapping and

Re: [PATCH v2] doc: Remove outdated reference to "core" and front-end downloads

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/9/22 15:12, Jonathan Wakely via Gcc-patches wrote: Patch rebased on the new doc format. I haven't tested building the docs this way, but this is just plain text here. OK for trunk? -- >8 -- gcc/ChangeLog: * doc/install/testing.rst: Remove anachronism about separate sou

Re: [PATCH v2] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/10/22 14:34, Philipp Tomsich wrote: The strength-reduction implementation in expmed.cc will assess the profitability of using shift-and-add using a RTL expression that wraps a MULT (with a power-of-2) in a PLUS. Unless the RISC-V rtx_costs function recognizes this as expressing a sh[123]

[committed] libstdc++: Add C++20 clocks

2022-11-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc64le-linux. Pushed to trunk. -- >8 -- Also add the basic types for timezones, without the non-inline definitions needed to actually use them. The get_leap_second_info function currently uses a hardcoded list of leap seconds, correct as of the end of 2022. That need

[committed] libstdc++: Allow std::to_chars for 128-bit integers in strict mode

2022-11-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc64le-linux. Pushed to trunk. -- >8 -- This allows std::format to support __int128 when __STRICT_ANSI__ is defined, which previously failed because __int128 is not an integral type in strict mode. With these changes, std::to_chars still rejects 128-bit integers in s

Re: [PATCH] Handle epilogues that contain jumps

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/11/22 09:19, Richard Sandiford via Gcc-patches wrote: The prologue/epilogue pass allows the prologue sequence to contain jumps. The sequence is then partitioned into basic blocks using find_many_sub_basic_blocks. This patch treats epilogues in the same way. It's needed for a follow-on

Re: [PATCH] Allow targets to add USEs to asms

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/11/22 10:30, Richard Sandiford via Gcc-patches wrote: Arm's SME has an array called ZA that for inline asm purposes is effectively a form of special-purpose memory. It doesn't have an associated storage type and so can't be passed and returned in normal C/C++ objects. We'd therefore lik

Re: [PATCH] RISC-V: optimize '(a >= 0) ? b : 0' to srai + andn, if compiling for Zbb

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/8/22 12:54, Philipp Tomsich wrote: If-conversion is turning '(a >= 0) ? b : 0' into a branchless sequence not a5,a0 sraia5,a5,63 and a0,a1,a5 missing the opportunity to combine the NOT and AND into an ANDN. This adds a define_split to help the combiner

Re: [PATCH] testsuite: Fix up pr107541.c test

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/8/22 04:50, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 07, 2022 at 12:42:38PM +0100, Aldy Hernandez via Gcc-patches wrote: * gcc.dg/tree-ssa/pr107541.c: New test. The test fails when long is 32-bit rather than 64-bit (say x86_64 with RUNTESTFLAGS='--target_board=unix\{-m32

Re: [PATCH 4/5] value-range: Add as_string diagnostics helper

2022-11-12 Thread Andrew Pinski via Gcc-patches
On Sat, Nov 12, 2022 at 3:47 PM Bernhard Reutner-Fischer via Gcc-patches wrote: > > gcc/ChangeLog: > > * value-range.cc (get_bound_with_infinite_markers): New static helper. > (irange::as_string): New definition. > * value-range.h: New declaration. > > --- > Provide means t

[PATCH 5/5] gimple: Add pass to note possible type demotions; IPA pro/demotion; DO NOT MERGE

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
gcc/ChangeLog: * Makefile.in (OBJS): Add gimple-warn-types.o. * passes.def: Add pass_warn_type_demotion. * tree-pass.h (make_pass_warn_type_demotion): New declaration. * gimple-warn-types.cc: New file. gcc/c-family/ChangeLog: * c.opt (Wtype-demotion): New.

[PATCH 3/5] Fortran: Narrow return types [PR78798]

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
gcc/fortran/ChangeLog: * arith.cc (compare_complex): Use narrower return type. (gfc_compare_string): Likewise. * arith.h (gfc_compare_string): Same. (gfc_compare_with_Cstring): Ditto. * array.cc (compare_bounds): Ditto. (gfc_compare_array_spec): Like

[PATCH 0/5] function result decl location; type demotion

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
Hi! The location of function result declarations was not set. The first two patches set the location of normal functions in C and C++. Jason, Nathan, I failed to support C++ template functions, see below. TL;DR. Why all this? PR78798 noted that we should use narrower function return types if fea

[PATCH 1/5] c: Set the locus of the function result decl

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
Bootstrapped and regtested on x86_86-unknown-linux with no regressions. Ok for trunk? Cc: Joseph Myers --- gcc/c/ChangeLog: * c-decl.cc (start_function): Set the result decl source location to the location of the typespec. --- gcc/c/c-decl.cc | 6 +- 1 file changed, 5 insert

[PATCH 4/5] value-range: Add as_string diagnostics helper

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
gcc/ChangeLog: * value-range.cc (get_bound_with_infinite_markers): New static helper. (irange::as_string): New definition. * value-range.h: New declaration. --- Provide means to print a value range to a newly allocated buffer. The caller is responsible to free() the alloca

[PATCH 2/5] c++: Set the locus of the function result decl

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
gcc/cp/ChangeLog: * decl.cc (start_function): Set the result decl source location to the location of the typespec. --- Bootstrapped and regtested on x86_86-unknown-linux with no regressions. Ok for trunk? Cc: Nathan Sidwell Cc: Jason Merrill --- gcc/cp/decl.cc | 15 +++

Re: [PATCH 7/7] ifcvt: add if-conversion to conditional-zero instructions

2022-11-12 Thread Philipp Tomsich
On Sat, 12 Nov 2022 at 22:47, Andrew Pinski wrote: > > On Sat, Nov 12, 2022 at 1:34 PM Philipp Tomsich > wrote: > > > > Some architectures, as it the case on RISC-V with the proposed > > ZiCondOps and the vendor-defined XVentanaCondOps, define a > > conditional-zero instruction that is equivalent

Re: [PATCH 7/7] ifcvt: add if-conversion to conditional-zero instructions

2022-11-12 Thread Andrew Pinski via Gcc-patches
On Sat, Nov 12, 2022 at 1:34 PM Philipp Tomsich wrote: > > Some architectures, as it the case on RISC-V with the proposed > ZiCondOps and the vendor-defined XVentanaCondOps, define a > conditional-zero instruction that is equivalent to: > - the positive form: rd = (rc != 0) ? rs : 0 > - the neg

[PATCH 7/7] ifcvt: add if-conversion to conditional-zero instructions

2022-11-12 Thread Philipp Tomsich
Some architectures, as it the case on RISC-V with the proposed ZiCondOps and the vendor-defined XVentanaCondOps, define a conditional-zero instruction that is equivalent to: - the positive form: rd = (rc != 0) ? rs : 0 - the negated form: rd = (rc == 0) ? rs : 0 While noce_try_store_flag_mask

[PATCH 5/7] RISC-V: Recognize bexti in negated if-conversion

2022-11-12 Thread Philipp Tomsich
While the positive case "if ((bits >> SHAMT) & 1)" for SHAMT 0..10 can trigger conversion into efficient branchless sequences - with Zbs (bexti + neg + and) - with XVentanaCondOps (andi + vt.maskc) the inverted/negated case results in andi a5,a0,1024 seqz a5,a5 neg a5,a5 and a5,a5,a1 du

[PATCH 3/7] RISC-V: Support noce_try_store_flag_mask as vt.maskc

2022-11-12 Thread Philipp Tomsich
When if-conversion in noce_try_store_flag_mask starts the sequence off with an order-operator, our patterns for vt.maskc will receive the result of the order-operator as a register argument; consequently, they can't know that the result will be either 1 or 0. To convey this information (and make v

[PATCH 4/7] RISC-V: Recognize sign-extract + and cases for XVentanaCondOps

2022-11-12 Thread Philipp Tomsich
Users might use explicit arithmetic operations to create a mask and then and it, in a sequence like cond = (bits >> SHIFT) & 1; mask = ~(cond - 1); val &= mask; which will present as a single-bit sign-extract. Dependening on what combination of XVentanaCondOps and Zbs are available, th

[PATCH 6/7] RISC-V: Support immediates in XVentanaCondOps

2022-11-12 Thread Philipp Tomsich
When if-conversion encounters sequences using immediates, the sequences can't trivially map back onto vt.maskc/vt.maskcn (even if benefitial) due to vt.maskc and vt.maskcn not having immediate forms. This adds a splitter to rewrite opportunities for XVentanaCondOps that operate on an immediate by

[PATCH 2/7] RISC-V: Generate vt.maskc on noce_try_store_flag_mask if-conversion

2022-11-12 Thread Philipp Tomsich
Adds a pattern to map the output of noce_try_store_flag_mask if-conversion in the combiner onto vt.maskc; the input patterns supported are similar to the following: (set (reg/v/f:DI 75 [ ]) (and:DI (neg:DI (ne:DI (reg:DI 82) (const_int 0 [0]))) (reg/v

[PATCH 0/7] RISC-V: Backend support for XVentanaCondOps/ZiCondops

2022-11-12 Thread Philipp Tomsich
Both the XVentanaCondOps (a vendor-defined extension from Ventana Microsystems) and the proposed ZiCondOps extensions define a conditional-zero(-or-value) instruction, which is similar to the following C construct: rd = rc ? rs : 0 This functionality can be tied back into if-convertsion and al

[PATCH 1/7] RISC-V: Recognize xventanacondops extension

2022-11-12 Thread Philipp Tomsich
This adds the xventanacondops extension to the option parsing and as a default for the ventana-vt1 core: gcc/Changelog: * common/config/riscv/riscv-common.cc: Recognize "xventanacondops" as part of an architecture string. * config/riscv/riscv-cores.def (RISCV_CORE): Enab

Re: [PATCH] Fortran: Remove unused declaration

2022-11-12 Thread Harald Anlauf via Gcc-patches
Am 12.11.22 um 22:05 schrieb Bernhard Reutner-Fischer via Gcc-patches: This function definition was removed years ago, remove it's prototype. gcc/fortran/ChangeLog: * gfortran.h (gfc_check_include): Remove declaration. --- gcc/fortran/gfortran.h | 1 - 1 file changed, 1 deletion(-) -

[PATCH] Fortran: Remove unused declaration

2022-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
This function definition was removed years ago, remove it's prototype. gcc/fortran/ChangeLog: * gfortran.h (gfc_check_include): Remove declaration. --- gcc/fortran/gfortran.h | 1 - 1 file changed, 1 deletion(-) --- Regtests cleanly, ok for trunk? diff --git a/gcc/fortran/gfortran.h b/g

Re: [PATCH] gcc: m68k: fix PR target/107645

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/11/22 12:43, Max Filippov wrote: gcc/ PR target/107645 * config/m68k/predicates.md (symbolic_operand): Return false when UNSPEC is under the CONST node. Isn't the underlying object still symbolic though, thus returning false seems wrong. insn 342 341 343 35 (s

Re: [DOCS] sphinx: use new Sphinx links

2022-11-12 Thread Gerald Pfeifer
On Sat, 12 Nov 2022, Gerald Pfeifer wrote: > I am not aware of who added this, and why, nor actually even why, yet it > seems if we can get the same in place for /install we'll be good again, so > I'll ask overseers@. https://gcc.gnu.org/install/ is up and running fine now/again. > Next step: re

[PATCH] [PR68097] Try to avoid recursing for floats in tree_*_nonnegative_warnv_p.

2022-11-12 Thread Aldy Hernandez via Gcc-patches
It irks me that a PR named "we should track ranges for floating-point hasn't been closed in this release. This is an attempt to do just that. As mentioned in the PR, even though we track ranges for floats, it has been suggested that avoiding recursing through SSA defs in gimple_assign_nonnegative

ginclude: C2x header version macros

2022-11-12 Thread Joseph Myers
C2x adds __STDC_VERSION_*_H__ macros to individual headers with interface changes compared to C17. All the new header features in headers provided by GCC have now been implemented, so define those macros to the value given in the current working draft. Bootstrapped with no regressions for x86_64-

Re: [PATCH] Fortran: fix treatment of character, value, optional dummy arguments [PR107444]

2022-11-12 Thread Mikael Morin
Hello, Le 10/11/2022 à 22:56, Harald Anlauf via Fortran a écrit : Dear Fortranners, the attached patch is a follow-up to the fix for PR107441, as it finally fixes the treatment of character dummy arguments that have the value,optional attribute, and allows for checking of the presence of such a

[PATCH] c++: Reject UDLs in certain contexts [PR105300]

2022-11-12 Thread Marek Polacek via Gcc-patches
In this PR, we are crashing because we've encountered a UDL where a string-literal is expected. This patch makes the parser reject string and character UDLs in all places where the grammar requires a string-literal and not a user-defined-string-literal. Bootstrapped/regtested on x86_64-pc-linux-g

Re: c: C2x constexpr

2022-11-12 Thread Richard Biener via Gcc-patches
> Am 12.11.2022 um 05:56 schrieb Joseph Myers : > > [Global / middle-end reviewers, note there is a dfp.cc change here > that needs review.] > > Implement C2x constexpr (a feature based on the C++ one but much more > minimal, with only constexpr variables, not functions). > > I believe this

Re: [PATCH 4/4]AArch64 sve2: rewrite pack + NARROWB + NARROWB to NARROWB + NARROWT

2022-11-12 Thread Richard Sandiford via Gcc-patches
Richard Sandiford writes: > Tamar Christina writes: >> Hi All, >> >> This adds an RTL pattern for when two NARROWB instructions are being combined >> with a PACK. The second NARROWB is then transformed into a NARROWT. >> >> For the example: >> >> void draw_bitmap1(uint8_t* restrict pixel, uint8_

Re: [PATCH 4/4]AArch64 sve2: rewrite pack + NARROWB + NARROWB to NARROWB + NARROWT

2022-11-12 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > This adds an RTL pattern for when two NARROWB instructions are being combined > with a PACK. The second NARROWB is then transformed into a NARROWT. > > For the example: > > void draw_bitmap1(uint8_t* restrict pixel, uint8_t level, int n) > { > for (int i =

Re: [PATCH 3/4]AArch64 Add SVE2 implementation for pow2 bitmask division

2022-11-12 Thread Richard Sandiford via Gcc-patches
Sorry for the slow review, been snowed under with stage1 stuff. Tamar Christina writes: > Hi All, > > In plenty of image and video processing code it's common to modify pixel > values > by a widening operation and then scale them back into range by dividing by > 255. > > This patch adds an name

Re: [PATCH] libstdc++: Fix up to_chars ppc64le _Float128 overloads [PR107636]

2022-11-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 12 Nov 2022, 08:47 Jakub Jelinek via Libstdc++, < libstd...@gcc.gnu.org> wrote: > Hi! > > As reported, I've misplaced __extension__ keywords in these cases > (wanted not to have them on the whole inlines because _Float128 is > completely standard now while __float128 is not, but before ret

[PATCH] c++: Implement CWG2635 - Constrained structured bindings

2022-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements CWG2635. So far tested on GXX_TESTSUITE_STDS=98,11,14,17,20,2b make check-g++ RUNTESTFLAGS="dg.exp=decomp*" ok for trunk if it passes full bootstrap/regtest and it is voted in? 2022-11-12 Jakub Jelinek * decl.cc (grokdeclarator): Implement

[COMMITTED] [frange] Avoid testing signed zero test for -fno-signed-zeros.

2022-11-12 Thread Aldy Hernandez via Gcc-patches
This patch moves a test that is meant to only work for signed zeros into range_tests_signed_zeros. I am not aware of any architectures where this is failing, but it is annoying to see selftests failing when -fno-signed-zeros is used. gcc/ChangeLog: * value-range.cc (range_tests_signbit):

Re: [PATCH v2] LoongArch: Add prefetch instructions.

2022-11-12 Thread Xi Ruoyao via Gcc-patches
On Sat, 2022-11-12 at 15:37 +0800, Lulu Cheng wrote: > Co-Authored-By: xujiahao > > gcc/ChangeLog: > > * config/loongarch/loongarch-def.c: Initial number of parallel > prefetch. > * config/loongarch/loongarch-tune.h (struct loongarch_cache): > Define number of parallel pr

Re: [DOCS] sphinx: use new Sphinx links

2022-11-12 Thread Gerald Pfeifer
On Thu, 10 Nov 2022, Martin Liška wrote: > See that the problematic for some reason uses "content-security-policy: > default-src 'self' http: https:". Yep. On Thu, 10 Nov 2022, Tobias Burnus wrote: > content-security-policy: default-src 'self' http: https: > > There must be some server configura

Re: [Patch] OpenMP/Fortran: Use firstprivat not alloc for ptr attach for arrays

2022-11-12 Thread Thomas Schwinge
Hi Tobias! On 2022-05-13T19:44:51+0200, Jakub Jelinek via Fortran wrote: > On Fri, May 13, 2022 at 07:21:02PM +0200, Tobias Burnus wrote: >> gcc/fortran/ChangeLog: >> >> * trans-openmp.cc (gfc_trans_omp_clauses): When mapping nondescriptor >> array sections, use GOMP_MAP_FIRSTPRIVATE_P

[PATCH v2] LoongArch: Optimize the implementation of stack check.

2022-11-12 Thread Lulu Cheng
The old stack check was performed before the stack was dropped, which would cause the detection tool to report a memory leak. The current stack check scheme is as follows: '-fstack-clash-protection': 1. When the frame->total_size is smaller than the guard page size, the stack is dropped accord

Re: [PATCH] [range-ops] Add ability to represent open intervals in frange.

2022-11-12 Thread Aldy Hernandez via Gcc-patches
On Sat, Nov 12, 2022 at 9:54 AM Jakub Jelinek wrote: > > On Fri, Nov 11, 2022 at 08:25:15PM +0100, Aldy Hernandez wrote: > > Passes tests for all languages. Passes lapack tests. > > > > So ready to be installed unless you have any issues. Oh... I should > > write some tests.. > > LGTM. > > Yea

Re: [PATCH] [range-ops] Add ability to represent open intervals in frange.

2022-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 11, 2022 at 08:25:15PM +0100, Aldy Hernandez wrote: > Passes tests for all languages. Passes lapack tests. > > So ready to be installed unless you have any issues. Oh... I should > write some tests.. LGTM. Yeah, for tests we still need to decide whether we make tests in the style

[committed] libgomp: Fix up build on mingw [PR107641]

2022-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! Pointers should be first casted to intptr_t/uintptr_t before casting them to another integral type to avoid warnings. Furthermore, the function has code like else if (upper <= UINT_MAX) something; else something_else; so it seems using unsigned type for upper where upper <= UINT_MA

[PATCH] libstdc++: Fix up to_chars ppc64le _Float128 overloads [PR107636]

2022-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! As reported, I've misplaced __extension__ keywords in these cases (wanted not to have them on the whole inlines because _Float128 is completely standard now while __float128 is not, but before return it is a syntax error. I've verified on a short testcase that both g++ and clang++ accept __ext