Re: [RFC] light expander sra for parameters and returns

2023-08-07 Thread Richard Biener via Gcc-patches
On Sat, 5 Aug 2023, Jiufu Guo wrote: > > Hi, > > Richard Biener writes: > > > On Thu, 3 Aug 2023, Jiufu Guo wrote: > > > >> > >> Hi Richard, > >> > >> Richard Biener writes: > >> > >> > On Tue, 1 Aug 2023, Jiufu Guo wrote: > >> > > >> >> > >> >> Hi, > >> >> > >> >> Richard Biener writes

Re: [PATCH] MATCH: Extend min_value/max_value to pointer types

2023-08-07 Thread Richard Biener via Gcc-patches
On Sat, Aug 5, 2023 at 10:44 PM Andrew Pinski via Gcc-patches wrote: > > Since we already had the infrastructure to optimize > `(x == 0) && (x > y)` to false for integer types, > this extends the same to pointer types as indirectly > requested by PR 96695. > > OK? Bootstrapped and tested on x86_64

Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls

2023-08-07 Thread Richard Biener via Gcc-patches
On Sat, Aug 5, 2023 at 11:54 PM David Malcolm via Gcc-patches wrote: > > On Sun, 2023-08-06 at 02:28 +0530, Prathamesh Kulkarni via Gcc-patches > wrote: > > On Fri, 4 Aug 2023 at 23:28, Bradley Lucier via Gcc-patches > > wrote: > > Hi Bradley and Prathamesh... > > > > > > > The patch at the end a

Re: [PATCH 2/3] RISC-V: Part-2: Save/Restore vector registers which need to be preversed

2023-08-07 Thread Lehua Ding
Hi Kito, > > +machine_mode m1_mode = TARGET_VECTOR_ELEN_64 > > +? (TARGET_MIN_VLEN >= 128 ? VNx2DImode : VNx1DImode) > > +: VNx1SImode; > This should update since JuZhe has update the mode system :P Yes, thanks reminder. > > @@ -5907,7 +6057,7 @@ riscv_expand_epilogue (int style) > > Start of

PR target/107671: Make more use of btl/btq on x86_64.

2023-08-07 Thread Roger Sayle
This patch is a partial solution to PR target/107671, updating Uros' patch from comment #4, to catch both bit set (setc) and bit not set (setnc) cases from the code in comment #2, when compiled on x86_64. Unfortunately, this is a partial solution, as the pointer variants in comment #1, aren't yet

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, Aug 7, 2023 at 2:05 AM Prathamesh Kulkarni via Gcc-patches wrote: > > On Thu, 3 Aug 2023 at 17:48, Richard Biener wrote: > > > > On Thu, 3 Aug 2023, Richard Biener wrote: > > > > > On Thu, 3 Aug 2023, Richard Biener wrote: > > > > > > > On Thu, 3 Aug 2023, Prathamesh Kulkarni wrote: > > >

Re: [PATCH] MATCH: [PR109959] `(uns <= 1) & uns` could be optimized to `uns == 1`

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, Aug 7, 2023 at 7:07 AM Andrew Pinski via Gcc-patches wrote: > > I noticed while looking into some code generation of bitmap_single_bit_set_p, > that sometimes: > ``` > if (uns > 1) > return 0; > return uns == 1; > ``` > Would not optimize down to just: > ``` > return uns == 1; > ``

Re: [PATCH 1/3] RISC-V: Part-1: Select suitable vector registers for vector type args and returns

2023-08-07 Thread Kito Cheng via Gcc-patches
Thanks for the high quality patch, it's generally LGTM, only a few minor comments :) > + /* The number and alignment of vector registers need for this scalable > vector > + argument. When the mode size is less than a full vector, we use 1 vector > + register to pass. Just call TARGET_HAR

[PATCH] Fix ICE in rtl check when bootstrap.

2023-08-07 Thread liuhongt via Gcc-patches
/var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c: In function ‘matmul_i1_avx512f’: /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected

[PATCH] i386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]

2023-08-07 Thread liuhongt via Gcc-patches
Similar like r14-2786-gade30fad6669e5, the patch is for V4HF/V2HFmode. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: PR target/110762 * config/i386/mmx.md (3): Changed from define_insn to define_expand and break into .. (v4

[PATCH] libsanitizer: Fix SPARC stacktraces

2023-08-07 Thread Rainer Orth
As detailed in LLVM Issue #57624 (https://github.com/llvm/llvm-project/issues/57624), a patch to sanitizer_internal_defs.h broke SPARC stacktraces in the sanitizers. The issue has now been fixed upstream (https://reviews.llvm.org/D156504) and I'd like to cherry-pick that patch. Bootstrapped withou

Re: [PATCH v2] rs6000: Fix __builtin_altivec_vcmpne{b,h,w} implementation

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi Carl, Sorry for the late review. on 2023/8/2 02:29, Carl Love wrote: > > GCC maintainers: > > Ver 2: Re-worked the test vec-cmpne.c to create a compile only test > verify the instruction generation and a runnable test to verify the > built-in functionality. Retested the patch on Power 8 LE

Re: [PATCH] i386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]

2023-08-07 Thread Uros Bizjak via Gcc-patches
On Mon, Aug 7, 2023 at 10:57 AM liuhongt wrote: > > Similar like r14-2786-gade30fad6669e5, the patch is for V4HF/V2HFmode. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? > > gcc/ChangeLog: > > PR target/110762 > * config/i386/mmx.md (3): Changed from

Re: [PATCH] libsanitizer: Fix SPARC stacktraces

2023-08-07 Thread Jakub Jelinek via Gcc-patches
On Mon, Aug 07, 2023 at 11:13:10AM +0200, Rainer Orth wrote: > As detailed in LLVM Issue #57624 > (https://github.com/llvm/llvm-project/issues/57624), a patch to > sanitizer_internal_defs.h broke SPARC stacktraces in the sanitizers. > The issue has now been fixed upstream (https://reviews.llvm.org/

Re: Re: PING^2 [PATCH] mklog: fix bugs of --append option

2023-08-07 Thread juzhe.zh...@rivai.ai
Hi, Jeff. Could you help with this patch? With this patch, we don't need to manually copy commit log. With ../contrib/mklog.py -a patch It will automatically copy to the commit log which is useful when sending patches. Thanks. juzhe.zh...@rivai.ai From: Lehua Ding Date: 2023-08-03 20:08 To

[PATCH] RISC-V: Support VLS basic operation auto-vectorization

2023-08-07 Thread Juzhe-Zhong
This patch support VLS modes auto-vectorization to enhance VLA auto-vectorization when niters is known. Consider this following case: #include #define DEF_OP_VV(PREFIX, NUM, TYPE, OP) \ void __attribute__ ((noinline, noclone))

Re: [PATCH V2] rs6000: Don't allow AltiVec address in movoo & movxo pattern [PR110411]

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi Jeevitha, on 2023/7/20 00:46, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > There are no instructions that do traditional AltiVec addresses (i.e. > with the low four bits of the address masked off) for OOmode and XOmode > objec

[PATCH V4] VECT: Support CALL vectorization for COND_LEN_*

2023-08-07 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richard and Richi. Base on the suggestions from Richard: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625396.html This patch choose (1) approach that Richard provided, meaning: RVV implements cond_* optabs as expanders. RVV therefore supports both IFN_COND_ADD an

[PATCH] tree-optimization/110897 - Fix missed vectorization of shift on both RISC-V and aarch64

2023-08-07 Thread Juzhe-Zhong
Consider this following case: #include #define TEST2_TYPE(TYPE)\ __attribute__((noipa))\ void vshiftr_##TYPE (TYPE *__restrict dst, TYPE *__restrict a, TYPE *__restrict b, int n) \ {

Re: [PATCH V4] VECT: Support CALL vectorization for COND_LEN_*

2023-08-07 Thread juzhe.zh...@rivai.ai
Oh, I am so sorry resend this patch again. I was trying to send patch which fixed missed shift vectorizaiton on RISCV and ARM: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626456.html This V4 patch is no different from before. I am sorry about that. Forget about this patch. juzhe.zh.

Re: PR target/107671: Make more use of btl/btq on x86_64.

2023-08-07 Thread Uros Bizjak via Gcc-patches
On Mon, Aug 7, 2023 at 9:37 AM Roger Sayle wrote: > > > This patch is a partial solution to PR target/107671, updating Uros' > patch from comment #4, to catch both bit set (setc) and bit not set > (setnc) cases from the code in comment #2, when compiled on x86_64. > Unfortunately, this is a partia

Re: [PATCH] tree-optimization/110897 - Fix missed vectorization of shift on both RISC-V and aarch64

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, 7 Aug 2023, Juzhe-Zhong wrote: > Consider this following case: > > #include > > #define TEST2_TYPE(TYPE) \ > __attribute__((noipa)) \ > void vshiftr_##TYPE (TYPE *__restrict dst, TYPE *__restrict a, TYPE > *_

[PATCH 1/3 v4] Support get_or_insert in ordered_hash_map

2023-08-07 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 0/3 v4] genmatch: Speed up recompilation after changes to match.pd

2023-08-07 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the generate

[PATCH 3/3 v4] genmatch: Log line numbers indirectly

2023-08-07 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make t

[PATCH 2/3 v4] genmatch: Reduce variability of generated code

2023-08-07 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are generated

PING^4 [PATCH 0/9] rs6000: Rework rs6000_emit_vector_compare

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi, Gentle ping this series: https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607146.html BR, Kewen >>> on 2022/11/24 17:15, Kewen Lin wrote: Hi, Following Segher's suggestion, this patch series is to rework function rs6000_emit_vector_compare for vector float and int

PING^3 [PATCH v2] sched: Change no_real_insns_p to no_real_nondebug_insns_p [PR108273]

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi, I'd like to gentle ping this patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614818.html BR, Kewen >> on 2023/3/29 15:18, Kewen.Lin via Gcc-patches wrote: >>> Hi, >>> >>> By addressing Alexander's comments, against v1 this >>> patch v2 mainly: >>> >>> - Rename no_real_insns_p

PING^2 [PATCH v2] rs6000: Don't use optimize_function_for_speed_p too early [PR108184]

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi, Gentle ping this: https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609993.html BR, Kewen > on 2023/1/16 17:08, Kewen.Lin via Gcc-patches wrote: >> Hi, >> >> As Honza pointed out in [1], the current uses of function >> optimize_function_for_speed_p in rs6000_option_override_internal >

Re: [PATCH 1/3] targhooks: Extend legitimate_address_p with code_helper [PR110248]

2023-08-07 Thread Kewen.Lin via Gcc-patches
Hi Richi, on 2023/6/30 17:13, Kewen.Lin via Gcc-patches wrote: > Hi Richi, > > Thanks for your review! > > on 2023/6/30 16:56, Richard Biener wrote: >> On Fri, Jun 30, 2023 at 7:38 AM Kewen.Lin wrote: >>> >>> Hi, >>> >>> As PR110248 shows, some middle-end passes like IVOPTs can >>> query the ta

Re: [PATCH] tree-optimization/110897 - Fix missed vectorization of shift on both RISC-V and aarch64

2023-08-07 Thread Lehua Ding
Committed to trunk, thanks Richard and Juzhe.

[PATCH] fwprop: Allow UNARY_P and check register pressure.

2023-08-07 Thread Robin Dapp via Gcc-patches
Hi, originally inspired by the wish to transform vmv v3, a0 ; = vec_duplicate vadd.vv v1, v2, v3 into vadd.vx v1, v2, a0 via fwprop for riscv, this patch enables the forward propagation of UNARY_P sources. As this involves potentially replacing a vector register with a scalar register the

Re: [RFC] Combine zero_extract and sign_extend for TARGET_TRULY_NOOP_TRUNCATION

2023-08-07 Thread Maciej W. Rozycki
On Thu, 3 Aug 2023, YunQiang Su wrote: > PR #104914 Please don't cc me on MIPS matters, I have told you I have withdrawn my interest in this architecture on the GCC side. Thank you. Maciej

Re: [committed] Fix several preprocessor directives

2023-08-07 Thread Jonathan Wakely via Gcc-patches
On Sun, 30 Jul 2023 at 14:55, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Committed as obvious. > > libstdc++: Fix several preprocessor directives > > A wrong usage of #define in place of a #error seems to have been > replicated > at different places in source fi

[COMMITTED] ada: Spurious error on class-wide preconditions

2023-08-07 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler reports an spurious error when a class-wide precondition expression has a class-wide type conversion. gcc/ada/ * sem_res.adb (Resolve_Type_Conversion): Do not warn on conversion to class-wide type on internally build helpers of class-wide

[COMMITTED] ada: Crash in GNATprove due to wrong detection of inlining

2023-08-07 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy When a function is called in a predicate, it was not properly detected as not always inlined in GNATprove mode, which led to crashes later during analysis. Fixed now. gcc/ada/ * sem_res.adb (Resolve_Call): Always call Cannot_Inline so that subprogram called is

[COMMITTED] ada: Extend precondition of Interfaces.C.String.Value with Length

2023-08-07 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek The existing precondition guarded against exception Dereference_Error, but not against Constraint_Error. The RM rule B.3.1(36/3) only mentions Constraint_Error for the Value function which returns char_array, but the one which returns String has the same restriction, because

[COMMITTED] ada: Refactor multiple returns

2023-08-07 Thread Marc Poulhiès via Gcc-patches
From: Sheri Bernstein Replace multiple returns by a single return statement with a conditional expression. This is more readable and maintainable, and also conformant with a Highly Recommended design principle of ISO 26262-6. gcc/ada/ * libgnat/s-parame__qnx.adb: Refactor multiple retur

[PATCH 00/24] Sync shared build infrastructure with binutils-gdb

2023-08-07 Thread Arsen Arsenović via Gcc-patches
Hello, This patch set, combined with a sibling patch set sent on the binutils and GDB MLs, bring up the shared infrastructure between the two projects in sync again. It largely consists of cherry-picks from various people which have been reviewed and accepted on the binutils-gdb side, as well as

[PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS

2023-08-07 Thread Arsen Arsenović via Gcc-patches
r14-2875-g1ed21e23d6d4da ("Use substituted GDCFLAGS") already implemented this change, but only on the generated file rather than in the template it is generated from. ChangeLog: * Makefile.tpl: Substitute @GDCFLAGS@ instead of using $(CFLAGS). --- Makefile.tpl | 2 +- 1 file cha

[PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Martin Liska ChangeLog: * configure.ac: Add --enable-default-compressed-debug-sections-algorithm. * configure: Regenerate. --- configure| 13 + configure.ac | 6 ++ 2 files changed, 19 insertions(+) diff --git a/configure b/configure index a5f6282bb0

[PATCH 03/24] gcc-4.5 build fixes

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Alan Modra Trying to build binutils with an older gcc currently fails. Working around these gcc bugs is not onerous so let's fix them. include/ChangeLog: * xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary forward declaration. --- include/xtensa-dynconfig.h |

[PATCH 11/24] Disable year 2038 support on 32-bit hosts by default

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Luis Machado With a recent import of gnulib, code has been pulled that tests and enables 64-bit time_t by default on 32-bit hosts that support it. Although gdb can use the gnulib support, bfd doesn't use gnulib and currently doesn't do these checks. As a consequence, if we have a 32-bit h

[PATCH 06/24] toplevel: Recover tilegx/tilepro targets

2023-08-07 Thread Arsen Arsenović via Gcc-patches
These are still supported in Binutils. ChangeLog: * configure: Regenerate. * configure.ac: Recover tilegx/tilepro targets. --- configure| 5 - configure.ac | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3fe4a1804cf..0

[PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess"

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Alan Modra Found when attempting to build binutils on sparc sunos-5.8 where sys/byteorder.h defines _BIG_ENDIAN but not any of the BYTE_ORDER variants. This patch adds the extra tests to cope with the old machine, and tidies the header a little. include/ChangeLog: * plugin-api.h:

[PATCH 08/24] configure: require libzstd >= 1.4.0

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Christophe Lyon gas uses ZSTD_compressStream2 which is only available with libzstd >= 1.4.0, leading to build errors when an older version is installed. This patch updates the check libzstd presence to check its version is >= 1.4.0. However, since gas seems to be the only component requiri

[PATCH 07/24] binutils, gdb: support zstd compressed debug sections

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Fangrui Song PR29397 PR29563: Add new configure option --with-zstd which defaults to auto. If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support zstd compressed debug sections for most tools. * bfd: for addr2line, objdump --dwarf, gdb, etc * gas: support --compress-debug-sections

[PATCH 05/24] GCC: Check if AR works with --plugin and rc

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: "H.J. Lu" AR from older binutils doesn't work with --plugin and rc: [hjl@gnu-cfl-2 bin]$ touch foo.c [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c [hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/libl

[PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Simon Marchi [Sending to binutils, gdb-patches and gcc-patches, since it touches the top-level Makefile/configure] I have my debuginfod library installed in a non-standard location (/opt/debuginfod), which requires me to set PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config. If I just set it

[PATCH 18/24] PR27116, Spelling errors found by Debian style checker

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Alan Modra config/ChangeLog: * override.m4: Correct comment grammar. --- config/override.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/override.m4 b/config/override.m4 index d3e815bb1b4..5a1bffe6018 100644 --- a/config/override.m4 +++ b/config/overr

[PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: "H.J. Lu" Sync with binutils for building binutils with LTO: 50ad1254d50 GCC: Pass --plugin to AR and RANLIB Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. ChangeLog: * Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_O

[PATCH 21/24] PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: "H.J. Lu" There is no need to check $pkg_cv_[]$1[]_LIBS works if package check failed. config/ChangeLog: * pkg.m4 (PKG_CHECK_MODULES): Use AC_TRY_LINK only if $pkg_failed = no. --- config/pkg.m4 | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git

[PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: "H.J. Lu" It is quite normal to have headers without library on multilib OSes. Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS works. config/ChangeLog: * pkg.m4 (PKG_CHECK_MODULES): Add AC_TRY_LINK to check if $pkg_cv_[]$1[]_LIBS works. --- config/pkg

[PATCH 17/24] egrep in binutils

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Alan Modra Apparently some distros have a nagging egrep that helpfully tells you egrep is deprecated and to use "grep -E". The nag message causes a ld testsuite failure. What's more the advice isn't that good. The "-E" flag may not be available with older versions of grep. This patch fi

[PATCH 10/24] gprofng: a new GNU profiler

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Vladimir Mezentsev ChangeLog: * Makefile.def: Add gprofng module. * configure.ac: Add --enable-gprofng option. * Makefile.in: Regenerate. * configure: Regenerate. include/ChangeLog: * collectorAPI.h: New file. * libcollector.h: New file.

[PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Nick Alcock My previous nm patch handled all cases but one -- if the user set NM in the environment to a path which contained an option, libtool's nm detection tries to run nm against a copy of nm with the options in it: e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, th

[PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel

2023-08-07 Thread Arsen Arsenović via Gcc-patches
The Binutils still support this target. ChangeLog: * configure.ac: Reinstate 32b PA-RISC HP-UX targets * configure: Regenerate. --- configure| 10 ++ configure.ac | 10 ++ 2 files changed, 20 insertions(+) diff --git a/configure b/configure index b6b7487f834.

[PATCH 16/24] Add support for the haiku operating system

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Alexander von Gluck IV These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time. ChangeLog: * configure: Regenerate. * config

[PATCH 23/24] bfd: linker: merge .sframe sections

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Indu Bhagat The linker merges all the input .sframe sections. When merging, the linker verifies that all the input .sframe sections have the same abi/arch. The linker uses libsframe library to perform key actions on the .sframe sections - decode, read, and create output data. This implie

[PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Indu Bhagat As noted in PR libsframe/30014 - FTBFS: install-strip fails because bfdlib relinks and fails to find libsframe, the install time dependencies of libbfd need to be updated. ChangeLog: * Makefile.def: Reflect that libsframe needs to installed before libbfd. Reor

[PATCH 14/24] libtool.m4: fix nm BSD flag detection

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Nick Alcock Libtool needs to get BSD-format (or MS-format) output out of the system nm, so that it can scan generated object files for symbol names for -export-symbols-regex support. Some nms need specific flags to turn on BSD-formatted output, so libtool checks for this in its AC_PATH_NM.

Re: [PATCH] i386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, Aug 7, 2023 at 11:20 AM Uros Bizjak via Gcc-patches wrote: > > On Mon, Aug 7, 2023 at 10:57 AM liuhongt wrote: > > > > Similar like r14-2786-gade30fad6669e5, the patch is for V4HF/V2HFmode. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > > Ok for trunk? > > > > gcc/Cha

[PATCH 19/24] Deprecate a.out support for NetBSD targets.

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: John Ericson As discussed previously, a.out support is now quite deprecated, and in some cases removed, in both Binutils itself and NetBSD, so this legacy default makes little sense. `netbsdelf*` and `netbsdaout*` still work allowing the user to be explicit about there choice. Additionally,

[PATCH 22/24] libtool.m4: augment symcode for Solaris 11

2023-08-07 Thread Arsen Arsenović via Gcc-patches
From: Nick Alcock This reports common symbols like GNU nm, via a type code of 'C'. ChangeLog: * libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for Solaris 11. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. l

[PATCH] cprop_hardreg: Allow more propagation of the stack pointer.

2023-08-07 Thread Manolis Tsamis
The stack pointer propagation fix 736f8fd3 turned out to be more restrictive than needed by rejecting propagation of the stack pointer when REG_POINTER didn't match. This commit removes this check: When the stack pointer is propagated it is fine for this to result in REG_POINTER becoming true from

Re: [PATCH] i386: Clear upper bits of XMM register for V4HFmode/V2HFmode operations [PR110762]

2023-08-07 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 7, 2023 at 5:19 PM Uros Bizjak via Gcc-patches wrote: > > On Mon, Aug 7, 2023 at 10:57 AM liuhongt wrote: > > > > Similar like r14-2786-gade30fad6669e5, the patch is for V4HF/V2HFmode. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > > Ok for trunk? > > > > gcc/Chan

Re: [PATCH] Fix ICE in rtl check when bootstrap.

2023-08-07 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 7, 2023 at 4:54 PM liuhongt wrote: > > /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c: > In function ‘matmul_i1_avx512f’: > /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.

Re: [PATCH 1/3] targhooks: Extend legitimate_address_p with code_helper [PR110248]

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, Aug 7, 2023 at 12:15 PM Kewen.Lin wrote: > > Hi Richi, > > on 2023/6/30 17:13, Kewen.Lin via Gcc-patches wrote: > > Hi Richi, > > > > Thanks for your review! > > > > on 2023/6/30 16:56, Richard Biener wrote: > >> On Fri, Jun 30, 2023 at 7:38 AM Kewen.Lin wrote: > >>> > >>> Hi, > >>> > >>>

[PATCH v1] Mode-Switching: Fix SET_SRC ICE when only one operand

2023-08-07 Thread Pan Li via Gcc-patches
From: Pan Li In same cases, like gcc/testsuite/gcc.dg/pr78148.c in RISC-V, there will be only 1 operand when SET_SRC in create_pre_exit. For example as below. (insn 13 9 14 2 (clobber (reg/i:TI 10 a0)) "gcc/testsuite/gcc.dg/pr78148.c":24:1 -1 (expr_list:REG_UNUSED (reg/i:TI 10 a0) (nil)))

RE: RE: [PATCH v1] RISC-V: Refactor RVV frm_mode attr for rounding mode intrinsic

2023-08-07 Thread Li, Pan2 via Gcc-patches
Got you point, thanks kito and will send patch v2 after test. Pan -Original Message- From: Kito Cheng Sent: Monday, August 7, 2023 2:35 PM To: Li, Pan2 Cc: juzhe.zh...@rivai.ai; gcc-patches ; Wang, Yanzhang Subject: Re: RE: [PATCH v1] RISC-V: Refactor RVV frm_mode attr for rounding

Re: [PATCH v1] Mode-Switching: Fix SET_SRC ICE when only one operand

2023-08-07 Thread Richard Biener via Gcc-patches
On Mon, Aug 7, 2023 at 2:30 PM Pan Li via Gcc-patches wrote: > > From: Pan Li > > In same cases, like gcc/testsuite/gcc.dg/pr78148.c in RISC-V, there will > be only 1 operand when SET_SRC in create_pre_exit. For example as below. > > (insn 13 9 14 2 (clobber (reg/i:TI 10 a0)) > "gcc/testsuite/gc

[PATCH] Improve -fopt-info-vec for basic-block vectorization

2023-08-07 Thread Richard Biener via Gcc-patches
We currently dump notes like flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: bas

Re: [PATCH] rtl-optimization/110587 - speedup find_hard_regno_for_1

2023-08-07 Thread Richard Biener via Gcc-patches
On Wed, 2 Aug 2023, Richard Biener wrote: > On Mon, 31 Jul 2023, Jeff Law wrote: > > > > > > > On 7/31/23 04:54, Richard Biener via Gcc-patches wrote: > > > On Tue, 25 Jul 2023, Richard Biener wrote: > > > > > >> The following applies a micro-optimization to find_hard_regno_for_1, > > >> re-or

RE: [PATCH v1] Mode-Switching: Fix SET_SRC ICE when only one operand

2023-08-07 Thread Li, Pan2 via Gcc-patches
> maybe check that return_copy_pat is a SET instead? You mean something like this? I tried this but I am not sure single_set is good enough here, because it should be "narrow" than GET_RTX_LENGTH. + && single_set (return_copy) Pan -Original Message- From: Rich

[PATCH] Use RPO order for sinking

2023-08-07 Thread Richard Biener via Gcc-patches
The following makes us use RPO order instead of walking post-dominators. This ensures we visit a block before any predecessors. I've seen some extra sinking because of this in a larger testcase but failed to reduce a smaller one (processing of post-dominator sons is unordered so I failed to have "

[PATCH] tree-optimization/49955 - BB reduction with odd number of lanes

2023-08-07 Thread Richard Biener via Gcc-patches
The following enhances BB reduction vectorization to support vectorizing only a subset of the lanes, keeping the rest as scalar ops. For now we try to make the number of lanes even by leaving alone the "last" lane. That's because SLP discovery with all lanes will fail too soon to get us any hint

[PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc

2023-08-07 Thread Stefan Schulze Frielinghaus via Gcc-patches
This fixes the rather new tests cmp-mem-const-{1,2,3,4,5,6}.c for sparc. For -1 and -2 we need at least optimization level 2 on sparc. For the sake of homogeneity, change all test cases to -O2. For -3 and -4 we do not end up with a comparison of memory and a constant, and finally for -5 and -6 th

[PATCH, OpenACC 2.7, v2] readonly modifier support in front-ends

2023-08-07 Thread Chung-Lin Tang via Gcc-patches
Hi Thomas, Tobias, here's the updated v2 of the readonly modifier front-end patch. On 2023/7/20 11:08 PM, Tobias Burnus wrote: >>> +++ b/gcc/c/c-parser.cc >>> @@ -14059,7 +14059,8 @@ c_parser_omp_variable_list (c_parser *parser, >>> >>> static tree >>> c_parser_omp_var_list_parens (c_parser *p

[V2][PATCH] gcc-14/changes.html: Deprecate a GCC C extension on flexible array members.

2023-08-07 Thread Qing Zhao via Gcc-patches
Hi, This is the 2nd version of the patch. Comparing to the 1st version, the only change is to address Richard's comment on refering a warning option for diagnosing deprecated behavior. Okay for committing? thanks. Qing == *htdocs/gcc-14/changes.html (Caveats): Add notice about deprecatin

[PATCH v4] Implement new RTL optimizations pass: fold-mem-offsets.

2023-08-07 Thread Manolis Tsamis
This is a new RTL pass that tries to optimize memory offset calculations by moving them from add immediate instructions to the memory loads/stores. For example it can transform this: addi t4,sp,16 add t2,a6,t4 shl t3,t2,1 ld a2,0(t3) addi a2,1 sd a2,8(t2) into the following (one

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-08-07 Thread Manolis Tsamis
I have sent out a new v4 of this (https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626502.html). In the new version I both restore the INSN_CODE as mentioned here and I also call recog when I commit the offset change (because there may be a change from no offset to some offsets). I have also

[PATCH] VR-VALUES [PR28794]: optimize compare assignments also

2023-08-07 Thread Andrew Pinski via Gcc-patches
This patch fixes the oldish (2006) bug where VRP was not optimizing the comparison for assignments while handling them for GIMPLE_COND only. It just happens to also solves PR 103281 due to allowing to optimize `c < 1` to `c == 0` and then we get `(c == 0) == c` (which was handled by r14-2501-g285c9

[committed] [RISC-V] Handle more cases in riscv_expand_conditional_move

2023-08-07 Thread Jeff Law via Gcc-patches
As I've mentioned in the main zicond thread, Ventana has had patches that support more cases by first emitting a suitable scc instruction essentially as a canonicalization step of the condition for zicond. For example if we have (set (target) (if_then_else (op (reg1) (reg2))

Re: [RFC PATCH] i386: Do not sanitize upper part of V2SFmode reg with -fno-trapping-math [PR110832]

2023-08-07 Thread Uros Bizjak via Gcc-patches
On Mon, Jul 31, 2023 at 11:40 AM Richard Biener wrote: > > On Sun, 30 Jul 2023, Uros Bizjak wrote: > > > Also introduce -m[no-]mmxfp-with-sse option to disable trapping V2SF > > named patterns in order to avoid generation of partial vector V4SFmode > > trapping instructions. > > > > The new option

Re: [V2][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-08-07 Thread Kees Cook via Gcc-patches
On Fri, Aug 04, 2023 at 07:44:28PM +, Qing Zhao wrote: > This is the 2nd version of the patch, per our discussion based on the > review comments for the 1st version, the major changes in this version > are: Thanks for the update! > > 1. change the name "element_count" to "counted_by"; > 2. c

Re: [PATCH v1] Mode-Switching: Fix SET_SRC ICE when only one operand

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 07:13, Richard Biener wrote: On Mon, Aug 7, 2023 at 2:30 PM Pan Li via Gcc-patches wrote: From: Pan Li In same cases, like gcc/testsuite/gcc.dg/pr78148.c in RISC-V, there will be only 1 operand when SET_SRC in create_pre_exit. For example as below. (insn 13 9 14 2 (clobber (reg

Re: [V2][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-08-07 Thread Qing Zhao via Gcc-patches
> On Aug 7, 2023, at 12:16 PM, Kees Cook wrote: > > On Fri, Aug 04, 2023 at 07:44:28PM +, Qing Zhao wrote: >> This is the 2nd version of the patch, per our discussion based on the >> review comments for the 1st version, the major changes in this version >> are: > > Thanks for the update! >

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 08:44, Manolis Tsamis wrote: I have sent out a new v4 of this (https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626502.html). In the new version I both restore the INSN_CODE as mentioned here and I also call recog when I commit the offset change (because there may be a change f

Re: [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 07:32, Stefan Schulze Frielinghaus via Gcc-patches wrote: This fixes the rather new tests cmp-mem-const-{1,2,3,4,5,6}.c for sparc. For -1 and -2 we need at least optimization level 2 on sparc. For the sake of homogeneity, change all test cases to -O2. For -3 and -4 we do not end up

Re: [PATCH] cprop_hardreg: Allow more propagation of the stack pointer.

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 05:31, Manolis Tsamis wrote: The stack pointer propagation fix 736f8fd3 turned out to be more restrictive than needed by rejecting propagation of the stack pointer when REG_POINTER didn't match. This commit removes this check: When the stack pointer is propagated it is fine for this

[COMMITTED] MAINTAINERS: Add myself as a BPF port reviewer

2023-08-07 Thread David Faust via Gcc-patches
ChangeLog: * MAINTAINERS: Add the BPF port to my reviewer listing. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 6cac5ac6671..1e54844c905 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -273,7 +273,7 @@ arc port

[RFC] GCC Security policy

2023-08-07 Thread David Edelsohn via Gcc-patches
FOSS Best Practices recommends that projects have an official Security policy stated in a SECURITY.md or SECURITY.txt file at the root of the repository. GLIBC and Binutils have added such documents. Appended is a prototype for a Security policy file for GCC based on the Binutils document because

Re: [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote: r14-2875-g1ed21e23d6d4da ("Use substituted GDCFLAGS") already implemented this change, but only on the generated file rather than in the template it is generated from. ChangeLog: * Makefile.tpl: Substitute @GDCFLAGS@ instead of

Re: [PATCH 03/24] gcc-4.5 build fixes

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote: From: Alan Modra Trying to build binutils with an older gcc currently fails. Working around these gcc bugs is not onerous so let's fix them. include/ChangeLog: * xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary

Re: [PATCH] cprop_hardreg: Allow more propagation of the stack pointer.

2023-08-07 Thread Philipp Tomsich
Applied to master, thanks! --Philipp. On Mon, 7 Aug 2023 at 19:20, Jeff Law wrote: > > > > On 8/7/23 05:31, Manolis Tsamis wrote: > > The stack pointer propagation fix 736f8fd3 turned out to be more restrictive > > than needed by rejecting propagation of the stack pointer when REG_POINTER > > di

Re: [PATCH 1/2] libstdc++: Implement more maintainable header

2023-08-07 Thread Arsen Arsenović via Gcc-patches
Jonathan Wakely writes: > [...snip...] > It looks like this will regenerate the bits/version.h file if it's older > than the definitions or the autogen template, right? > > Generally we don't want to touch anything in the source tree as part of a > normal build. It's OK to do that when configured

Re: [PATCH 4/5] [RISC-V] Generate Zicond instruction for select pattern with condition eq or neq to non-zero

2023-08-07 Thread Jeff Law via Gcc-patches
On 7/19/23 04:11, Xiao Zeng wrote: This patch completes the recognition of Zicond when the select pattern with condition eq or neq to non-zero (using equality as an example), namely: 1 rd = (rs2 == non-imm) ? 0 : rs1 2 rd = (rs2 == reg) ? 0 : rs1 At the same time, more Zicond non basic seman

Re: [PATCH v2] rs6000: Fix __builtin_altivec_vcmpne{b,h,w} implementation

2023-08-07 Thread Carl Love via Gcc-patches
On Mon, 2023-08-07 at 17:18 +0800, Kewen.Lin wrote: > Hi Carl, > > Sorry for the late review. > > on 2023/8/2 02:29, Carl Love wrote: > > GCC maintainers: > > > > Ver 2: Re-worked the test vec-cmpne.c to create a compile only > > test > > verify the instruction generation and a runnable test to

Re: [PATCH 2/2] libstdc++: Replace all manual FTM definitions and use

2023-08-07 Thread Arsen Arsenović via Gcc-patches
Jonathan Wakely writes: > On Sat, 29 Apr 2023 at 11:24, Arsen Arsenović via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> libstdc++-v3/ChangeLog: >> >> * libsupc++/typeinfo: Switch to bits/version.h for >> __cpp_lib_constexpr_typeinfo. >> >> > Does this change have an impact o

Re: [PATCH 05/24] GCC: Check if AR works with --plugin and rc

2023-08-07 Thread Jeff Law via Gcc-patches
On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote: From: "H.J. Lu" AR from older binutils doesn't work with --plugin and rc: [hjl@gnu-cfl-2 bin]$ touch foo.c [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c [hjl@gnu-cfl-2 bin]

  1   2   >