[PATCH] pch, v2: Add support for PCH for relocatable executables

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 08, 2021 at 08:48:07PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: > > So, if we want to make PCH work for PIEs, I'd say we can: > > 1) add a new GTY option, say callback, which would act like > >skip f

Re: [PATCH] Don't allow mask/sse/mmx mov in TLS code sequences.

2021-11-18 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 18, 2021 at 8:18 AM liuhongt wrote: > > As change in assembler, refer to [1], this patch disallow mask/sse/mmx > mov in TLS code sequences which require integer MOV instructions. > > [1] > https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d7e3e627027fcf37d63e284144fe27ff4eba36b

[committed] libgomp: Fix up aligned_alloc arguments [PR102838]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
Hi! C says that aligned_alloc size must be an integral multiple of alignment. While glibc doesn't care about it, apparently Solaris does. So, this patch decreases the priority of aligned_alloc among the other variants because it needs more work and can waste more memory and rounds up the size to m

Re: [PATCH] i386: Fix wrong codegen for -mrelax-cmpxchg-loop

2021-11-18 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 18, 2021 at 8:37 AM Hongyu Wang wrote: > > Hi Uros, > > For -mrelax-cmpxchg-loop introduced by PR 103069/r12-5265, it would > produce infinite loop. The correct code should be > > .L84: > movl(%rdi), %ecx > movl%eax, %edx > orl %esi, %edx > c

[committed] libgomp: Ensure that either gomp_team is properly aligned [PR102838]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
Hi! struct gomp_team has struct gomp_work_share array inside of it. If that latter structure has 64-byte aligned member in the middle, the whole struct gomp_team needs to be 64-byte aligned, but we weren't allocating it using gomp_aligned_alloc. This patch fixes that, except that on gcn team_mall

Re: [PATCH v2] x86: Add -mindirect-branch-cs-prefix

2021-11-18 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 2:47 PM H.J. Lu wrote: > > Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to thunk > via r8-r15 registers when converting indirect call and jump to increase > the instruction length to 6, allowing the non-thunk form to be inlined. > > gcc/ > > PR t

[PATCH] testsuite/103278 - adjust gcc.dg/tree-ssa/if-to-switch-3.c

2021-11-18 Thread Richard Biener via Gcc-patches
Analysis shows that after the CD-DCE change we produce better code which makes if-to-switch run into case-values-threshold on some architectures, thus the switch is deemed to simple to be worth generating. The following statically provides --param case-values-threshold to make the testcase less ta

[PATCH] tree-optimization/103277 - do abnormal cleanup after call DSE

2021-11-18 Thread Richard Biener via Gcc-patches
We can now DSE calls in more cases which requires us to eventually purge dead abnormal edges. This implements this. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2021-11-18 Richard Biener PR tree-optimization/103277 * tree-ssa-dse.c (need_ab_cleanup

Re: [PATCH] libsanitizer: Fix bootstrap on FreeBSD [PR102675]

2021-11-18 Thread Richard Biener via Gcc-patches
On Wed, 17 Nov 2021, Jakub Jelinek wrote: > On Mon, Nov 08, 2021 at 08:50:41AM +0100, Gerald Pfeifer wrote: > > This is the first part I committed on Friday, the second will > > follow today. > > Here is an alternative to the patch changing a file imported from > compiler-rt upstream, so that we

Re: [PATCH] Do not abort compilation when dump file is /dev/*

2021-11-18 Thread Richard Biener via Gcc-patches
On Tue, 16 Nov 2021, Giuliano Belinassi wrote: > The `configure` scripts generated with autoconf often tests compiler > features by setting output to `/dev/null`, which then sets the dump > folder as being /dev/* and the compilation halts with an error because > GCC cannot create files in /dev/. T

Re: [PATCH v1 6/8] RISC-V: bitmanip: add splitter to use bexti for "(a & (1 << BIT_NO)) ? 0 : -1"

2021-11-18 Thread Kito Cheng via Gcc-patches
> --- a/gcc/config/riscv/bitmanip.md > +++ b/gcc/config/riscv/bitmanip.md > @@ -367,3 +367,16 @@ (define_insn "*bexti" >"TARGET_ZBS" >"bexti\t%0,%1,%2" >[(set_attr "type" "bitmanip")]) > + > +;; We can create a polarity-reversed mask (i.e. bit N -> { set = 0, clear = > -1 }) > +;; usin

[PATCH] IBM Z: Fix load-and-test peephole2 condition

2021-11-18 Thread Stefan Schulze Frielinghaus via Gcc-patches
For a peephole2 condition variable insn points to the first matched insn. In order to refer to the second matched insn use peep2_next_insn(1) instead. Bootstrapped and regtested on IBM Z. Ok for mainline and gcc-{11,10,9}? gcc/ChangeLog: * config/s390/s390.md (define_peephole2): Variab

Re: [PATCH] PR fortran/101329 - ICE: Invalid expression in gfc_element_size

2021-11-18 Thread Thomas Koenig via Gcc-patches
On 17.11.21 22:28, Harald Anlauf via Fortran wrote: Dear Fortranners, as NULL() is not interoperable, we have to reject it. Confirmed by NAG. Other compilers show "interesting behavior". Obvious patch by Steve. Regtested on x86_64-pc-linux-gnu. OK for mainline? OK, and thanks! Best regard

[PATCH] fixincludes: don't abort() on access failure [PR103306]

2021-11-18 Thread Xi Ruoyao via Gcc-patches
Some distro may ship dangling symlinks in include directories, triggers the access failure. Skip it and continue to next header instead of being to panic. Restore to old behavior before r12-5234 but without resurrecting the problematic getcwd() call, by using the environment variable "INPUT" expo

Re: [AArch64] Enable generation of FRINTNZ instructions

2021-11-18 Thread Richard Biener via Gcc-patches
On Wed, 17 Nov 2021, Andre Vieira (lists) wrote: > > On 16/11/2021 12:10, Richard Biener wrote: > > On Fri, 12 Nov 2021, Andre Simoes Dias Vieira wrote: > > > >> On 12/11/2021 10:56, Richard Biener wrote: > >>> On Thu, 11 Nov 2021, Andre Vieira (lists) wrote: > >>> > Hi, > > This p

Re: [PATCH]middle-end: Fix FMA detection when inspecting gimple which have no LHS.

2021-11-18 Thread Richard Biener via Gcc-patches
On Tue, 16 Nov 2021, Tamar Christina wrote: > Hi All, > > convert_mult_to_fma assumes that all gimple_assigns have a LHS set. This > assumption is however not true when an IFN is kept around just for the > side-effects. In those situations you have just the IFN and lhs will be null. > > Since

Re: [Patch] libcpp: Fix _Pragma in #__VA_ARGS__ [PR103165]

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 10, 2021 at 09:30:29PM +, Joseph Myers wrote: > On Wed, 10 Nov 2021, Tobias Burnus wrote: > > > Disclaimer: While this patch does a step into the right direction, > > it probably does help with any of the other _Pragma issues. Neither > > with 'gcc -E' when the pragma wasn't regist

Re: [PATCH] Do not abort compilation when dump file is /dev/*

2021-11-18 Thread Martin Liška
On 11/16/21 17:52, Giuliano Belinassi via Gcc-patches wrote: |+ if (strncmp(slash_dev, filename, strlen(slash_dev)) == 0)| Btw. you can use startswith function. Cheers, Martin

[PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Martin Liška
modref_tree::merge(modref_tree*, vec*, modref_parm_map*, bool) is called with modref_parm_map chain_map; The variable has uninitialized m.parm_offset_known and it is accessed here: gcc/ipa-modref-tree.h:572 a.parm_offset_known &= m.parm_offset_known; Ready to be installed after testing? Thanks

Re: [PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Jan Hubicka via Gcc-patches
> modref_tree::merge(modref_tree*, vec va_heap, vl_ptr>*, modref_parm_map*, bool) > > is called with modref_parm_map chain_map; > > The variable has uninitialized m.parm_offset_known and it is accessed > here: > > gcc/ipa-modref-tree.h:572 a.parm_offset_known &= m.parm_offset_known; > > Ready t

Re: [PATCH][V4] rs6000: Remove unnecessary option manipulation.

2021-11-18 Thread Martin Liška
@Segher: PING On 11/12/21 17:12, Martin Liska wrote: Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops) in the common.opt file. Use EnabledBy for unroll_only_small_loops which is a canonical approach how can be make option dependencies. gcc/ChangeLog:

Re: [PATCH] Do not abort compilation when dump file is /dev/*

2021-11-18 Thread Giuliano Belinassi via Gcc-patches
On Thu, 2021-11-18 at 10:43 +0100, Richard Biener wrote: > On Tue, 16 Nov 2021, Giuliano Belinassi wrote: > > > The `configure` scripts generated with autoconf often tests > > compiler > > features by setting output to `/dev/null`, which then sets the dump > > folder as being /dev/* and the compil

Re: [PATCH 1/3] nptl: Extract from pthread_cond_common.c

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:27:42PM +0100, Florian Weimer wrote: > + /* S3. See __condvar_load_64_relaxed. */ Shouldn't that be See __atomic_wide_counter_load_relaxed ? > + if (((l >> 31) > 0) && ((h >> 31) > 0)) Any reason not to write it as (int) l < 0 && (int) h < 0? Yes, the compiler

Re: [PATCH 1/3] nptl: Extract from pthread_cond_common.c

2021-11-18 Thread Florian Weimer via Gcc-patches
* Jakub Jelinek: > On Wed, Nov 03, 2021 at 05:27:42PM +0100, Florian Weimer wrote: >> + /* S3. See __condvar_load_64_relaxed. */ > > Shouldn't that be See __atomic_wide_counter_load_relaxed ? I'm going to fix the stale reference, thanks. >> + if (((l >> 31) > 0) && ((h >> 31) > 0)) > > A

Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! On 11/17/21 5:06 PM, Bill Schmidt wrote: > On 11/17/21 3:32 PM, Segher Boessenkool wrote: >> On Wed, Nov 17, 2021 at 02:58:54PM -0600, Bill Schmidt wrote: >>> Hi! This patch is broken out of the previous patch for all the builtins >>> test >>> suite adjustments. Here we have some slight cha

[PATCH] rs6000: Builtins test changes for byte-in-set-2.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! This patch is broken out from the previous patch for builtins test suite changes. With the old builtins support, this test case produces: warning: implicit declaration of function '__builtin_byte_in_set'; did you mean '__builtin_byte_in_range'? With the new support, it produces: error:

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote: > This function is similar to __gnu_Unwind_Find_exidx as used on arm. > It can be used to speed up the libgcc unwinder. I'm little bit worried that this trades the speed of exceptions for speed of dlopen/dlclose and extra memory use i

[PATCH] rs6000: Builtins test changes for compare-bytes tests

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! This patch is broken out from the patch with test suite changes for the new builtins support. With the old builtins support, cmpb-2.c produces: warning: implicit declaration of function '__builtin_cmpb; did you mean '__builtin_bcmp'? With the new support, it produces: error: '__builtin_

Re: [PATCH 1/4] libgcc: Remove tbase member from struct unw_eh_callback_data

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:35PM +0100, Florian Weimer wrote: > It is always a null pointer. > > libgcc/ChangeLog > > * unwind-dw2-fde-dip.c (struct unw_eh_callback_data): Remove > tbase member. > (base_from_cb_data): Adjust. > (_Unwind_IteratePhdrCallback): Likewise. >

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Florian Weimer via Gcc-patches
* Jakub Jelinek: > On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote: >> This function is similar to __gnu_Unwind_Find_exidx as used on arm. >> It can be used to speed up the libgcc unwinder. > > I'm little bit worried that this trades the speed of exceptions for > speed of dlopen/dlc

Re: Fix gamess miscompare

2021-11-18 Thread Richard Biener via Gcc-patches
On Wed, Nov 17, 2021 at 10:09 PM Jan Hubicka via Gcc-patches wrote: > > Hi, > this patch fixes bug in streaming in modref access tree that now cause a > failure > of gamess benchmark. The bug is quite old (present in GCC11 release) but it > needs quite interesting series of events to manifest. I

Re: [PATCH] Reduce cost of aligned sse register store.

2021-11-18 Thread Richard Biener via Gcc-patches
On Thu, Nov 18, 2021 at 7:17 AM liuhongt via Gcc-patches wrote: > > Make them be equal to cost of unaligned ones to avoid odd alignment > peeling. > > Impact for SPEC2017 on CLX: > fprate: > 503.bwaves_rBuildSame > 507.cactuBSSN_r -0.22 > 508.namd_r -0.02 > 510.parest_r

Re: [PATCH] Do not abort compilation when dump file is /dev/*

2021-11-18 Thread Richard Biener via Gcc-patches
On Thu, 18 Nov 2021, Giuliano Belinassi wrote: > On Thu, 2021-11-18 at 10:43 +0100, Richard Biener wrote: > > On Tue, 16 Nov 2021, Giuliano Belinassi wrote: > > > > > The `configure` scripts generated with autoconf often tests > > > compiler > > > features by setting output to `/dev/null`, which

[PATCH v3] x86: Add -mindirect-branch-cs-prefix

2021-11-18 Thread H.J. Lu via Gcc-patches
On Thu, Nov 18, 2021 at 12:25 AM Uros Bizjak wrote: > > On Wed, Nov 17, 2021 at 2:47 PM H.J. Lu wrote: > > > > Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to thunk > > via r8-r15 registers when converting indirect call and jump to increase > > the instruction length to 6, all

[PATCH] Detect Power10 CPU on AIX

2021-11-18 Thread David Edelsohn via Gcc-patches
For -mcpu=native, GCC needs to detect the processor. This patch adds the processor value for Power10. Suggested by Kevin Alder. * config/rs6000/driver-rs6000.c (detect_processor_aix): Add power10. Bootstrapped on powerpc-ibm-aix7.2.3.0 diff -

[committed] libstdc++: Replace AC_CACHE_VAL with AC_CACHE_CHECK

2021-11-18 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc64le-linux, pushed to trunk. This replaces most uses of AC_CACHE_VAL with AC_CACHE_CHECK, which means we don't need separate AC_MSG_CHECKING and AC_MSG_RESULT macros. There are a few trivial bugs fixed as a side effect, where an AC_MSG_RESULT was printed out even i

Re: [PATCH 2/5] gimple-match: Add a gimple_extract_op function

2021-11-18 Thread Richard Biener via Gcc-patches
On Tue, Nov 16, 2021 at 4:51 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Wed, Nov 10, 2021 at 1:46 PM Richard Sandiford via Gcc-patches > > wrote: > >> > >> code_helper and gimple_match_op seem like generally useful ways > >> of summing up a gimple_assign or gimple_call (or gim

Re: [PATCH 2/4] libgcc: Remove dbase member from struct unw_eh_callback_data if NULL

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:41PM +0100, Florian Weimer wrote: > Only i386 and nios2 need this member at present. Only i386, nios2, frv and bfin to be precise. > > libgcc/ChangeLog > > * unwind-dw2-fde-dip.c (NEED_DBASE_MEMBER): Define. > (struct unw_eh_callback_data): Make dbase m

Re: [PATCH] c++: template-id ADL and partial instantiation [PR99911]

2021-11-18 Thread Patrick Palka via Gcc-patches
On Thu, 18 Nov 2021, Jason Merrill wrote: > On 11/10/21 11:53, Patrick Palka wrote: > > Here when partially instantiating the call get(T{}) with T=N::A > > (for which earlier unqualified name lookup for 'get' found nothing) > > the arguments after substitution are no longer dependent but the calle

[PATCH take 2] ivopts: Improve code generated for very simple loops.

2021-11-18 Thread Roger Sayle
Hi Richard, Many thanks for the patch review. On Tue, Nov 16, 2021 at 12:38 Richard Biener wrote: > On Mon, Nov 15, 2021 at 2:04 PM Roger Sayle > wrote: > > > > This patch tidies up the code that GCC generates for simple loops, by > > selecting/generating a simpler loop bound expression in ivopt

Re: [PATCH 3/4] libgcc: Split FDE search code from PT_GNU_EH_FRAME lookup

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:48PM +0100, Florian Weimer wrote: > @@ -383,12 +376,34 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, > size_t size, void *ptr) > # endif > #endif > > - _Unwind_Ptr dbase = unw_eh_callback_data_dbase (data); > + return 1; > +} > + > +/* Result type o

Re: [PATCH] c++: template-id ADL and partial instantiation [PR99911]

2021-11-18 Thread Patrick Palka via Gcc-patches
On Thu, 18 Nov 2021, Patrick Palka wrote: > On Thu, 18 Nov 2021, Jason Merrill wrote: > > > On 11/10/21 11:53, Patrick Palka wrote: > > > Here when partially instantiating the call get(T{}) with T=N::A > > > (for which earlier unqualified name lookup for 'get' found nothing) > > > the arguments a

Re: [PATCH 3/4] Darwin : Allow for configuring Darwin to use embedded runpath.

2021-11-18 Thread Jonathan Wakely via Gcc-patches
On Wed, 17 Nov 2021 at 21:28, Iain Sandoe via Libstdc++ < libstd...@gcc.gnu.org> wrote: > this refers to the libstdc++ changes (mostly a regeneration from the > libtool > change) but a small addition to Makefile.am to add @loader_path as a > default for libstdc++ to find its dependent libs. > Th

Re: [PATCH] c++: designated init of char array by string constant [PR55227]

2021-11-18 Thread Marek Polacek via Gcc-patches
On Wed, Nov 17, 2021 at 10:23:58PM -0500, will wray wrote: > V2 Patch > https://gcc.gnu.org/bugzilla/attachment.cgi?id=51828 Can you please post the v2 here on the mailing list? It will be easier for us to reply. Preferably with the subject adjusted to say [PATCH v2] ... > On Wed, Nov 17, 2021

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:02PM +0100, Florian Weimer wrote: > --- /dev/null > +++ b/bits/dlfcn_eh_frame.h > @@ -0,0 +1,33 @@ > +/* System dependent definitions for find unwind information using ld.so. > + Copyright (C) 2021 Free Software Foundation, Inc. > + This file is part of the GNU C L

Re: [PATCH 1/2][GCC] arm: Move arm_simd_info array declaration into header

2021-11-18 Thread Richard Earnshaw via Gcc-patches
On 16/11/2021 10:14, Murray Steele via Gcc-patches wrote: Hi all, This patch moves the arm_simd_type and arm_type_qualifiers enums, and arm_simd_info struct from arm-builtins.c into arm-builtins.h header. This is a first step towards internalising the type definitions for MVE predicate, vect

Re: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

2021-11-18 Thread Richard Earnshaw via Gcc-patches
On 16/11/2021 10:15, Murray Steele via Gcc-patches wrote: Hi all, This patch moves the implementation of MVE ACLE types from arm_mve_types.h to inside GCC via a new pragma, which replaces the prior type definitions. This allows for the types to be used internally for intrinsic function defini

Re: [PATCH 4/4] libgcc: Use _dl_find_eh_frame in _Unwind_Find_FDE

2021-11-18 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 03, 2021 at 05:28:55PM +0100, Florian Weimer wrote: > --- a/libgcc/unwind-dw2-fde-dip.c > +++ b/libgcc/unwind-dw2-fde-dip.c > @@ -129,6 +129,30 @@ unw_eh_callback_data_dbase (const struct > unw_eh_callback_data *data > #endif > } > > +#ifdef DL_FIND_EH_FRAME_DBASE > +#if DL_FIND_EH

Re: [PATCH v2] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction

2021-11-18 Thread Andrew MacLeod via Gcc-patches
On 11/15/21 12:24, Di Zhao OS via Gcc-patches wrote: Attached is the updated patch. Fixed some errors in testcases. -Original Message- From: Richard Biener Sent: Wednesday, November 10, 2021 5:44 PM To: Di Zhao OS Cc: gcc-patches@gcc.gnu.org; Andrew MacLeod Subject: Re: [PATCH v2] tr

Re: [PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Martin Sebor via Gcc-patches
On 11/18/21 5:41 AM, Jan Hubicka via Gcc-patches wrote: modref_tree::merge(modref_tree*, vec*, modref_parm_map*, bool) is called with modref_parm_map chain_map; The variable has uninitialized m.parm_offset_known and it is accessed here: gcc/ipa-modref-tree.h:572 a.parm_offset_known &= m.parm_o

[committed] Fix MIPS test after recent match.pd changes

2021-11-18 Thread Jeff Law via Gcc-patches
Andrew's recent match.pd improvements resulted in octeon-bbit-1 failing on the MIPS platforms. What's going on is pretty simple.  We've got two functions that collapse into the same code after Andrew's change which causes ICF to kick in.  As a result we don't see as many bbit instructions as w

Re: [PATCH] restore ancient -Waddress for weak symbols [PR33925]

2021-11-18 Thread Jason Merrill via Gcc-patches
On 11/17/21 20:27, Martin Sebor wrote: On 11/17/21 12:21 PM, Martin Sebor wrote: On 11/17/21 11:31 AM, Jason Merrill wrote: On 11/16/21 20:11, Martin Sebor wrote: On 11/16/21 1:23 PM, Jason Merrill wrote: On 10/23/21 19:06, Martin Sebor wrote: On 10/4/21 3:37 PM, Jason Merrill wrote: On 10/

Re: [PATCH] c++: template-id ADL and partial instantiation [PR99911]

2021-11-18 Thread Jason Merrill via Gcc-patches
On 11/18/21 10:31, Patrick Palka wrote: On Thu, 18 Nov 2021, Patrick Palka wrote: On Thu, 18 Nov 2021, Jason Merrill wrote: On 11/10/21 11:53, Patrick Palka wrote: Here when partially instantiating the call get(T{}) with T=N::A (for which earlier unqualified name lookup for 'get' found nothi

[PATCH] rs6000: Builtin test changes for int_128bit-runnable.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi!  This patch is broken out from the test case patch for the new builtins support. The old builtins code performs gimple folding on 128-bit compares. This results in correct but very inefficient code. (I suspect we may be missing some optab entries, misleading gimple into 64-bit emulation.)

Re: [PATCH] regrename: Skip renaming if instruction is noop move.

2021-11-18 Thread Jeff Law via Gcc-patches
On 11/16/2021 7:20 PM, Jojo R via Gcc-patches wrote: — Jojo 在 2021年11月16日 +0800 PM8:12,Richard Biener ,写道: On Tue, Nov 16, 2021 at 12:45 PM Jojo R via Gcc-patches wrote: Skip renaming if instruction is noop move, and it will been removed for performance. Is there any (target specific) test

[PATCH] rs6000: Builtins test changes for pr80315-*.c, pr88100.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! This patch is broken out from the test case patch for the new builtins support. One advantage of the new builtins support is uniform error messages for arguments with restricted values. Previously this was done in many places in an ad hoc manner, with little uniformity. This patch adjusts t

[committed] libstdc++: Fix std::char_traits::move for constexpr

2021-11-18 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux (and with Clang), pushed to trunk. This should be backported to gcc-11 and gcc-10 too. The constexpr branch in __gnu_cxx::char_traits::move compares the string arguments to see if they overlap, but relational comparisons between unrelated pointers are not core constant ex

Re: [PATCH v3] x86: Add -mindirect-branch-cs-prefix

2021-11-18 Thread Uros Bizjak via Gcc-patches
On Thu, Nov 18, 2021 at 3:24 PM H.J. Lu wrote: > > On Thu, Nov 18, 2021 at 12:25 AM Uros Bizjak wrote: > > > > On Wed, Nov 17, 2021 at 2:47 PM H.J. Lu wrote: > > > > > > Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to thunk > > > via r8-r15 registers when converting indirect

[PATCH] rs6000: Builtins test changes for pragma_misc9.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! This patch is broken out from the test suite patch for the new builtins support. This one is just a minor adjustment for the error message wording. Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64) with no regressions. Is this okay for trunk? Thanks! Bill 2021-11-17 Bi

Re: [PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Jan Hubicka via Gcc-patches
> On 11/18/21 5:41 AM, Jan Hubicka via Gcc-patches wrote: > > > modref_tree::merge(modref_tree*, > > > vec*, modref_parm_map*, bool) > > > > > > is called with modref_parm_map chain_map; > > > > > > The variable has uninitialized m.parm_offset_known and it is accessed > > > here: > > > > > > gc

Re: [PATCH] rs6000: Builtin test changes for int_128bit-runnable.c

2021-11-18 Thread Segher Boessenkool
On Thu, Nov 18, 2021 at 10:09:53AM -0600, Bill Schmidt wrote: > Hi!  This patch is broken out from the test case patch for the new builtins > support. > > The old builtins code performs gimple folding on 128-bit compares. This > results in correct but very inefficient code. (I suspect we may be

Re: [PATCH 3/3] elf: Add _dl_find_eh_frame function

2021-11-18 Thread Florian Weimer via Gcc-patches
* Jakub Jelinek: > dl_iterate_phdr is declared in link.h and without the _ prefix, shouldn't > dl_find_eh_frame follow the suit and be declared in the same header and > also without the prefix? We need to use the _ prefix due to this bug: dl_iterate_phdr namespace violation

Re: [PATCH] Fix tree-optimization/103257: Missed jump threading due too early conversion of bool*A into bool?A:0

2021-11-18 Thread Jeff Law via Gcc-patches
On 11/17/2021 1:00 AM, apinski--- via Gcc-patches wrote: From: Andrew Pinski So like many optimizations on the gimple level, sometimes it makes sense to do the optimization early or later. In this case, creating a cond expression early causes other optimizations to be missed. So just disa

Re: [PATCH] rs6000: Builtin test changes for int_128bit-runnable.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! On 11/18/21 10:22 AM, Segher Boessenkool wrote: > On Thu, Nov 18, 2021 at 10:09:53AM -0600, Bill Schmidt wrote: >> Hi!  This patch is broken out from the test case patch for the new builtins >> support. >> >> The old builtins code performs gimple folding on 128-bit compares. This >> results

[PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! This is the last patch broken out of the previous test suite patch for the new builtins support. One advantage of the new builtins support is uniform error messages for arguments with restricted values. Previously this was done in many places in an ad hoc manner, with little uniformity. Thi

Re: [PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Martin Sebor via Gcc-patches
On 11/18/21 9:22 AM, Jan Hubicka wrote: On 11/18/21 5:41 AM, Jan Hubicka via Gcc-patches wrote: modref_tree::merge(modref_tree*, vec*, modref_parm_map*, bool) is called with modref_parm_map chain_map; The variable has uninitialized m.parm_offset_known and it is accessed here: gcc/ipa-modref-t

Summary of outstanding builtins infrastructure patches

2021-11-18 Thread Bill Schmidt via Gcc-patches
Hi! Thanks for all the recent reviews and conversations on the builtins infrastructure patches. I've posted a lot of stuff in the last couple of days, so I thought it might be useful to summarize which patches still need review. No rush, just trying to make it easier to consume... https://gcc.g

[PATCH] middle-end: check that both sides of complex expression is a mul.

2021-11-18 Thread Tamar Christina via Gcc-patches
Hi All, Both sides of the VEC_PERM_EXPR need to be a MULT but the check was accidentally checking if both sides are a mul. The FMS case would be handled by the validate_multiplication but this makes the requirement more explicit and we exit earlier. Bootstrapped Regtested on aarch64-none-linux-g

Re: [PATCH] middle-end: check that both sides of complex expression is a mul.

2021-11-18 Thread Richard Biener via Gcc-patches
On November 18, 2021 5:57:45 PM GMT+01:00, Tamar Christina wrote: >Hi All, > >Both sides of the VEC_PERM_EXPR need to be a MULT but the check >was accidentally checking if both sides are a mul. > >The FMS case would be handled by the validate_multiplication but >this makes the requirement more ex

Re: [PATCH] Fix IPA modref ubsan.

2021-11-18 Thread Jan Hubicka via Gcc-patches
> > > I don't know what the guidance is on using vec in IPA passes > > > but with respect to existing practice elsewhere, there are > > > existing uses of vec and auto_vec with non-POD types and vec > > > does work with them (see the vec_default_construct and > > > vec_copy_construct templates, fo

Re: [PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-18 Thread Jan Hubicka via Gcc-patches
> Hi, > > On Fri, Nov 12 2021, Martin Jambor wrote: > > Hi, > > > > using -fno-semantic-interposition has been reported by various people > > to bring about considerable speed up at the cost of strict compliance > > to the ELF symbol interposition rules See for example > > https://fedoraproject.o

[PATCH] IPA: use cgraph_node instance

2021-11-18 Thread Martin Liška
Hi. This is a refactoring I noticed. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: * ipa-modref.c (analyze_function): Use fnode instead of repeated cgraph_node::get (current_function_decl). --- gcc/

[PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: * ipa-modref.c (analyze_function): Do not execute the code only if dump_file != NULL. --- gcc/ipa-modref.c | 14 +++--- 1 file changed, 7 insertio

Re: [PATCH] IPA: use cgraph_node instance

2021-11-18 Thread Jan Hubicka via Gcc-patches
> Hi. > > This is a refactoring I noticed. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * ipa-modref.c (analyze_function): Use fnode instead of repeated > cgraph_node::get (current_fu

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Jan Hubicka via Gcc-patches
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ChangeLog: > > * ipa-modref.c (analyze_function): Do not execute the code > only if dump_file != NULL. > --- > gcc/ipa-modref.c | 14 +++--- > 1 fil

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Martin Liška
x=/home/marxin/bin/gcc --disable-multilib --enable-host-shared --disable-libsanitizer --enable-valgrind-annotations --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 2028 (experimental) (GCC) /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warni

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Jan Hubicka via Gcc-patches
> Supported LTO compression algorithms: zlib zstd > gcc version 12.0.0 2028 (experimental) (GCC) > /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warning: relocation against > `lm_read_ctl_dict_size_n_lmclass_used' in read-only section `.text' > /usr/bin/ld: ./xxx.ltr

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Martin Liška
On 11/18/21 19:22, Jan Hubicka wrote: Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 2028 (experimental) (GCC) /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warning: relocation against `lm_read_ctl_dict_size_n_lmclass_used' in read-only section `.text' /usr/bin/ld: ./x

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Jan Hubicka via Gcc-patches
> On 11/18/21 19:22, Jan Hubicka wrote: > > > Supported LTO compression algorithms: zlib zstd > > > gcc version 12.0.0 2028 (experimental) (GCC) > > > /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warning: relocation against > > > `lm_read_ctl_dict_size_n_lm

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Martin Liška
On 11/18/21 19:29, Jan Hubicka wrote: On 11/18/21 19:22, Jan Hubicka wrote: Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 2028 (experimental) (GCC) /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warning: relocation against `lm_read_ctl_dict_size_n_lmclass_used' in read

Re: [PATCH] IPA: fix reproducibility in IPA MOD REF

2021-11-18 Thread Jan Hubicka via Gcc-patches
> > > > > > Isn't problem that the following code > > > > > >past_flags.reserve_exact (summary->arg_flags.length ()); > > >past_flags.splice (summary->arg_flags); > > >past_retslot_flags = summary->retslot_flags; > > > > Aha, that makes sense. Sorr

[PATCH] Fix rs6000 predicates.md use of decl_replaceable_p

2021-11-18 Thread David Edelsohn via Gcc-patches
--- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -1086,7 +1086,9 @@ (define_predicate "current_file_function_operand" (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)) && (SYMBOL_REF_LOCAL_P (op) ||

[PATCH] c++: cp_walk_subtrees simplification for *_CAST_EXPR

2021-11-18 Thread Patrick Palka via Gcc-patches
Let walk_tree_1 do the operand walking for us. Bootstrap and regtest on x86_64-pc-linux-gnu in progress, does this look OK for trunk if successful? gcc/cp/ChangeLog: * tree.c (cp_walk_subtrees) : Simplify. --- gcc/cp/tree.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/gcc/c

Re: [PATCH][V4] rs6000: Remove unnecessary option manipulation.

2021-11-18 Thread Segher Boessenkool
Hi! On Thu, Nov 18, 2021 at 01:45:30PM +0100, Martin Liška wrote: > @Segher: PING This is the first time I recieved this. Please resend, without line wrapping (format=flawed). Segher

Re: [PATCH 2/5] gimple-match: Add a gimple_extract_op function

2021-11-18 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Tue, Nov 16, 2021 at 4:51 PM Richard Sandiford > wrote: >> >> Richard Biener writes: >> > On Wed, Nov 10, 2021 at 1:46 PM Richard Sandiford via Gcc-patches >> > wrote: >> >> >> >> code_helper and gimple_match_op seem like generally useful ways >> >> of summing up a g

Re: [PATCH] Fix rs6000 predicates.md use of decl_replaceable_p

2021-11-18 Thread Jan Hubicka via Gcc-patches
> --- a/gcc/config/rs6000/predicates.md > +++ b/gcc/config/rs6000/predicates.md > @@ -1086,7 +1086,9 @@ (define_predicate "current_file_function_operand" > (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)) > && (SYMBOL_REF_LOCAL_P (op) >

Re: [PATCH] Fix rs6000 predicates.md use of decl_replaceable_p

2021-11-18 Thread David Edelsohn via Gcc-patches
On Thu, Nov 18, 2021 at 2:07 PM Jan Hubicka wrote: > > > --- a/gcc/config/rs6000/predicates.md > > +++ b/gcc/config/rs6000/predicates.md > > @@ -1086,7 +1086,9 @@ (define_predicate "current_file_function_operand" > > (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)) > >

Re: [PATCH] Fix rs6000 predicates.md use of decl_replaceable_p

2021-11-18 Thread Jan Hubicka via Gcc-patches
> On Thu, Nov 18, 2021 at 2:07 PM Jan Hubicka wrote: > > > > > --- a/gcc/config/rs6000/predicates.md > > > +++ b/gcc/config/rs6000/predicates.md > > > @@ -1086,7 +1086,9 @@ (define_predicate "current_file_function_operand" > > > (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-18 Thread Jason Merrill via Gcc-patches
On 11/17/21 17:51, Matthias Kretz wrote: On Wednesday, 17 November 2021 19:25:46 CET Jason Merrill wrote: On 11/17/21 04:04, Matthias Kretz wrote: On Wednesday, 17 November 2021 07:09:18 CET Jason Merrill wrote: - if (CHECKING_P) -SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, TREE_VEC_LENGTH (a

Re: [PATCH] c++: implicit dummy object in requires clause [PR103198]

2021-11-18 Thread Jason Merrill via Gcc-patches
On 11/17/21 14:52, Patrick Palka wrote: On Wed, 17 Nov 2021, Jason Merrill wrote: On 11/11/21 20:25, Patrick Palka wrote: In the testcase below satisfaction misbehaves for f and g ultimately because find_template_parameters fails to notice that the constraint 'val.x' depends on the template pa

Re: [PATCH] c++: cp_walk_subtrees simplification for *_CAST_EXPR

2021-11-18 Thread Jason Merrill via Gcc-patches
On 11/18/21 13:47, Patrick Palka wrote: Let walk_tree_1 do the operand walking for us. Bootstrap and regtest on x86_64-pc-linux-gnu in progress, does this look OK for trunk if successful? OK. gcc/cp/ChangeLog: * tree.c (cp_walk_subtrees) : Simplify. --- gcc/cp/tree.c | 7 ---

[PATCH] PR tree-optimization/103254 - Limit depth for all GORI expressions.

2021-11-18 Thread Andrew MacLeod via Gcc-patches
At issue here is the dynamic approach we currently use for outgoing edge calculations.  It isn't normally a problem, but once you get a very large number of possible outgoing values (ie very long unrolled blocks) with pairs of values on a statement, and individual queries for each one, it becom

Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).

2021-11-18 Thread Hafiz Abid Qadeer
On 02/11/2021 16:27, Jakub Jelinek wrote: > On Fri, Oct 22, 2021 at 02:05:02PM +0100, Hafiz Abid Qadeer wrote: >> This patch adds support for OpenMP 5.0 allocate clause for fortran. It does >> not >> yet support the allocator-modifier as specified in OpenMP 5.1. The allocate >> clause is already s

Re: [PATCH] c++: implicit dummy object in requires clause [PR103198]

2021-11-18 Thread Patrick Palka via Gcc-patches
On Thu, 18 Nov 2021, Jason Merrill wrote: > On 11/17/21 14:52, Patrick Palka wrote: > > On Wed, 17 Nov 2021, Jason Merrill wrote: > > > > > On 11/11/21 20:25, Patrick Palka wrote: > > > > In the testcase below satisfaction misbehaves for f and g ultimately > > > > because find_template_parameters

Re: [PATCH 2/6] Add returns_zero_on_success/failure attributes

2021-11-18 Thread Segher Boessenkool
On Wed, Nov 17, 2021 at 10:43:58PM +, Joseph Myers wrote: > On Wed, 17 Nov 2021, Prathamesh Kulkarni via Gcc-patches wrote: > > More generally, would it be a good idea to provide attributes for > > mod/ref anaylsis ? > > So sth like: > > void foo(void) __attribute__((modifies(errno))); > > whic

[PATCH v2] c++: designated init of char array by string constant [PR55227]

2021-11-18 Thread Will Wray via Gcc-patches
Also address "FIXME: this code is duplicated from reshape_init" in cp_complete_array_type by always calling reshape_init on init-list. PR c++/55227 gcc/cp/ChangeLog: * decl.c (reshape_init_r): Only call has_designator_check when first_initializer_p or for the inner constru

Re: [PATCH] c++: designated init of char array by string constant [PR55227]

2021-11-18 Thread will wray via Gcc-patches
V2 Patch mailing list post https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584897.html On Thu, Nov 18, 2021 at 10:36 AM Marek Polacek wrote: > > On Wed, Nov 17, 2021 at 10:23:58PM -0500, will wray wrote: > > V2 Patch > > https://gcc.gnu.org/bugzilla/attachment.cgi?id=51828 > > Can you ple

Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-18 Thread Segher Boessenkool
Hi! On Wed, Nov 17, 2021 at 05:06:05PM -0600, Bill Schmidt wrote: > > I don't like that at all. The user didn't write the _vsx thing, and it > > isn't documented either (neither is the _vec one, but that is a separate > > issue, specific to this builtin). > > I feel like I haven't explained this

Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-18 Thread Segher Boessenkool
On Thu, Nov 18, 2021 at 07:32:27AM -0600, Bill Schmidt wrote: > >>> error: '__builtin_vsx_scalar_extract_sig' requires the '-mcpu=power9' > >>> option and either the '-m64' or '-mpowerpc64' option > >>> note: builtin '__builtin_vec_scalar_extract_sig' requires builtin > >>> '__builtin_vsx_sca

Re: [PATCH] rs6000: Builtins test changes for byte-in-set-2.c

2021-11-18 Thread Segher Boessenkool
On Thu, Nov 18, 2021 at 07:42:34AM -0600, Bill Schmidt wrote: > gcc/testsuite/ > * gcc.target/powerpc/byte-in-set-2.c: Adjust error message. "Adjust expected error message" maybe? Okay for trunk. Thanks! Segher

  1   2   >