[PATCH] RISC-V: Always define MULTILIB_DEFAULTS

2020-11-20 Thread Kito Cheng
- Define MULTILIB_DEFAULTS can reduce the total number of multilib if the default arch and ABI are listed in the multilib config. - This also simplify the implementation of --with-multilib-list. gcc/ChangeLog: * config.gcc (riscv*-*-*): Add TARGET_RISCV_DEFAULT_ABI and TARGE

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Martin Liška
On 11/17/20 10:57 AM, Sebastian Huber wrote: This is a proposal to get the gcda data for a gcda info in a free-standing environment. It is intended to be used with the -fprofile-info-section option. A crude test program which doesn't use a linker script is: Hello. I'm not pretty sure how this

Re: Improve handling of memory operands in ipa-icf 4/4

2020-11-20 Thread Martin Liška
On 11/19/20 11:14 AM, Jan Hubicka wrote: On 11/16/20 12:20 AM, Jan Hubicka wrote: This is controlled by -fipa-icf-alias-sets The patch drops too early, so we may end up processing function twice. Also if merging is not performed we lose code quality for no win (this is rare case). My original

Re: [PATCH v2] Add if-chain to switch conversion pass.

2020-11-20 Thread Martin Liška
On 11/19/20 3:46 PM, Richard Biener wrote: OK, so can you send an updated patch? Sure. Martin >From 76e8424bd54d15fb3b2a2bdb4179fa8773500381 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 28 Aug 2020 10:26:13 +0200 Subject: [PATCH] Add if-chain to switch conversion pass. gcc/ChangeLo

Re: [PATCH] c++, v2: Add __builtin_clear_padding builtin - C++20 P0528R3 compiler side [PR88101]

2020-11-20 Thread Richard Biener
On Thu, 19 Nov 2020, Jakub Jelinek wrote: > Hi! > > This is the whole __builtin_clear_padding patchset merged into a single > patch, + 2 new changes - one is that fold_builtin_1 now folds the > 1 argument (meant for users) __builtin_clear_padding into an internal > 2 argument form, where the seco

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Sebastian Huber
On 20/11/2020 09:37, Martin Liška wrote: On 11/17/20 10:57 AM, Sebastian Huber wrote: This is a proposal to get the gcda data for a gcda info in a free-standing environment.  It is intended to be used with the -fprofile-info-section option. A crude test program which doesn't use a linker scri

[PATCH] i386: Optimize abs expansion [PR97873]

2020-11-20 Thread Uros Bizjak via Gcc-patches
The patch introduces absM named pattern to generate optimal insn sequence for CMOVE_TARGET targets. Currently, the expansion goes through neg+max optabs, and the following code is generated: movl%edi, %eax negl%eax cmpl%edi, %eax cmovl %edi, %eax This sequence is un

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Martin Liška
On 11/20/20 10:25 AM, Sebastian Huber wrote: On 20/11/2020 09:37, Martin Liška wrote: On 11/17/20 10:57 AM, Sebastian Huber wrote: This is a proposal to get the gcda data for a gcda info in a free-standing environment.  It is intended to be used with the -fprofile-info-section option. A crude

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-11-20 Thread Richard Biener via Gcc-patches
On Fri, Apr 3, 2020 at 8:15 PM Egeyar Bagcioglu wrote: > > > > On 3/18/20 10:05 AM, Martin Liška wrote: > > On 3/17/20 7:43 PM, Egeyar Bagcioglu wrote: > >> Hi Martin, > >> > >> I like the patch. It definitely serves our purposes at Oracle and > >> provides another way to do what my previous patch

Use OEP_MATCH_SIDE_EFFECTS in ao_compare_refs

2020-11-20 Thread Jan Hubicka
Hi, As Jakub reminded me, I introduced OEP_MATCH_SIDE_EFFECTS for cases like ICF or tail merging where we merge accesses from different code paths. By default operand_equal_p is designed for accesses from one code path where we do not want to merge two side effects. Since compare_ao_refs is curren

[PATCH] Deal with (pattern) SLP consumed stmts in hybrid discovery

2020-11-20 Thread Richard Biener
This makes hybrid SLP discovery deal with stmts indirectly consumed by SLP, for example via patterns. This means that all uses of a stmt end up in SLP vectorized stmts. This helps my prototype patches for PR97832 where I make SLP discovery re-associate chains to make operands match. This ends up

Re: [PATCH] Additional small changes to support opaque modes

2020-11-20 Thread Richard Sandiford via Gcc-patches
acsawdey--- via Gcc-patches writes: > diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c > index ffc8099856d..41f5598de38 100644 > --- a/gcc/c/c-aux-info.c > +++ b/gcc/c/c-aux-info.c > @@ -413,6 +413,10 @@ gen_type (const char *ret_val, tree t, formals_style > style) > data_type = IDENT

Hash anonymous namesapce ODR names in ipa-icf

2020-11-20 Thread Jan Hubicka
Hi, Building libxul 400k mismerges are due to THIS parameters of member functions of polymorphic types that are in anonymous namespaces. We already hash ODR names of the types, but all anonymous type have name "". These can be distinguished by TYPE_MAIN_VARIANT that is implemented by this patch.

Re: Use OEP_MATCH_SIDE_EFFECTS in ao_compare_refs

2020-11-20 Thread Richard Biener via Gcc-patches
On Fri, Nov 20, 2020 at 10:53 AM Jan Hubicka wrote: > > Hi, > As Jakub reminded me, I introduced OEP_MATCH_SIDE_EFFECTS for cases like > ICF or tail merging where we merge accesses from different code paths. > By default operand_equal_p is designed for accesses from one code path > where we do not

[PATCH] Simplified construction of constants for __popcountSI2/__popcountDI2 in libgcc2.c

2020-11-20 Thread Stefan Kanthak
The construction of the "magic" constants 0x55...55, 0x33...33, 0x0f...0f and 0x01...01 in __popcountSI2 and __popcountDI2 with macros is awkward; these constants can simply be written as ((UWtype) ~0 / 3), ((UWtype) ~0 / 5), ((UWtype) ~0 / 17) and ((UWtype) ~0 / 255) Stefan Kanthak libgcc2.patch

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Sebastian Huber
On 20/11/2020 10:49, Martin Liška wrote: On 11/20/20 10:25 AM, Sebastian Huber wrote: On 20/11/2020 09:37, Martin Liška wrote: On 11/17/20 10:57 AM, Sebastian Huber wrote: This is a proposal to get the gcda data for a gcda info in a free-standing environment.  It is intended to be used with

Re: [PATCH] Simplified construction of constants for __popcountSI2/__popcountDI2 in libgcc2.c

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 20, 2020 at 11:08:41AM +0100, Stefan Kanthak wrote: > The construction of the "magic" constants 0x55...55, 0x33...33, 0x0f...0f > and 0x01...01 in __popcountSI2 and __popcountDI2 with macros is awkward; > these constants can simply be written as ((UWtype) ~0 / 3), > ((UWtype) ~0 / 5), (

Re: [PATCH] Remove lambdas from _Rb_tree

2020-11-20 Thread Jonathan Wakely via Gcc-patches
On 20/11/20 08:17 +0100, François Dumont via Libstdc++ wrote: Here is what I am testing. I use your enum proposal as an alias for the bool type. I cannot use it as template parameter on _M_copy unless I put it at std namespace level to use it in definition of the outline _M_copy overload. Y

RE: [PATCH] [PR target/97726] arm: [testsuite] fix some simd tests on armbe

2020-11-20 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Andrea Corallo > Sent: 16 November 2020 16:11 > To: Andrea Corallo via Gcc-patches > Cc: nd ; Richard Earnshaw ; > Kyrylo Tkachov > Subject: [PATCH] [PR target/97726] arm: [testsuite] fix some simd tests on > armbe > > Andrea Corallo via Gcc-patches writ

Re: [PATCH 01/31] PR target/58901: reload: Handle SUBREG of MEM with a mode-dependent address

2020-11-20 Thread Eric Botcazou
> First posted at: . > gcc/ > PR target/58901 > * reload.c (reload_inner_reg_of_subreg): Also request reloading > for pseudo registers associated with mode dependent memory > references. > (push_reload): Handle p

[PATCH] c++, v3: Add __builtin_clear_padding builtin - C++20 P0528R3 compiler side [PR88101]

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 20, 2020 at 09:19:31AM +, Richard Biener wrote: > > --- gcc/builtins.c.jj 2020-11-19 12:34:10.749514278 +0100 > > +++ gcc/builtins.c 2020-11-19 16:23:55.261250903 +0100 > > @@ -11189,6 +11189,13 @@ fold_builtin_1 (location_t loc, tree exp > > return build_empty_stmt (loc)

Re: [PATCH] Additional small changes to support opaque modes

2020-11-20 Thread Aaron Sawdey via Gcc-patches
> On Nov 20, 2020, at 3:55 AM, Richard Sandiford > wrote: > > acsawdey--- via Gcc-patches writes: >> diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c >> index ffc8099856d..41f5598de38 100644 >> --- a/gcc/c/c-aux-info.c >> +++ b/gcc/c/c-aux-info.c >> @@ -413,6 +413,10 @@ gen_type (const ch

RE: [PATCH] arm: Fix up neon_vector_mem_operand [PR97528]

2020-11-20 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Jakub Jelinek > Sent: 19 November 2020 18:57 > To: Richard Earnshaw ; Ramana > Radhakrishnan ; Kyrylo Tkachov > > Cc: gcc-patches@gcc.gnu.org > Subject: [PATCH] arm: Fix up neon_vector_mem_operand [PR97528] > > Hi! > > The documentation for POST_MODIFY sa

Re: [PATCH] Simplified construction of constants for __popcountSI2/__popcountDI2 in libgcc2.c

2020-11-20 Thread Stefan Kanthak
Jakub Jelinek wrote: > On Fri, Nov 20, 2020 at 11:08:41AM +0100, Stefan Kanthak wrote: >> The construction of the "magic" constants 0x55...55, 0x33...33, 0x0f...0f >> and 0x01...01 in __popcountSI2 and __popcountDI2 with macros is awkward; >> these constants can simply be written as ((UWtype) ~0

RE: [PATCH] Deal with (pattern) SLP consumed stmts in hybrid discovery

2020-11-20 Thread Tamar Christina via Gcc-patches
Hi Richi, > -Original Message- > From: rguent...@ryzen.fritz.box On Behalf Of > Richard Biener > Sent: Friday, November 20, 2020 9:54 AM > To: gcc-patches@gcc.gnu.org > Cc: Tamar Christina > Subject: [PATCH] Deal with (pattern) SLP consumed stmts in hybrid discovery > > This makes hybri

Re: [PATCH] libstdc++: Enable without gthreads

2020-11-20 Thread Jonathan Wakely via Gcc-patches
On 19/11/20 19:08 +, Jonathan Wakely wrote: On 19/11/20 13:36 +, Jonathan Wakely wrote: On 16/11/20 14:43 -0800, Thomas Rodgers wrote: This patch looks good to me. Committed now. This patch was also needed, but I don't understand why I didn't see the FAILs on gcc135 in teh cfarm.

Re: [PATCH] c++, v3: Add __builtin_clear_padding builtin - C++20 P0528R3 compiler side [PR88101]

2020-11-20 Thread Richard Biener
On Fri, 20 Nov 2020, Jakub Jelinek wrote: > On Fri, Nov 20, 2020 at 09:19:31AM +, Richard Biener wrote: > > > --- gcc/builtins.c.jj 2020-11-19 12:34:10.749514278 +0100 > > > +++ gcc/builtins.c2020-11-19 16:23:55.261250903 +0100 > > > @@ -11189,6 +11189,13 @@ fold_builtin_1 (locatio

RE: [PATCH] Deal with (pattern) SLP consumed stmts in hybrid discovery

2020-11-20 Thread Richard Biener
On Fri, 20 Nov 2020, Tamar Christina wrote: > Hi Richi, > > > -Original Message- > > From: rguent...@ryzen.fritz.box On Behalf Of > > Richard Biener > > Sent: Friday, November 20, 2020 9:54 AM > > To: gcc-patches@gcc.gnu.org > > Cc: Tamar Christina > > Subject: [PATCH] Deal with (patter

[PATCH] dump SLP_TREE_REPRESENTATIVE

2020-11-20 Thread Richard Biener
It always annoyed me to see those empty SLP nodes in dumpfiles: t.c:16:3: note: node 0x3a2a280 (max_nunits=1, refcnt=1) t.c:16:3: note: { } t.c:16:3: note: children 0x3a29db0 0x3a29e90 resulting from two-operator handling. The following makes sure to also dump the operation tem

Only copare sizes of automatic variables

2020-11-20 Thread Jan Hubicka
Hi, one of common remaining reasons for ICF to fail after loading in fuction body is mismatched type of automatic vairable. This is becuase compatible_types_p resorts to checking TYPE_MAIN_VARIANTS for euqivalence that prevents merging many TBAA compaitle cases. (And thus is also not reflected b

Re: Only copare sizes of automatic variables

2020-11-20 Thread Richard Biener
On Fri, 20 Nov 2020, Jan Hubicka wrote: > Hi, > one of common remaining reasons for ICF to fail after loading in fuction > body is mismatched type of automatic vairable. This is becuase > compatible_types_p resorts to checking TYPE_MAIN_VARIANTS for > euqivalence that prevents merging many TBAA

Re: Only copare sizes of automatic variables

2020-11-20 Thread Jan Hubicka
> On Fri, 20 Nov 2020, Jan Hubicka wrote: > > > Hi, > > one of common remaining reasons for ICF to fail after loading in fuction > > body is mismatched type of automatic vairable. This is becuase > > compatible_types_p resorts to checking TYPE_MAIN_VARIANTS for > > euqivalence that prevents merg

[PATCH]middle-end vect: Have vectorizable_slp_permutation set type on invariants

2020-11-20 Thread Tamar Christina via Gcc-patches
Hi All, This modifies vectorizable_slp_permutation to update the type of the children of a perm node before trying to permute them. This allows us to be able to permute invariant nodes. This will be covered by test from the SLP pattern matcher. Bootstrapped Regtested on aarch64-none-linux-gnu a

Re: [PATCH]middle-end vect: Have vectorizable_slp_permutation set type on invariants

2020-11-20 Thread Richard Biener
On Fri, 20 Nov 2020, Tamar Christina wrote: > Hi All, > > This modifies vectorizable_slp_permutation to update the type of the children > of a perm node before trying to permute them. This allows us to be able to > permute invariant nodes. > > This will be covered by test from the SLP pattern m

[committed] libstdc++: Remove dependency from [PR 92546]

2020-11-20 Thread Jonathan Wakely via Gcc-patches
Unlike the other headers that declare alias templates in namespace pmr, includes . That was done because the pmr::string::const_iterator typedef requires pmr::string to be complete, which requires pmr::polymorphic_allocator to be complete. By using __normal_iterator instead of the const_iterator

Re: [PATCH] libstdc++: Ensure __gthread_self doesn't call undefined weak symbol [PR 95989]

2020-11-20 Thread Jonathan Wakely via Gcc-patches
On 19/11/20 21:42 +, Jonathan Wakely wrote: On 12/11/20 17:34 +, Jonathan Wakely wrote: On 11/11/20 19:08 +0100, Jakub Jelinek via Libstdc++ wrote: On Wed, Nov 11, 2020 at 05:24:42PM +, Jonathan Wakely wrote: --- a/libgcc/gthr-posix.h +++ b/libgcc/gthr-posix.h @@ -684,7 +684,14 @@

[PATCH] libstdc++: Fix compilation error with clang-8 [PR 97876]

2020-11-20 Thread Jonathan Wakely via Gcc-patches
This fixes a compilation error with clang-8 and earlier. This change is only on the gcc-10 branch, not master, because the header is included indirectly in more places on the branch than on master. PR libstdc++/97876 * include/std/stop_token (_Stop_state_t): Define default

Re: [PATCH v2] Add if-chain to switch conversion pass.

2020-11-20 Thread Richard Biener via Gcc-patches
On Fri, Nov 20, 2020 at 9:57 AM Martin Liška wrote: > > On 11/19/20 3:46 PM, Richard Biener wrote: > > OK, so can you send an updated patch? + tree pos_one = build_int_cst (type, 1); + if (!left->m_has_forward_bb + && !right->m_has_forward_bb + && left->m_case_bb == righ

Re: [PATCH] Check calls before loop unrolling

2020-11-20 Thread David Edelsohn via Gcc-patches
On Fri, Nov 20, 2020 at 2:48 AM Richard Biener wrote: > > On Fri, Nov 20, 2020 at 12:58 AM Segher Boessenkool > wrote: > > > > On Thu, Nov 19, 2020 at 03:30:37PM -0700, Jeff Law wrote: > > > > No, the vast majority of people will *not* (consciously) use them, > > > > because the target defaults w

Re: [PATCH] [PR target/97726] arm: [testsuite] fix some simd tests on armbe

2020-11-20 Thread Andrea Corallo via Gcc-patches
Kyrylo Tkachov writes: >> -Original Message- >> From: Andrea Corallo >> Sent: 16 November 2020 16:11 >> To: Andrea Corallo via Gcc-patches >> Cc: nd ; Richard Earnshaw ; >> Kyrylo Tkachov >> Subject: [PATCH] [PR target/97726] arm: [testsuite] fix some simd tests on >> armbe >> >> Andr

doc: Fixup a couple of formatting nits

2020-11-20 Thread Nathan Sidwell
I noticed a couple of places we used @code{program} instead of @command{program}. gcc/ * doc/invoke.texi: Replace a couple of @code with @command pushing to trunk -- Nathan Sidwell diff --git c/gcc/doc/invoke.texi w/gcc/doc/invoke.texi index 07232c6b33d..29ae36861ad 100644 --- c

RE: [PATCH] [PR target/97727] aarch64: [testcase] fix bf16_vstN_lane_2.c for big endian targets

2020-11-20 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Andrea Corallo > Sent: 09 November 2020 18:24 > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ; Richard Earnshaw > ; nd ; > christophe.l...@linaro.org > Subject: [PATCH] [PR target/97727] aarch64: [testcase] fix > bf16_vstN_lane_2.c for big endian targets

Modules doc

2020-11-20 Thread Nathan Sidwell
Here is an update c++ modules documentation patch. I'd be grateful for review. Especially checking I'm not using too much implementor-speak nathan -- Nathan Sidwell diff --git c/gcc/doc/cppopts.texi w/gcc/doc/cppopts.texi index 7f1849d841f..e5ece92487b 100644 --- c/gcc/doc/cppopts.texi +++ w/g

Re: [PATCH] Check calls before loop unrolling

2020-11-20 Thread Jan Hubicka
> On Thu, Nov 19, 2020 at 03:30:37PM -0700, Jeff Law wrote: > > > No, the vast majority of people will *not* (consciously) use them, > > > because the target defaults will set things to useful values. > > > > > > The compiler could use saner "generic" defaults perhaps, but those will > > > still no

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Martin Liška
On 11/20/20 11:11 AM, Sebastian Huber wrote: On 20/11/2020 10:49, Martin Liška wrote: On 11/20/20 10:25 AM, Sebastian Huber wrote: On 20/11/2020 09:37, Martin Liška wrote: On 11/17/20 10:57 AM, Sebastian Huber wrote: This is a proposal to get the gcda data for a gcda info in a free-standing

Re: [PATCH 01/31] PR target/58901: reload: Handle SUBREG of MEM with a mode-dependent address

2020-11-20 Thread Maciej W. Rozycki
On Fri, 20 Nov 2020, Eric Botcazou wrote: > > gcc/ > > PR target/58901 > > * reload.c (reload_inner_reg_of_subreg): Also request reloading > > for pseudo registers associated with mode dependent memory > > references. > > (push_reload): Handle pseudo registers. > > The han

Re: [PATCH] [PR target/97727] aarch64: [testcase] fix bf16_vstN_lane_2.c for big endian targets

2020-11-20 Thread Andrea Corallo via Gcc-patches
Kyrylo Tkachov writes: >> -Original Message- >> From: Andrea Corallo >> Sent: 09 November 2020 18:24 >> To: gcc-patches@gcc.gnu.org >> Cc: Kyrylo Tkachov ; Richard Earnshaw >> ; nd ; >> christophe.l...@linaro.org >> Subject: [PATCH] [PR target/97727] aarch64: [testcase] fix >> bf16_vstN_

[PATCH] Power10: Add missing IEEE 128-bit XSCMP* built-in mappings.

2020-11-20 Thread Michael Meissner via Gcc-patches
Power10: Add missing IEEE 128-bit XSCMP* built-in mappings. This patch is a simplification of earlier patches to fix the built-in functions that introduced new power10 IEEE 128-bit instructions. Some of the built-in functions were already handled, but the scalar_cmp_exp_qp_gt, etc. functions were

re: FAIL: gcc.dg/pr97515.c

2020-11-20 Thread Andrew MacLeod via Gcc-patches
On 11/19/20 10:56 PM, sunil.k.pandey wrote: On Linux/x86_64, d0d8b5d83614d8f0d0e40c0520d4f40ffa01f8d9 is the first bad commit commit d0d8b5d83614d8f0d0e40c0520d4f40ffa01f8d9 Author: Andrew MacLeod Date: Thu Nov 19 17:41:30 2020 -0500 Process only valid shift ranges. caused FAIL: gcc.d

Re: [PATCH] gcov: Add __gcov_info_to_gdca()

2020-11-20 Thread Sebastian Huber
On 20/11/2020 16:25, Martin Liška wrote: Apart from these 2 hooks, I bet you will also need gcov_position and gcov_seek functions, can be seen in my sent patch. For what do I need them? I prefer the way with the 2 extra hooks. Can you please prepare a patch where the newly added functions

PDP endian bitfields

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 16, 2020 at 01:50:20PM -0500, Paul Koning wrote: > > On Nov 16, 2020, at 6:57 AM, Jakub Jelinek via Gcc-patches > > wrote: > > Working virtually out of Baker Island - AoE timezone. > > > > The following patch implements __builtin_clear_padding builtin that clears > > the padding bits

Nested declare target support

2020-11-20 Thread Kwok Cheung Yeung
Hello New OpenMP 5.0 features that won't be available in GCC 9, are planned for GCC 10 or later versions as time permits: ... - nested declare target support You said in an email two years ago that nested declare target was not supported yet. I do not see any patches that claim to implemen

Re: Modules doc

2020-11-20 Thread Marek Polacek via Gcc-patches
On Fri, Nov 20, 2020 at 10:19:55AM -0500, Nathan Sidwell wrote: > Here is an update c++ modules documentation patch. I'd be grateful for > review. Especially checking I'm not using too much implementor-speak > > nathan > -- > Nathan Sidwell > diff --git c/gcc/doc/cppopts.texi w/gcc/doc/cppopts

Re: Modules doc

2020-11-20 Thread Nathan Sidwell
thanks for taking a look, I hope this is better -- I add a forward reference from -fmodules-ts option description, so as to not have to explain C++ terms of art just there :) nathan -- Nathan Sidwell diff --git c/gcc/doc/cppopts.texi w/gcc/doc/cppopts.texi index 7f1849d841f..e5ece92487b 100644

Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Updates after latest review. (testing underway) --- There are four main features to this change: 1) Check pointer tags match address tags. When sanitizing for hwasan we now put HWASAN_CHECK internal functions before memory accesses in the `asan` pass. This checks that a tag in

Re: Update [PATCH 6/X] libsanitizer: Add hwasan pass and associated gimple changes

2020-11-20 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > @@ -7877,6 +7903,26 @@ gimple_build_vector (gimple_seq *seq, location_t loc, >return builder->build (); > } > > +/* Emit gimple statements into &stmts that take a value given in `old_size` > + and generate a value guaranteed to be rounded upwards to `align`. >

Re: [PATCH] Check calls before loop unrolling

2020-11-20 Thread Segher Boessenkool
Hi! On Fri, Nov 20, 2020 at 04:22:47PM +0100, Jan Hubicka wrote: > As you know I spend quite some time on inliner heuristics but even after > the years I have no clear idea how the requirements differs from x86-64 > to ppc, arm and s390. Clearly compared to x86_64 prologues may get more > expensi

Re: Document --with-build-config=bootstrap-asan option.

2020-11-20 Thread Matthew Malcomson via Gcc-patches
On 13/01/2020 10:40, Matthew Malcomson wrote: On 11/01/2020 07:19, Gerald Pfeifer wrote: On Thu, 12 Dec 2019, Matthew Malcomson wrote: gcc/ChangeLog: 2019-12-12 Matthew Malcomson * doc/install.texi: Document bootstrap-asan configuration option. I see this introduces a new table.

[PATCH] dump type attributes in dump_function_to_file

2020-11-20 Thread Martin Sebor via Gcc-patches
dump_function_to_file prints DECL_ATTRIBUTES but not TYPE_ATTRIBUTES when both can be important and helpful for debugging, especially with attributes that are added implicitly (such attribute access and the proposed internal attribute *dealloc). The function also prints function arguments (and th

Re: [PATCH] Power10: Add missing IEEE 128-bit XSCMP* built-in mappings.

2020-11-20 Thread Segher Boessenkool
On Fri, Nov 20, 2020 at 10:42:19AM -0500, Michael Meissner wrote: > Power10: Add missing IEEE 128-bit XSCMP* built-in mappings. Okay for trunk (and needed backports after waiting for possible fallout). Thanks! Segher > 2020-11-18 Michael Meissner > > * config/rs6000/rs6000-call.c (r

Re: [Patch 0/X] HWASAN v4

2020-11-20 Thread Matthew Malcomson via Gcc-patches
On 13/11/2020 17:22, Martin Liška wrote: On 11/13/20 5:57 PM, Matthew Malcomson wrote: Hi there, Thanks for the heads-up. As it turns out the most recent `libhwasan` crashes when displaying an address on the stack in Linux. Hello. What a bad luck. I'm currently working on getting it fixe

Re: Update: [PATCH 5/X] libsanitizer: mid-end: Introduce stack variable handling for HWASAN

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Hi there, I was just doing some double-checks and noticed I'd placed the documentation in the wrong section of tm.texi. The `MEMTAG` hooks were documented in the `Register Classes` section, so I've now moved it to the `Misc` section. That's the only change, Ok for trunk? Matthew ---

Re: [PATCH 4/X] libsanitizer: options: Add hwasan flags and argument parsing

2020-11-20 Thread Matthew Malcomson via Gcc-patches
Hi there, I was just doing some double-checks and noticed I'd placed the documentation in the wrong section of tm.texi. The `MEMTAG` hooks were documented in the `Register Classes` section, so I've now moved it to the `Misc` section. That's the only change, Ok for trunk? Matthew -

[PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Martin Sebor via Gcc-patches
To detect a subset of VLA misuses, the C front associates the bounds of VLAs in function argument lists with the corresponding variables by implicitly adding an instance of attribute access to each function declared to take VLAs with the bound expressions chained on the list of attribute arguments

Re: [PATCH,rs6000] Make MMA builtins use opaque modes [v2]

2020-11-20 Thread Segher Boessenkool
Hi! As Peter remarked, the input_operand's in the disassemble patterns are better as something more specific (input_operand has everything a "mov" pattern can handle, but pretty much nothing else can on a load/store architecture like Power -- it will likely still work, but only after reloads, so n

Re: [PATCH 7/X] libsanitizer: Add tests

2020-11-20 Thread Richard Sandiford via Gcc-patches
Matthew Malcomson writes: > Adding hwasan tests. > > Only interesting thing here is that we have to make sure the tagging mechanism > is deterministic to avoid flaky tests. Sorry for not reviewing this one earlier. TBH I only spot-checked the tests themselves (they look good). But on hwasan-dg.

Re: [PATCH v2] tree-ssa-threadbackward.c (profitable_jump_thread_path): Do not allow __builtin_constant_p () before IPA.

2020-11-20 Thread Jeff Law via Gcc-patches
On 6/30/20 12:46 PM, Ilya Leoshkevich wrote: > v1: https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547236.html > > This is the implementation of Jakub's suggestion: allow > __builtin_constant_p () after IPA, but fold it into 0. Smoke test > passed on s390x-redhat-linux, full regtest and boo

[r11-5191 Regression] FAIL: gcc.target/i386/pr97873-1.c scan-assembler pabsq on Linux/x86_64

2020-11-20 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, fdace7584056de2f63bde2e3087f26beb6b0f97d is the first bad commit commit fdace7584056de2f63bde2e3087f26beb6b0f97d Author: Uros Bizjak Date: Fri Nov 20 10:26:34 2020 +0100 i386: Optimize abs expansion [PR97873] caused FAIL: gcc.target/i386/pr97873-1.c scan-assembler pabsq

[PATCH] c++: Add missing verify_type_context call [PR97904]

2020-11-20 Thread Richard Sandiford via Gcc-patches
When adding the verify_type_context target hook, I'd missed a site that needs to check an array element type. Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK for master and GCC 10 branch? Thanks, Richard gcc/cp/ PR c++/97904 * pt.c (tsubst): Use verify_type_context to chec

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Marek Polacek via Gcc-patches
On Fri, Nov 20, 2020 at 12:00:58PM -0700, Martin Sebor via Gcc-patches wrote: > To detect a subset of VLA misuses, the C front associates the bounds > of VLAs in function argument lists with the corresponding variables > by implicitly adding an instance of attribute access to each function > declar

Re: [PATCH] c++: Add missing verify_type_context call [PR97904]

2020-11-20 Thread Marek Polacek via Gcc-patches
On Fri, Nov 20, 2020 at 07:27:54PM +, Richard Sandiford via Gcc-patches wrote: > When adding the verify_type_context target hook, I'd missed > a site that needs to check an array element type. > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK for master > and GCC 10 branch? Not an ap

Improve hashing of decls in ipa-icf-gimple

2020-11-20 Thread Jan Hubicka
Hi, another remaining case is that we end up comparing calls with mismatching number of parameters or with different permutations of them. This is because we hash decls to nothing. This patch improves that by hashing decls by their code and parm decls by indexes that are stable. Also for defualt d

Re: [PATCH] ipa-cp: Avoid unwanted multiple propagations (PR 97816)

2020-11-20 Thread Martin Jambor
Hi, this is an updated patch based on our conversation on IRC today. So far I have had a look at the effects on only tramp3d and although it makes the heuristics more pessimistic more times than optimistic (number of clones at -Ofast drops from 559 to 557), there are also lattices which are massi

Re: [PATCH] ipa: special pass-through op for Fortran strides

2020-11-20 Thread Jeff Law via Gcc-patches
On 6/12/20 3:25 PM, Martin Jambor wrote: > Hi, > > when Fortran functions pass array descriptors they receive as a > parameter to another function, they actually rebuild it. Thanks to > work done mainly by Feng, IPA-CP can already handle the cases when > they pass directly the values loaded fro

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/20/20 12:29 PM, Marek Polacek wrote: On Fri, Nov 20, 2020 at 12:00:58PM -0700, Martin Sebor via Gcc-patches wrote: To detect a subset of VLA misuses, the C front associates the bounds of VLAs in function argument lists with the corresponding variables by implicitly adding an instance of at

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 20, 2020 at 01:28:03PM -0700, Martin Sebor via Gcc-patches wrote: > On 11/20/20 12:29 PM, Marek Polacek wrote: > > On Fri, Nov 20, 2020 at 12:00:58PM -0700, Martin Sebor via Gcc-patches > > wrote: > > > To detect a subset of VLA misuses, the C front associates the bounds > > > of VLAs

Go patch committed: Change name mangling convention

2020-11-20 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend and libgo changes the name mangling convention. The previous convention (which was actually the second one) turned out to be ambiguous when the path to a package contained a dot; this is a common case, as many package paths are of the form "github.com/name/package".

Re: [PATCH] tighten up attribute access validation (PR 97879)

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/18/20 4:36 PM, Jeff Law wrote: On 11/18/20 3:41 PM, Martin Sebor via Gcc-patches wrote: The access attribute handler doesn't check to make sure the mode argument is an identifier and readily accepts string arguments which are assumed to be the condensed internal representation the user a

[PATCH] Darwin, libgfortran : Do not use environ directly from the library.

2020-11-20 Thread Iain Sandoe
Hi, not sure if this is covered directly by my Darwin maintainer’s hat so … - On macOS / Darwin, the environ variable can be used directly in the code of an executable, but cannot be used in the code of a shared library (i.e. libgfortran.dylib)** In such cases, the function _NSGetEnviron

Re: [Ada] Build support units for 128-bit integer types on 64-bit platforms

2020-11-20 Thread Maciej W. Rozycki
On Wed, 18 Nov 2020, Eric Botcazou wrote: > > that broke the build of an ada cross compiler targeting > > powerpc64le-linux-gnu. target_cpu is powerpc64le which is not matched by > > the Makefile logic. > > > > Ok for the trunk? > > > > PR ada/97859 > > * Makefile.rtl (powerpc% linux%):

Re: [PATCH 1/2] NetBSD/libgcc: Check for TARGET_DL_ITERATE_PHDR in the unwinder

2020-11-20 Thread Maciej W. Rozycki
On Mon, 16 Nov 2020, Jeff Law wrote: > > libgcc/ > > * unwind-dw2-fde-dip.c [__OpenBSD__ || __NetBSD__] > > (USE_PT_GNU_EH_FRAME): Do not define if !TARGET_DL_ITERATE_PHDR. > OK Committed now, thank you for your review. Maciej

[committed v2 2/2] libada: Check for the presence of _SC_NPROCESSORS_ONLN

2020-11-20 Thread Maciej W. Rozycki
Check for the presence of _SC_NPROCESSORS_ONLN rather than using a list of OS-specific macros to decide whether to use `sysconf' like elsewhere across GCC sources, fixing a compilation error: adaint.c: In function '__gnat_number_of_cpus': adaint.c:2398:26: error: '_SC_NPROCESSORS_ONLN' undeclare

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/20/20 1:37 PM, Jakub Jelinek wrote: On Fri, Nov 20, 2020 at 01:28:03PM -0700, Martin Sebor via Gcc-patches wrote: On 11/20/20 12:29 PM, Marek Polacek wrote: On Fri, Nov 20, 2020 at 12:00:58PM -0700, Martin Sebor via Gcc-patches wrote: To detect a subset of VLA misuses, the C front associ

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 20, 2020 at 02:30:43PM -0700, Martin Sebor wrote: > VLA parameter bounds can involve any other expressions, including > function calls. It's those rather than other parameters that also > trigger the problem (at least in the test cases I've seen). > > When/how would the unsharing caus

[committed] avoid invalid redeclarations (PR 97861)

2020-11-20 Thread Martin Sebor via Gcc-patches
When checking for mismatches between the array forms of arguments between the current and the new declaration of a function warn_parm_array_mismatch() assumes that the new declaration is valid and compatible with the current one. When that's not so the function crashes with a null pointer derefer

[pushed] dwarf2: ICE with local class in unused function [PR97918]

2020-11-20 Thread Jason Merrill via Gcc-patches
Here, since we only mention bar, we never emit debug information for it. But we do emit debug information for H::h, so we need to refer to the debug info for bar::J even though there is no bar. We deal with this sort of thing in dwarf2out with the limbo_die_list; parentless dies like J get attache

Re: [PATCH] Additional small changes to support opaque modes

2020-11-20 Thread Aaron Sawdey via Gcc-patches
> On Nov 20, 2020, at 4:57 AM, Aaron Sawdey via Gcc-patches > wrote: > > >> On Nov 20, 2020, at 3:55 AM, Richard Sandiford >> wrote: >> >> acsawdey--- via Gcc-patches writes: >>> @@ -16767,7 +16768,7 @@ loc_descriptor (rtx rtl, machine_mode mode, >>> break; >>> >>>case CONST_INT:

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/20/20 2:41 PM, Jakub Jelinek wrote: On Fri, Nov 20, 2020 at 02:30:43PM -0700, Martin Sebor wrote: VLA parameter bounds can involve any other expressions, including function calls. It's those rather than other parameters that also trigger the problem (at least in the test cases I've seen).

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 20, 2020 at 02:54:34PM -0700, Martin Sebor wrote: > At the point the attribute is created there is no SAVE_EXPR. So for > something like: > > int f (void); > void g (int a[f () + 1]) { } > > the bound is a PLUS_EXPR (CALL_EXPR (f), 1). > > I don't do anything with the expression e

Re: [PATCH] c++: Add missing verify_type_context call [PR97904]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/20/20 2:27 PM, Richard Sandiford wrote: When adding the verify_type_context target hook, I'd missed a site that needs to check an array element type. Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK for master and GCC 10 branch? OK. Thanks, Richard gcc/cp/ PR c++/97904

Re: [PATCH] RISC-V: Always define MULTILIB_DEFAULTS

2020-11-20 Thread Jim Wilson
On Fri, Nov 20, 2020 at 12:34 AM Kito Cheng wrote: > - Define MULTILIB_DEFAULTS can reduce the total number of multilib if >the default arch and ABI are listed in the multilib config. > It looks like a good idea, but it doesn't seem to work. A toolchain configured without specifying arch/a

Re: [PATCH] c++: Fix wrong error with constexpr destructor [PR97427]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/19/20 8:21 PM, Marek Polacek wrote: When I implemented the code to detect modifying const objects in constexpr contexts, we couldn't have constexpr destructors, so I didn't consider them. But now we can and that caused a bogus error in this testcase: [class.dtor]p5 says that "const and vol

Re: [PATCH] c++: Allow template lambdas without lambda-declarator [PR97839]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/17/20 1:05 PM, Marek Polacek wrote: Our implementation of template lambdas incorrectly requires the optional lambda-declarator. This was probably required by an early draft of generic lambdas, but now the production is [expr.prim.lambda.general]: lambda-expression: lambda-introduce

Re: [PATCH] c++: Allow template lambdas without lambda-declarator [PR97839]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/18/20 1:16 PM, Marek Polacek wrote: On Tue, Nov 17, 2020 at 01:05:20PM -0500, Marek Polacek via Gcc-patches wrote: Our implementation of template lambdas incorrectly requires the optional lambda-declarator. This was probably required by an early draft of generic lambdas, but now the produ

Re: [PATCH v2] c++: Extend -Wrange-loop-construct for binding-to-temp [PR94695]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/16/20 6:52 PM, Marek Polacek wrote: On Mon, Nov 16, 2020 at 05:02:14PM -0500, Jason Merrill via Gcc-patches wrote: On 11/15/20 10:34 PM, Marek Polacek wrote: [ This year's end-of-stage1 I'm working virtually from American Samoa. ] This patch finishes the second half of -Wrange-loop-const

Re: [PATCH] c++: Reject identifier label in constexpr [PR97846]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/16/20 9:58 PM, Marek Polacek wrote: [dcl.constexpr]/3 says that the function-body of a constexpr function shall not contain an identifier label, but we aren't enforcing that. This patch implements that. Of course, we can't reject artificial labels. Bootstrapped/regtested on x86_64-pc-lin

Re: [PATCH] c++: Fix ICE-on-invalid with -Wvexing-parse [PR97881]

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/17/20 2:32 PM, Marek Polacek wrote: This invalid (?) code broke my assumption that if decl_specifiers->type is null, there must be any type-specifiers. Turn the assert into an if to fix this crash. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? gcc/cp/ChangeLog: PR

Re: [PATCH] Objective-C++ : Allow prefix attrs on linkage specs.

2020-11-20 Thread Jason Merrill via Gcc-patches
On 11/7/20 10:11 AM, Iain Sandoe wrote: Hi, For Objective-C++/C, we cater for the possibility that a class interface (@interface) might be preceded by prefix attributes. In the case of Objective-C++, the reference implementation (a.k.a. clang) also allows (and combines) prefix attributes that p

Re: [PATCH] unshare expressions in attribute arguments

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/20/20 2:57 PM, Jakub Jelinek wrote: On Fri, Nov 20, 2020 at 02:54:34PM -0700, Martin Sebor wrote: At the point the attribute is created there is no SAVE_EXPR. So for something like: int f (void); void g (int a[f () + 1]) { } the bound is a PLUS_EXPR (CALL_EXPR (f), 1). I don't do a

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-11-20 Thread Thomas Rodgers
Tested x86_64-pc-linux-gnu, committed. > On Oct 27, 2020, at 3:23 AM, Jonathan Wakely wrote: > > On 26/10/20 14:48 -0700, Thomas Rodgers wrote: >> +#include >> + >> +#if __has_include() >> +#define _GLIBCXX_HAVE_POSIX_SEMAPHORE 1 >> +#include > > It occurs to me now that this check probably i

  1   2   >