Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Uros Bizjak via Gcc-patches
On Thu, Oct 29, 2020 at 12:55 AM Qing Zhao wrote: > > Hi, > > This is the 5th version of the implementation of patch -fzero-call-used-regs. > > The major change compared to the previous version (4th version) are: > > 1. Documentation change per Richard’s suggestion; > 2. Use namespace for zero_reg

Fwd: libstdc++: Attempt to resolve PR83562

2020-10-29 Thread Liu Hao via Gcc-patches
I forward it here for comments. Basing on the behavior of both GCC and Clang, `__cxa_thread_atexit` is used to register the destructor of thread_local objects directly, suggesting the first parameter should have `__thiscall` convention. libstdc++ used the default `__cdecl` convention and caused

Re: PING [PATCH] Enable GCC support for Intel Key Locker extension

2020-10-29 Thread Uros Bizjak via Gcc-patches
On Thu, Oct 29, 2020 at 7:52 AM Hongyu Wang wrote: > > Hi Uros, > > > is there a reason to introduce all these (with corresponding changes)? > > SSE options live in ISA bitmap, so it is kind of strange you need to > > handle them in ISA2 bitmap. Option handling is not exactly my area, > > please a

Re: stdbool.h: Update true and false expansions for C2x

2020-10-29 Thread Richard Biener via Gcc-patches
On Thu, Oct 29, 2020 at 12:26 AM Joseph Myers wrote: > > C2x has changed the expansions of the true and false macros in > so that they have type _Bool (including in #if conditions, > i.e. an unsigned type in that context). Use the new expansions in > GCC's for C2x. > > See bug 82272 for related

Re: PING [PATCH] Enable GCC support for Intel Key Locker extension

2020-10-29 Thread Hongyu Wang via Gcc-patches
Thanks for your review! I'll ask Hongtao to check-in the patch for me. Uros Bizjak 于2020年10月29日周四 下午4:08写道: > > On Thu, Oct 29, 2020 at 7:52 AM Hongyu Wang wrote: > > > > Hi Uros, > > > > > is there a reason to introduce all these (with corresponding changes)? > > > SSE options live in ISA bitma

[PATCH] More BB vectorization tweaks

2020-10-29 Thread Richard Biener
This tweaks the op build from splats to allow loads marked as not vectorizable. It also amends some dump prints with the address of the SLP node or the instance to better be able to debug things. Bootstrapped & tested on x86_64-unknown-linux-gnu, pushed. 2020-10-29 Richard Biener * t

[committed] libstdc++: Rename _UniformRandomNumberGenerator parameters

2020-10-29 Thread Jonathan Wakely via Gcc-patches
The paper P0346R1 renamed uniform random number generators to uniform random bit generators, to describe their purpose more accurately. This makes that same change in one of the relevant files (but not the others). libstdc++-v3/ChangeLog: * include/bits/uniform_int_dist.h (uniform_int_dis

Re: [PATCH] openmp: Implicit 'declare target' for C++ static initializers

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 28, 2020 at 02:20:29PM +, Kwok Cheung Yeung wrote: > OpenMP 5.0 has a new feature for implicitly marking variables and functions > that are referenced in the initializers of static variables and functions > that are already marked 'declare target'. Support was added in the commit >

[PATCH][pushed] opts: Sanity check for param names.

2020-10-29 Thread Martin Liška
Hello. This provides new sanity check: options.c:1:2: error: #error Parameter option name '-param-ipa-jump-function-lookups=' must start with '-param=' 1 | #error Parameter option name '-param-ipa-jump-function-lookups=' must start with '-param=' | ^ Apart form that, I fix the

Re: [PATCH][PR target/97540] Don't extract memory from operand for normal memory constraint.

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 27, 2020 at 11:13:21AM +, Richard Sandiford via Gcc-patches wrote: > Sorry to stick my oar in, but I think we should reconsider the > bcst_mem_operand approach. It seems like these patches (and the > previous one) are fighting against the principle that operands > cannot be arbitr

Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Richard Sandiford via Gcc-patches
Qing Zhao via Gcc-patches writes: > +/* Handle a "zero_call_used_regs" attribute; arguments as in > + struct attribute_spec.handler. */ > + > +static tree > +handle_zero_call_used_regs_attribute (tree *node, tree name, tree args, > + int ARG_UNUSED (flags), > +

[PATCH] Consistently pass the vector type for scalar SLP cost compute

2020-10-29 Thread Richard Biener
This avoids randomly (based on whether the stmt is SLP_TREE_REPRESENTATIVE and not a pattern stmt) passing a vector type or NULL to the add_stmt_cost hook for scalar code cost compute. For example the x86 backend uses only the vector type to decide on the scalar computation mode which makes costin

Re: testsuite: Adjust target requirements for sad-vectorize and signbit

2020-10-29 Thread Alan Modra via Gcc-patches
Fixes FAIL: gcc.target/powerpc/signbit-1.c scan-assembler-not stxvd2x FAIL: gcc.target/powerpc/signbit-1.c scan-assembler-times mfvsrd 3 FAIL: gcc.target/powerpc/signbit-1.c scan-assembler-times srdi 3 FAIL: gcc.target/powerpc/signbit-2.c scan-assembler-times ld 1 FAIL: gcc.target/powerpc/signbit-2

[committed] libstdc++: Fix some warnings in headers

2020-10-29 Thread Jonathan Wakely via Gcc-patches
These are usually suppressed without -Wsystem-headers. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (_Local_iterator_base): Cast value to avoid -Wsign-compare warnings. * include/bits/regex.h (sub_match::_M_str): Avoid narrowing conversion. * i

Re: [PATCH, 1/3, OpenMP] Target mapping changes for OpenMP 5.0, front-end parts

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 28, 2020 at 06:31:22PM +0800, Chung-Lin Tang wrote: > > > + for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c)) > > > +if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP > > > + && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER > > > + && TREE_CODE (TREE_TYPE (OMP_CLAUSE_DECL (c))

Re: [PATCH, 2/3, OpenMP] Target mapping changes for OpenMP 5.0, middle-end parts and compiler testcases

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 28, 2020 at 06:32:21PM +0800, Chung-Lin Tang wrote: > > > @@ -8958,25 +9083,20 @@ gimplify_scan_omp_clauses (tree *list_p, > > > gimple_seq *pre_p, > > > /* An "attach/detach" operation on an update directive > > > should > > >behave as a GOMP_MAP_A

Re: [PATCH] vect: Fix load costs for SLP permutes

2020-10-29 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, Oct 28, 2020 at 2:39 PM Richard Sandiford via Gcc-patches > wrote: >> >> For the following test case (compiled with load/store lanes >> disabled locally): >> >> void >> f (uint32_t *restrict x, uint8_t *restrict y, int n) >> { >> for (int i = 0; i < n; +

Re: [PATCH] vect: Fix load costs for SLP permutes

2020-10-29 Thread Richard Biener via Gcc-patches
On Thu, Oct 29, 2020 at 12:52 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Wed, Oct 28, 2020 at 2:39 PM Richard Sandiford via Gcc-patches > > wrote: > >> > >> For the following test case (compiled with load/store lanes > >> disabled locally): > >> > >> void > >> f (uint32_t

[PATCH][AArch64] ACLE intrinsics: convert from BFloat16 to Float32

2020-10-29 Thread Dennis Zhang via Gcc-patches
Hi all, This patch enables intrinsics to convert BFloat16 scalar and vector operands to Float32 modes. The intrinsics are implemented by shifting each BFloat16 item 16 bits to left using shl/shll/shll2 instructions. Intrinsics are documented at https://developer.arm.com/architectures/instructi

[PATCH][AArch64] ACLE intrinsics: get low/high half from BFloat16 vector

2020-10-29 Thread Dennis Zhang via Gcc-patches
Hi all, This patch implements ACLE intrinsics vget_low_bf16 and vget_high_bf16 to extract lower or higher half from a bfloat16x8 vector. The vget_high_bf16 is done by 'dup' instruction. The vget_low_bf16 could be done by a 'dup' or 'mov', or it's mostly optimized out by just using the lower hal

c++: Stop (most) function-scope entities having a template header

2020-10-29 Thread Nathan Sidwell
Currently push_template_decl (mostly) decides whether to add a template header to an entity by seeing if it has DECL_LANG_SPECIFIC. That might have been a useful predicate at one time, but basing semantic implications on how we've decided to represent decls is bound to be brittle. And indeed it

Re: [PATCH] LTO: get_section: add new argument

2020-10-29 Thread Jan Hubicka
> From 33c58cab6bc0d779b11e7ffb36bfb485d73d6816 Mon Sep 17 00:00:00 2001 > From: Martin Liska > Date: Wed, 21 Oct 2020 11:11:03 +0200 > Subject: [PATCH] LTO: get_section: add new argument > > gcc/ChangeLog: > > PR lto/97508 > * langhooks.c (lhd_begin_section): Call get_section with

[PATCH 2/7] C-SKY: Delete LO_REGS and HI_REGS, use HILO_REGS instead.

2020-10-29 Thread gengqi via Gcc-patches
gcc/ChangeLog: * config/csky/constraints.md ("l", "h"): Delete. * config/csky/csky.h (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Delete LO_REGS and HI_REGS. * config/csky/csky.c (regno_reg_classm, csky_secondary_reload, csky_register_move_cost):

[PATCH 6/7] C-SKY: Cases for csky fpuv3 instructions.

2020-10-29 Thread gengqi via Gcc-patches
gcc/testsuite/ChangeLog: * gcc/testsuite/gcc.target/csky/fpuv3/fpuv3.exp: New. * gcc/testsuite/gcc.target/csky/fpuv3/fpv3_div.c: New. * gcc/testsuite/gcc.target/csky/fpuv3/fpv3_fadd.c: New. * gcc/testsuite/gcc.target/csky/fpuv3/fpv3_fdtos.c: New. * gcc/tests

[PATCH 3/7] C-SKY: Bug fix for bad setting of TARGET_DSP and TARGET_DIV.

2020-10-29 Thread gengqi via Gcc-patches
gcc/ChangeLog: * config/csky/csky.c (csky_option_override): Init csky_arch_isa_features[] advanced, so TARGET_DSP and TARGET_DIV can be set well. --- gcc/config/csky/csky.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/

[PATCH 5/7] C-SKY: Add insn "ldbs".

2020-10-29 Thread gengqi via Gcc-patches
gcc/ChangeLog: config/csky/csky.md (cskyv2_sextend_ldbs): New insn. --- gcc/config/csky/csky.md | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md index 62875bf..ce9c252 100644 --- a/gcc/config/csky/csky.md +++ b/gcc/config/cs

[PATCH 4/7] C-SKY: Separate FRAME_POINTER_REGNUM into FRAME_POINTER_REGNUM and HARD_FRAME_POINTER_REGNUM.

2020-10-29 Thread gengqi via Gcc-patches
gcc/ChangeLog: * config/csky/csky.h (FRAME_POINTER_REGNUM): Use HARD_FRAME_POINTER_REGNUM and FRAME_POINTER_REGNUM instead of the signle definition. The signle definition may not work well at simplify_subreg_regno(). (ELIMINABLE_REGS): Add for HARD_FRAME_POI

Re: [PATCH] LTO: get_section: add new argument

2020-10-29 Thread Martin Liška
On 10/29/20 1:51 PM, Jan Hubicka wrote: From 33c58cab6bc0d779b11e7ffb36bfb485d73d6816 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 21 Oct 2020 11:11:03 +0200 Subject: [PATCH] LTO: get_section: add new argument gcc/ChangeLog: PR lto/97508 * langhooks.c (lhd_begin_se

[PATCH 1/7] C-SKY: Add fpuv3 instructions and CK860 arch

2020-10-29 Thread gengqi via Gcc-patches
gcc/ChangeLog: * config/csky/constraints.md ("W"): New constriant for mem operand with base reg, index register. ("Q"): Renamed and modified "csky_valid_fpuv2_mem_operand" to "csky_valid_mem_constraint_operand" to deal with both "Q" and "W" constraint.

[patch] vxworks: Introduce support for vxworks7r2 on x86 and x86_64

2020-10-29 Thread Olivier Hainque
Hello, This change extends the VxWorks support on intel CPUs to VxWorks7r2, with a "mcmodel=large" additional multilib for the 64bit configuration. The support for fPIC is not functional yet for this model, so we just don't add the corresponding multilib. Following the trend already visible

Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-29 Thread Andrew MacLeod via Gcc-patches
On 10/27/20 11:29 AM, Aldy Hernandez wrote: The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger doesn't currently handle. Looking at vr_values::extract_range_builtin(), I see that every s

Re: [RS6000] float128-type-2.c unsupported

2020-10-29 Thread David Edelsohn via Gcc-patches
On Thu, Oct 29, 2020 at 12:53 AM Alan Modra wrote: > > On Wed, Oct 28, 2020 at 11:35:07PM -0400, David Edelsohn wrote: > > Alan, > > > > It is disrespectful for you to ignore the review of a maintainer and > > your colleague. You may not pick and choose amongst maintainers. And > > Segher should

[patch] vxworks: Predefine __ppc and __ppc__ for VxWorks 7

2020-10-29 Thread Olivier Hainque
Unfortunately, some VxWorks 7r2 system headers rely on a couple more variations of the predefined macros expected to characterize a “powerpc” target that we discussed recently. setjmp.h, for example, relies on __ppc and the absence of a definition results in “gcc” dejagnu test failures from all t

C++ patch ping

2020-10-29 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping 2 patches: - https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556370.html PR95808 - diagnose constexpr delete [] new int; and delete new int[N]; - https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556548.html PR97388 - fix up constexpr evaluation of arguments

[committed] libstdc++: Fix memory issue in ranges::lexicographical_compare testcase

2020-10-29 Thread Patrick Palka via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/25_algorithms/lexicographical_compare/constrained.cc: (test03): Fix initializing the vector vy with the array y of size 4. --- .../25_algorithms/lexicographical_compare/constrained.cc| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] d: Add dragonflybsd support for D compiler and runtime

2020-10-29 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds the necessary version conditions and configure rules in place to allow building the D compiler on DragonFlyBSD. Running the testsuite, all core tests pass, with a couple failures relating to CTFE math support which are not blocking the library from being usable, and will be fi

Re: [PING] [PATCH] S/390: Do not turn maybe-uninitialized warnings into errors

2020-10-29 Thread Richard Sandiford via Gcc-patches
Jeff Law via Gcc-patches writes: > On 10/28/20 11:29 AM, Stefan Schulze Frielinghaus wrote: >> On Wed, Oct 28, 2020 at 08:39:41AM -0600, Jeff Law wrote: >>> On 10/28/20 3:38 AM, Stefan Schulze Frielinghaus via Gcc-patches wrote: On Mon, Oct 05, 2020 at 02:02:57PM +0200, Stefan Schulze Frielin

Re: [PATCH] Selectively trap if ranger and vr-values disagree on range builtins.

2020-10-29 Thread Aldy Hernandez via Gcc-patches
On 10/29/20 2:53 PM, Andrew MacLeod wrote: On 10/27/20 11:29 AM, Aldy Hernandez wrote: The UBSAN builtins degrade into PLUS/MINUS/MULT and call extract_range_from_binary_expr, which as the PR shows, can special case some symbolics which the ranger doesn't currently handle. Looking at vr_valu

Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Qing Zhao via Gcc-patches
> On Oct 29, 2020, at 6:09 AM, Richard Sandiford > wrote: > > Qing Zhao via Gcc-patches writes: >> +/* Handle a "zero_call_used_regs" attribute; arguments as in >> + struct attribute_spec.handler. */ >> + >> +static tree >> +handle_zero_call_used_regs_attribute (tree *node, tree name, tre

[committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does, we don't need to use RTTI. If it isn't equal, we s

[committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does, we don't need to use RTTI. If it isn't equal, we s

[committed] libstdc++: Do not use volatile for __gnu_cxx::rope reference counting

2020-10-29 Thread Jonathan Wakely via Gcc-patches
The rope extension uses a volatile variable for its reference count. This is not only unnecessary for correctness (volatile provides neither atomicity nor memory visibility, and the variable is only modified while a lock is held) but it now causes deprecated warnings with -Wsystem-headers due to th

Re: [RS6000] float128-type-2.c unsupported

2020-10-29 Thread Segher Boessenkool
Hi David, all, On Thu, Oct 29, 2020 at 10:12:31AM -0400, David Edelsohn wrote: > > I'm sorry you see this as a matter of respect. I didn't see it that > > way at all. Segher disagreed with your review, and gave sufficient > > technical reason for me to commit the patch. > If you or Segher disag

[committed] libstdc++: Allow Lemire's algorithm to be used in more cases

2020-10-29 Thread Jonathan Wakely via Gcc-patches
This extends the fast path to also work when the URBG's range of possible values is not the entire range of its result_type. Previously, the slow path would be used for engines with a uint_fast32_t result type if that type is actually a typedef for uint64_t rather than uint32_t. After this change,

[committed] libstdc++: Improve tests for constexpr algorithms

2020-10-29 Thread Jonathan Wakely via Gcc-patches
These tests just return true without checking that the results of the algorithms. Although it should be safe to assume that the algorithms behave the same at compile-time as at run-time, we can use these tests to verify it. This replaces each 'return true' statement with a condition that depends o

Re: [committed] libstdc++: Fix memory issue in ranges::lexicographical_compare testcase

2020-10-29 Thread Patrick Palka via Gcc-patches
On Thu, 29 Oct 2020, Patrick Palka wrote: > libstdc++-v3/ChangeLog: > > * testsuite/25_algorithms/lexicographical_compare/constrained.cc: > (test03): Fix initializing the vector vy with the array y of size 4. Now committed to the 10 branch as well. > --- > .../25_algorithms/lexicog

[patch] i386 tests: Add dg-require-profiling to i386 tests using -pg

2020-10-29 Thread Olivier Hainque
Hello, This patch is a proposal to add /* { dg-require-profiling "-pg" } */ to a few tests in gcc.target/i386 that use -pg explicitly. This matches what other tests checking profiling related options do and prevents these specific ones from failing during runs for VxWorks targets. Ok to com

Re: [PATCH] c++: Fix up constexpr evaluation of arguments passed by invisible reference [PR97388]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/20/20 3:33 AM, Jakub Jelinek wrote: Hi! For arguments passed by invisible reference, in the IL until genericization we have the source types on the callee side and while on the caller side we already pass references to the actual argument slot in the caller, we undo that in cxx_bind_parame

Re: New modref/ipa_modref optimization passes

2020-10-29 Thread Jan Hubicka
> Hi, > this is patch I am using to fix the assumed_alias_type.f90 failure by > simply arranging alias set 0 for the problematic array descriptor. > > I am not sure this is the best option, but I suppose it is better than > setting all array descritors to have same canonical type (as done by > LTO

Re: [PATCH] c++: Diagnose constexpr delete [] new int; and delete new int[N]; [PR95808]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/16/20 5:42 AM, Jakub Jelinek wrote: Hi! This patch diagnoses delete [] new int; and delete new int[1]; in constexpr contexts by remembering IDENTIFIER_OVL_OP_FLAGS (DECL_NAME (fun)) & OVL_OP_FLAG_VEC from the operator new and checking it at operator delete time. Bootstrapped/regtested on

Re: [PATCH v2] c++: Prevent warnings for value-dependent exprs [PR96742]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/28/20 10:45 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 05:48:08PM -0400, Jason Merrill wrote: On 10/28/20 5:29 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 02:46:36PM -0400, Jason Merrill wrote: On 10/28/20 2:00 PM, Marek Polacek wrote: On Tue, Oct 27, 2020 at 01:36:30PM -0400

Re: [PATCH v2] c++: Implement -Wvexing-parse [PR25814]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/28/20 7:40 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 03:09:08PM -0400, Jason Merrill wrote: On 10/28/20 1:58 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 01:26:53AM -0400, Jason Merrill via Gcc-patches wrote: On 10/24/20 7:40 PM, Marek Polacek wrote: On Fri, Oct 23, 2020 at 0

Re: [PATCH] c++: Deprecate arithmetic convs on different enums [PR97573]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/28/20 10:46 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 02:43:30PM -0400, Jason Merrill wrote: On 10/28/20 2:01 PM, Marek Polacek wrote: I noticed that C++20 P1120R0 deprecated certain arithmetic conversions as outlined in [depr.arith.conv.enum], but we don't warn about them. In par

Re: [PATCH 1/2] c++: Tolerate empty initial targs during normalization [PR97412]

2020-10-29 Thread Patrick Palka via Gcc-patches
On Mon, 19 Oct 2020, Patrick Palka wrote: > When normalizing the constraint-expression of a nested-requirement, we > pass NULL_TREE as the initial template arguments for normalization, but > tsubst_argument_pack is not prepared to handle a NULL_TREE targ vector. > This causes us to ICE when normal

Re: [PATCH v2] c++: Implement CWG 625: Use of auto as template-arg [PR97479]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/28/20 10:56 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 02:34:15PM -0400, Jason Merrill via Gcc-patches wrote: On 10/28/20 2:02 PM, Marek Polacek wrote: This patch implements CWG 625 which prohibits using auto in a template argument. A few tests used this construction. We could per

Re: [PATCH] c++: Fix up constexpr evaluation of arguments passed by invisible reference [PR97388]

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 29, 2020 at 11:09:05AM -0400, Jason Merrill wrote: > I think this isn't enough; if bar calls foo twice, the second call will find > the value in the hash table and not change the temporary, so the destructor > will throw. I think we also need to set non_constant_args if the argument >

Avoid char[] array in tree_def

2020-10-29 Thread Jan Hubicka
Hi, this patch removes second char array from tree_def union and makes it !TYPELESS_STORAGE. Now all accesses to anything in tree no longer have alias set 0, but they all have alias set 1 :) This is because the way we handle unions. However it still increases TBAA effectivity by about 12%. From:

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 29, 2020 at 04:50:54PM +0100, Jan Hubicka wrote: > * tree.c (build_string): Update. > * tree-core.h (tree_fixed_cst): Avoid typeless storage. Is it valid then to #define TREE_STRING_POINTER(NODE) \ ((const char *)(STRING_CST_CHECK (NODE)->string.str)) and strcpy etc. it a

Re: [committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
On 29/10/20 14:49 +, Jonathan Wakely wrote: This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does,

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jan Hubicka
> On Thu, Oct 29, 2020 at 04:50:54PM +0100, Jan Hubicka wrote: > > * tree.c (build_string): Update. > > * tree-core.h (tree_fixed_cst): Avoid typeless storage. > > Is it valid then to > #define TREE_STRING_POINTER(NODE) \ > ((const char *)(STRING_CST_CHECK (NODE)->string.str)) > and strc

Re: Avoid char[] array in tree_def

2020-10-29 Thread Richard Biener
On Thu, 29 Oct 2020, Jan Hubicka wrote: > Hi, > this patch removes second char array from tree_def union and makes it > !TYPELESS_STORAGE. Now all accesses to anything in tree no longer have alias > set 0, but they all have alias set 1 :) > This is because the way we handle unions. However it sti

[Patch, fortran] PR83118 - [8/9/10/11 Regression] Bad intrinsic assignment of class(*) array component of derived type

2020-10-29 Thread Paul Richard Thomas via Gcc-patches
Hi Everyone, I am afraid that this is a rather long sad story, mainly due to my efforts with gfortran being interrupted by daytime work. I posted the first version of the patch nearly a year ago but this was derailed by Tobias's question at: https://gcc.gnu.org/legacy-ml/fortran/2019-11/msg00098.h

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jan Hubicka
> > That's ugly and will for sure defeat warning / access code > when we access this as char[], no? I mean, we could > as well use 'int str[1];' here? Well, we always get char pointer via macro that is IMO OK, but I am also not very much in love with this. > > Maybe we can invent some C++ attri

[PATCH] Fix some memleaks

2020-10-29 Thread Richard Biener
This fixes some memleaks, one older, one recently introduced. Bootstrap / regtest in progress on x86_64-unknown-linux-gnu. 2020-10-29 Richard Biener * tree-ssa-pre.c (compute_avail): Free operands consistently. * tree-vect-loop.c (vectorizable_phi): Make sure all operand

Re: Avoid char[] array in tree_def

2020-10-29 Thread Richard Biener
On Thu, 29 Oct 2020, Jan Hubicka wrote: > > > > That's ugly and will for sure defeat warning / access code > > when we access this as char[], no? I mean, we could > > as well use 'int str[1];' here? > > Well, we always get char pointer via macro that is IMO OK, but I am also > not very much in

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 29, 2020 at 05:00:40PM +0100, Jan Hubicka wrote: > > > > That's ugly and will for sure defeat warning / access code > > when we access this as char[], no? I mean, we could > > as well use 'int str[1];' here? > > Well, we always get char pointer via macro that is IMO OK, but I am also

Re: [PATCH] c++: Fix up constexpr evaluation of arguments passed by invisible reference [PR97388]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/29/20 11:40 AM, Jakub Jelinek wrote: On Thu, Oct 29, 2020 at 11:09:05AM -0400, Jason Merrill wrote: I think this isn't enough; if bar calls foo twice, the second call will find the value in the hash table and not change the temporary, so the destructor will throw. I think we also need to

Re: [PATCH 1/2] c++: Tolerate empty initial targs during normalization [PR97412]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/29/20 11:21 AM, Patrick Palka wrote: On Mon, 19 Oct 2020, Patrick Palka wrote: When normalizing the constraint-expression of a nested-requirement, we pass NULL_TREE as the initial template arguments for normalization, but tsubst_argument_pack is not prepared to handle a NULL_TREE targ vec

Re: [PATCH 2/2] c++: Clean up constraint normalization routines

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/19/20 6:08 PM, Patrick Palka wrote: Many of the high-level constraint normalization routines allow the caller to supply the initial template arguments for normalization, but in practice all of the callers ultimately supply either NULL_TREE or a set of generic template arguments (*). Since

Re: [PATCH] libstdc++: Add c++2a

2020-10-29 Thread Jonathan Wakely via Gcc-patches
On 21/10/20 09:53 -0700, Thomas Rodgers wrote: From: Thomas Rodgers libstdc++/Changelog: libstdc++-v3/doc/doxygen/user.cfg.in (INPUT): Add new header. libstdc++-v3/include/Makefile.am (std_headers): Add new header. libstdc++-v3/include/Makefile.in: Regenerate. li

Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Qing Zhao via Gcc-patches
Hi, Richard, Now, the documentation (gcc.info) is like following, let me know any issue there: thanks. Qing == 'zero_call_used_regs ("CHOICE")' The 'zero_call_used_regs' attribute causes the compiler to zero a subset of all call-used registers(1) at function return. Th

Re: PowerPC: Add __float128 conversions to/from Decimal

2020-10-29 Thread Michael Meissner via Gcc-patches
On Wed, Oct 28, 2020 at 07:04:31PM -0500, Segher Boessenkool wrote: > On Thu, Oct 22, 2020 at 06:06:03PM -0400, Michael Meissner wrote: > > This patch adds the various decimal to/from IEEE 128-bit conversions. I > > had to make some changes to the infrastructure, since that infrastructure > > assu

Re: PowerPC: Update IEEE 128-bit built-ins for long double is IEEE 128-bit.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Tue, Oct 27, 2020 at 09:38:20AM -0500, will schmidt wrote: > > @@ -2420,6 +2423,8 @@ BU_P9V_64BIT_VSX_2 (VSIEDPF, "scalar_insert_exp_dp", > > CONST, xsiexpdpf) > > > > BU_FLOAT128_HW_VSX_2 (VSIEQP, "scalar_insert_exp_q", CONST, > > xsiexpqp_kf) > > BU_FLOAT128_HW_VSX_2 (VSIEQPF,

Re: PowerPC: Update IEEE 128-bit built-ins for long double is IEEE 128-bit.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Wed, Oct 28, 2020 at 06:27:42PM -0500, Segher Boessenkool wrote: > On Thu, Oct 22, 2020 at 06:09:38PM -0400, Michael Meissner wrote: > > This patch adds long double variants of the power10 __float128 built-in > > functions. This is needed when long double uses IEEE 128-bit because > > __float12

Re: PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Wed, Oct 28, 2020 at 04:58:46PM -0500, Segher Boessenkool wrote: > Hi Mike, > > On Thu, Oct 22, 2020 at 06:10:37PM -0400, Michael Meissner wrote: > > PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit. > > This title makes no sense, and thankfully is not what the patch does :-)

Re: PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Tue, Oct 27, 2020 at 09:30:03AM -0500, will schmidt wrote: > On Thu, 2020-10-22 at 18:10 -0400, Michael Meissner via Gcc-patches wrote: > > PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit. > > > > I have split all of these patches into separate patches to hopefully get > > t

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jan Hubicka
> On Thu, Oct 29, 2020 at 05:00:40PM +0100, Jan Hubicka wrote: > > > > > > That's ugly and will for sure defeat warning / access code > > > when we access this as char[], no? I mean, we could > > > as well use 'int str[1];' here? > > > > Well, we always get char pointer via macro that is IMO OK,

Re: [PATCH][PR target/97540] Don't extract memory from operand for normal memory constraint.

2020-10-29 Thread Richard Sandiford via Gcc-patches
Hongtao Liu via Gcc-patches writes: > On Thu, Oct 29, 2020 at 2:46 AM Richard Sandiford > wrote: >> >> Hongtao Liu writes: >> > On Tue, Oct 27, 2020 at 7:13 PM Richard Sandiford >> > wrote: >> >> >> >> Hongtao Liu via Gcc-patches writes: >> >> > Hi: >> >> > For inline asm, there could be an

Re: Avoid char[] array in tree_def

2020-10-29 Thread Jan Hubicka
> On Thu, 29 Oct 2020, Jan Hubicka wrote: > > > > > > > That's ugly and will for sure defeat warning / access code > > > when we access this as char[], no? I mean, we could > > > as well use 'int str[1];' here? > > > > Well, we always get char pointer via macro that is IMO OK, but I am also > >

Re: [PATCH][PR target/97540] Don't extract memory from operand for normal memory constraint.

2020-10-29 Thread Richard Sandiford via Gcc-patches
Hongtao Liu via Gcc-patches writes: > On Tue, Oct 27, 2020 at 7:13 PM Richard Sandiford > wrote: >> >> Hongtao Liu via Gcc-patches writes: >> > Hi: >> > For inline asm, there could be an operand like (not (mem:)), it's >> > not a valid operand for normal memory constraint. >> > Bootstrap is

Re: PowerPC: Update __float128 and __ibm128 error messages.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Tue, Oct 27, 2020 at 06:27:22PM -0500, Segher Boessenkool wrote: > Hi! > > On Thu, Oct 22, 2020 at 06:11:35PM -0400, Michael Meissner wrote: > > This patch attempts to make the error messages for intermixing IEEE 128-bit > > floating point with IBM 128-bit extended double types to be clearer if

Improve vec::copy mem stat annotations

2020-10-29 Thread Jan Hubicka
Hi, this patch annotates vec::copy so it shows better in stats. I still do not see how auto vecs gets miscounted. Bootstrapped/regtested x86_64-linux, comitted. Honza * vec.h (vec::copy): Pass mem stat info. diff --git a/gcc/vec.h b/gcc/vec.h index 3ad26972a62..14d77e87342 100644 --- a/

Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.

2020-10-29 Thread Michael Meissner via Gcc-patches
On Mon, Oct 26, 2020 at 05:48:48PM -0500, will schmidt wrote: > On Thu, 2020-10-22 at 18:15 -0400, Michael Meissner via Gcc-patches wrote: > > PowerPC: Allow C/C++ to change long double type on GLIBC 2.32. > > > > This is a new patch. It turns off the warning about switching the long > > double

[Patch] Fortran: Update omp atomic for OpenMP 5

2020-10-29 Thread Tobias Burnus
The parser partially anticipates the upcoming OpenMP 5.1 changes, which adds some more clauses - but otherwise does not update it for OpenMP 5.1, yet. In particular, the "omp end atomic" for capture is still required and the memory-order-clause restrictions still apply. I am a bit unsure about ho

Re: [PATCH][PR target/97540] Don't extract memory from operand for normal memory constraint.

2020-10-29 Thread Richard Sandiford via Gcc-patches
Jakub Jelinek writes: > On Tue, Oct 27, 2020 at 11:13:21AM +, Richard Sandiford via Gcc-patches > wrote: >> Sorry to stick my oar in, but I think we should reconsider the >> bcst_mem_operand approach. It seems like these patches (and the >> previous one) are fighting against the principle th

[PATCH] aarch64: Add backend support for expanding __builtin_memset

2020-10-29 Thread Sudakshina Das via Gcc-patches
Hi This patch implements aarch64 backend expansion for __builtin_memset. Most of the implementation is based on the expansion of __builtin_memcpy. We change the values of SET_RATIO and MOVE_RATIO for cases where we do not have to strictly align and where we can benefit from NEON instructions in

Re: [PATCH] libstdc++: remove an ignored qualifier on function return type

2020-10-29 Thread Jonathan Wakely via Gcc-patches
On Fri, 28 Aug 2020 at 07:56, Krystian Kuźniarek via Libstdc++ wrote: > > > So then you need to produce a changelog entry by hand. > I had this problem on some old Ubuntu 18.04. Anyway, here's new ChangeLog: > > libstdc++-v3/ChangeLog: > > * include/std/variant: Fix -Wignored-quali

Re: Avoid char[] array in tree_def

2020-10-29 Thread Richard Biener
On Thu, 29 Oct 2020, Jakub Jelinek wrote: > On Thu, Oct 29, 2020 at 05:00:40PM +0100, Jan Hubicka wrote: > > > > > > That's ugly and will for sure defeat warning / access code > > > when we access this as char[], no? I mean, we could > > > as well use 'int str[1];' here? > > > > Well, we always

Re: [PATCH][AArch64] ACLE intrinsics: convert from BFloat16 to Float32

2020-10-29 Thread Richard Sandiford via Gcc-patches
Dennis Zhang writes: > diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def > b/gcc/config/aarch64/aarch64-simd-builtins.def > index 5bc596dbffc..b68c3ca7f4b 100644 > --- a/gcc/config/aarch64/aarch64-simd-builtins.def > +++ b/gcc/config/aarch64/aarch64-simd-builtins.def > @@ -732,3 +732,8 @@

Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Richard Sandiford via Gcc-patches
Qing Zhao via Gcc-patches writes: >>> +Return-Oriented Programming (ROP) or preventing information leak >> >> leakage >> >> (FWIW, I'm not sure “mitigating ROP” is really correct usage, but I don't >> have any better suggestions.) > > Do you mean whether “mitigating ROP’ is one of the major purp

Re: [PATCH][middle-end][i386][version 5]Add -fzero-call-used-regs=[skip|used-gpr-arg|used-arg|all-gpr-arg|all-arg|used-gpr|all-gpr|used|all]

2020-10-29 Thread Richard Sandiford via Gcc-patches
Qing Zhao writes: > Now, the documentation (gcc.info) is like following, let me know any issue > there: Yeah, looks good apart from merging > In order to satisfy users with different security needs and control > the run-time overhead at the same time, CHOICE parameter provides a >

Re: PowerPC: Add __float128 conversions to/from Decimal

2020-10-29 Thread Segher Boessenkool
Hi! On Thu, Oct 29, 2020 at 12:45:15PM -0400, Michael Meissner wrote: > On Wed, Oct 28, 2020 at 07:04:31PM -0500, Segher Boessenkool wrote: > > > +#if HAVE_KF_MODE > > > + strfromf128 (buf, BUFMAX, BFP_FMT, (BFP_VIA_TYPE) x); > > > +#else > > >sprintf (buf, BFP_FMT, (BFP_VIA_TYPE) x); > > > +

Re: [PATCH v2] c++: Implement -Wvexing-parse [PR25814]

2020-10-29 Thread Marek Polacek via Gcc-patches
On Thu, Oct 29, 2020 at 11:17:37AM -0400, Jason Merrill via Gcc-patches wrote: > On 10/28/20 7:40 PM, Marek Polacek wrote: > > On Wed, Oct 28, 2020 at 03:09:08PM -0400, Jason Merrill wrote: > > > On 10/28/20 1:58 PM, Marek Polacek wrote: > > > > On Wed, Oct 28, 2020 at 01:26:53AM -0400, Jason Merri

[PATCH] LTO: get_section: add new argument

2020-10-29 Thread Martin Liška
One more backport I've just tested: gcc/ChangeLog: PR lto/97508 * langhooks.c (lhd_begin_section): Call get_section with not_existing = true. * output.h (get_section): Add new argument. * varasm.c (get_section): Fail when NOT_EXISTING is true and a

Re: [PATCH v2] c++: Implement -Wvexing-parse [PR25814]

2020-10-29 Thread Jason Merrill via Gcc-patches
On 10/29/20 2:11 PM, Marek Polacek wrote: On Thu, Oct 29, 2020 at 11:17:37AM -0400, Jason Merrill via Gcc-patches wrote: On 10/28/20 7:40 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 03:09:08PM -0400, Jason Merrill wrote: On 10/28/20 1:58 PM, Marek Polacek wrote: On Wed, Oct 28, 2020 at 0

Re: PowerPC: Update IEEE 128-bit built-ins for long double is IEEE 128-bit.

2020-10-29 Thread Segher Boessenkool
On Thu, Oct 29, 2020 at 12:47:20PM -0400, Michael Meissner wrote: > On Tue, Oct 27, 2020 at 09:38:20AM -0500, will schmidt wrote: > > > @@ -2420,6 +2423,8 @@ BU_P9V_64BIT_VSX_2 (VSIEDPF, > > > "scalar_insert_exp_dp", CONST, xsiexpdpf) > > > > > > BU_FLOAT128_HW_VSX_2 (VSIEQP,"scalar_

Re: PowerPC: Add __float128 conversions to/from Decimal

2020-10-29 Thread Joseph Myers
On Thu, 29 Oct 2020, Segher Boessenkool wrote: > Hi! > > On Thu, Oct 29, 2020 at 12:45:15PM -0400, Michael Meissner wrote: > > On Wed, Oct 28, 2020 at 07:04:31PM -0500, Segher Boessenkool wrote: > > > > +#if HAVE_KF_MODE > > > > + strfromf128 (buf, BUFMAX, BFP_FMT, (BFP_VIA_TYPE) x); > > > > +#e

Re: PowerPC: Update IEEE 128-bit built-ins for long double is IEEE 128-bit.

2020-10-29 Thread Segher Boessenkool
On Thu, Oct 29, 2020 at 12:50:10PM -0400, Michael Meissner wrote: > On Wed, Oct 28, 2020 at 06:27:42PM -0500, Segher Boessenkool wrote: > > On Thu, Oct 22, 2020 at 06:09:38PM -0400, Michael Meissner wrote: > > > This patch adds long double variants of the power10 __float128 built-in > > > functions

Re: PowerPC: Use __builtin_pack_ieee128 if long double is IEEE 128-bit.

2020-10-29 Thread Segher Boessenkool
On Thu, Oct 29, 2020 at 12:56:03PM -0400, Michael Meissner wrote: > On Wed, Oct 28, 2020 at 04:58:46PM -0500, Segher Boessenkool wrote: > > > #if defined (__LONG_DOUBLE_128__) && defined (__LONG_DOUBLE_IBM128__) > > > \ > > > && !(defined (_SOFT_FLOAT) || defined (__NO_FPRS__)) > > >r

[PATCH 2/3] Binutils: Pass --plugin to AR and RANLIB

2020-10-29 Thread H.J. Lu via Gcc-patches
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. libctf/

  1   2   >