Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-21 Thread Alexandre Oliva
On Oct 18, 2020, Alexandre Oliva wrote: > The Aux_Short_Float unit is implemented in terms of the Aux_Float one, > and the others rely on the elementary functions from the C Math > library for float, double and long double types, respectively. Use Aux_Long_Float for all real types on LynxOS

Re: [PATCH] c++: Check DECL_TEMPLATE_PARM_P in duplicate_decls [PR97511]

2020-10-21 Thread Jason Merrill via Gcc-patches
On 10/21/20 4:35 PM, Patrick Palka wrote: This makes duplicate_decls differentiate a TYPE_DECL for an alias template from a TYPE_DECL for one of its template parameters. The recently added assert in template_parm_to_arg revealed this latent issue because merging of the two TYPE_DECLs cleared

Re: [PATCH] c++: Handle RANGE_EXPR indexes in init_subob_ctx [PR97328]

2020-10-21 Thread Jason Merrill via Gcc-patches
On 10/8/20 4:47 PM, Patrick Palka wrote: In the testcase below, we're ICEing during constexpr evaluation of the CONSTRUCTOR {.data={{}, [1 ... 7]={}}} of type 'vector'. The apparently unique thing about this CONSTRUCTOR is that it has a RANGE_EXPR index whose corresponding sub-aggregate

Re: Increase inlining limits for inline functions with builtin_constant_p on parameter

2020-10-21 Thread Jan Hubicka
> > Hello. > > Maybe a silly question, but isn't the code only an obfuscation? > What about doing: > > if (__builtin_constant_p(x)) > return x < 2 ? 0 : __builtin_clz(x); > > which is fully eliminated in a c.031t.ccp1 pass right after einline happens > for a call context where 'x' is a

Re: [PATCH] c++: Handle RANGE_EXPR indexes in init_subob_ctx [PR97328]

2020-10-21 Thread Patrick Palka via Gcc-patches
On Wed, 21 Oct 2020, Jason Merrill wrote: > On 10/8/20 4:47 PM, Patrick Palka wrote: > > In the testcase below, we're ICEing during constexpr evaluation of the > > CONSTRUCTOR {.data={{}, [1 ... 7]={}}} of type 'vector'. The apparently > > unique thing about this CONSTRUCTOR is that it has a

Re: enable sincos optimization on cygming targets

2020-10-21 Thread Alexandre Oliva
Err, sorry, I mislabeled this patch as [FYI,Ada], but it is neither about Ada nor pre-approved. It does require a review before I can check it in. On Oct 22, 2020, Alexandre Oliva wrote: > for gcc/ChangeLog > * config/i386/cygming.h (TARGET_LIBC_HAS_FUNCTION): Enable > sincos

libgo patch committed: Only compile ptrace shim on GNU/Linux

2020-10-21 Thread Ian Lance Taylor via Gcc-patches
This libgo patch by Nikhil Benesch only compiles the ptrace varargs shim on GNU/Linux, to avoid compilation failures on some other platforms. The C ptrace function is not entirely portable (e.g., NetBSD has `int data` instead of `void* data`), and so far Linux is the only platform that needs the

[FYI,Ada] enable sincos optimization on cygming targets

2020-10-21 Thread Alexandre Oliva
The sincos transformation does not take place on all platforms, because the libc_has_function target hook disables it by default. Current w64-mingw's math library supports sincos, sincosl and sincosf, in 32- and 64-bit modes. I suppose this has been this way for long, also with mingw32 and

Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-21 Thread Alexandre Oliva
On Oct 19, 2020, Alexandre Oliva wrote: > Hello, Andreas, > On Oct 19, 2020, Andreas Schwab wrote: >> -nostdinc a-nallfl.ads -o a-nallfl.o >> a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on return value >> a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on argument

Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-21 Thread Alexandre Oliva
On Oct 20, 2020, Rainer Orth wrote: > your patch similarly broke sparc*-sun-solaris* bootstrap. The attached > snippet on top of this workaround fixes that. Thanks, here's what I'm installing, approved by me with my build machinery maintainer hat on ;-) Use Aux_Long_Long_Float wraplf for

Re: [Ada,FYI] revamp ada.numerics.aux

2020-10-21 Thread Alexandre Oliva
On Oct 18, 2020, Alexandre Oliva wrote: > The option is provided by default, but there is an alternate version > that doesn't, that is used for vxworks targets. vxworks float EFs not precise enough -> use long float From: Alexandre Oliva Some acats-4 tests that check the precision of Float

Increase weight of builtin_constant_p hint

2020-10-21 Thread Jan Hubicka
hi, this patch makes builtin_constant_p hint to combine with other loop hints we already support. This is necessary for it to be realy effective since most such functions will already get big_speedup hint. Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: 2020-10-22 Jan Hubicka

[PATCH] Handle a_2= properly in range calculations.

2020-10-21 Thread Andrew MacLeod via Gcc-patches
Pick up the correct type for the RHS of  a_2 = bootstrapped on  x86_64-pc-linux-gnu, no regressions, pushed. Andrew commit 966fdb2e12c0347aa3f9efaf5f4e1cd8237fa024 Author: Andrew MacLeod Date: Wed Oct 21 20:11:16 2020 -0400 Handle a_2= properly in range calculations. when

Re: [PATCH][Arm] Auto-vectorization for MVE: vmin/vmax

2020-10-21 Thread Dennis Zhang via Gcc-patches
Hi Kyrylo, > > From: Kyrylo Tkachov > Sent: Wednesday, October 14, 2020 10:15 AM > To: Dennis Zhang; gcc-patches@gcc.gnu.org > Cc: nd; Richard Earnshaw; Ramana Radhakrishnan > Subject: RE: [PATCH][Arm] Auto-vectorization for MVE: vmin/vmax > > Hi Dennis,

Re: [PATCH] RISC-V: Extend syntax for the multilib-generator

2020-10-21 Thread Jim Wilson
On Fri, Oct 16, 2020 at 2:34 AM Kito Cheng wrote: > +# Example 2: > +# rv32imafd-ilp32d--c*b > +# means that, in addition to rv32imafd, these configurations can also use > the > +# rv32imafd-ilp32d libraries: rv32imafd-ilp32dc, rv32imafd-ilp32db, > +#

Re: [PATCH] RISC-V: Extend syntax for the multilib-generator

2020-10-21 Thread Jim Wilson
On Wed, Oct 21, 2020 at 7:36 PM Jim Wilson wrote: > > > On Fri, Oct 16, 2020 at 2:34 AM Kito Cheng wrote: > >> +# Example 2: >> +# rv32imafd-ilp32d--c*b >> +# means that, in addition to rv32imafd, these configurations can also >> use the >> +# rv32imafd-ilp32d libraries: rv32imafd-ilp32dc,

Re: [PATCH] [PR rtl-optimization/97249]Simplify vec_select of paradoxical subreg.

2020-10-21 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 22, 2020 at 12:36 AM Segher Boessenkool wrote: > > On Wed, Oct 21, 2020 at 04:43:29PM +0100, Richard Sandiford wrote: > > Hongtao Liu writes: > > > + poly_uint64 nunits > > > + = GET_MODE_NUNITS (GET_MODE (SUBREG_REG (trueop0))); > > > + rtx par = trueop1; >

[PATCH] Check for undefined before not returning a constant value

2020-10-21 Thread Andrew MacLeod via Gcc-patches
Full comments in the PR, but basically substitute and fold was expecting to see a constant returned for any range which globally evaluates to a constant. This allowed it to replace all uses of an ssa name as they were encountered. The ranger model can return UNDEFINED for the range of names in

Re: [PATCH 2/2, rs6000, V2] VSX load/store rightmost element operations

2020-10-21 Thread Segher Boessenkool
On Tue, Oct 20, 2020 at 04:34:46PM -0500, will schmidt wrote: > This adds support for the VSX load/store rightmost element operations. > This includes the instructions lxvrbx, lxvrhx, lxvrwx, lxvrdx, > stxvrbx, stxvrhx, stxvrwx, stxvrdx; And the builtins > vec_xl_sext() /* vector load sign extend

Re: [PATCH] Implement no_stack_protect attribute.

2020-10-21 Thread Nick Desaulniers via Gcc-patches
On Tue, Oct 20, 2020 at 5:19 AM Richard Biener wrote: > > On Tue, Oct 20, 2020 at 1:24 PM Martin Liška wrote: > > > > PING^5 > > So can we use the same identifier as clang here as Nick > requests? Thus, OK with re-naming everything alongside > no_stack_protector. It isn't really the opposite

Re: [PATCH] Implement no_stack_protect attribute.

2020-10-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 21, 2020 at 02:04:15PM -0700, Nick Desaulniers via Gcc-patches wrote: > Tangentially related question: > We're running into a bug related to LTO for the kernel when code > compiled with -fno-stack-protector is called from and inlined into > code that is compiled with

Move nested function info out of cgraph_node

2020-10-21 Thread Jan Hubicka
Hi, this patch moves nested function information out of cgraph_node (to a summary). This saves memory (especially at WPA time) and also makes nested function support more contained. Bootstrapped/regtested x86_64-linux. Plan to commit it tomorrow. gcc/ChangeLog: 2020-10-22 Jan Hubicka

[PATCH] c++: Check DECL_TEMPLATE_PARM_P in duplicate_decls [PR97511]

2020-10-21 Thread Patrick Palka via Gcc-patches
This makes duplicate_decls differentiate a TYPE_DECL for an alias template from a TYPE_DECL for one of its template parameters. The recently added assert in template_parm_to_arg revealed this latent issue because merging of the two TYPE_DECLs cleared the DECL_TEMPLATE_PARM_P flag. With this

Re: [PATCH] c++: constexpr evaluation and bare EMPTY_CLASS_EXPR [PR96575]

2020-10-21 Thread Jason Merrill via Gcc-patches
On 10/21/20 12:37 PM, Patrick Palka wrote: In the testcase below, folding of the initializer for 'ret' inside the instantiated f::lambda ends up yielding an initializer for which potential_constant_expression returns false. This causes finish_function to mark the lambda as non-constexpr, which

Re: [PATCH] c++: Handle RANGE_EXPR indexes in init_subob_ctx [PR97328]

2020-10-21 Thread Jason Merrill via Gcc-patches
On 10/21/20 5:46 PM, Patrick Palka wrote: On Wed, 21 Oct 2020, Jason Merrill wrote: On 10/8/20 4:47 PM, Patrick Palka wrote: In the testcase below, we're ICEing during constexpr evaluation of the CONSTRUCTOR {.data={{}, [1 ... 7]={}}} of type 'vector'. The apparently unique thing about this

Re: [PATCH][Arm] Auto-vectorization for MVE: vmul

2020-10-21 Thread Dennis Zhang via Gcc-patches
Hi kyrylo, > > From: Kyrylo Tkachov > Sent: Wednesday, October 14, 2020 10:14 AM > To: Dennis Zhang; gcc-patches@gcc.gnu.org > Cc: nd; Richard Earnshaw; Ramana Radhakrishnan > Subject: RE: [PATCH][Arm] Auto-vectorization for MVE: vmul > > Hi Dennis, > >

Re: [PATCH] Implement no_stack_protect attribute.

2020-10-21 Thread Nick Desaulniers via Gcc-patches
Thanks for the quick feedback! On Wed, Oct 21, 2020 at 2:13 PM Jakub Jelinek wrote: > > On Wed, Oct 21, 2020 at 02:04:15PM -0700, Nick Desaulniers via Gcc-patches > wrote: > > Tangentially related question: > > We're running into a bug related to LTO for the kernel when code > > compiled with

Re: [PATCH] Implement no_stack_protect attribute.

2020-10-21 Thread Nick Desaulniers via Gcc-patches
+ correct kernel mailing list this time. On Wed, Oct 21, 2020 at 2:33 PM Nick Desaulniers wrote: > > Thanks for the quick feedback! > > On Wed, Oct 21, 2020 at 2:13 PM Jakub Jelinek wrote: > > > > On Wed, Oct 21, 2020 at 02:04:15PM -0700, Nick Desaulniers via Gcc-patches > > wrote: > > >

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-21 Thread Segher Boessenkool
On Wed, Oct 21, 2020 at 01:27:42PM +1030, Alan Modra wrote: > On Tue, Oct 20, 2020 at 01:55:56PM -0500, Segher Boessenkool wrote: > > On Thu, Oct 08, 2020 at 09:27:54AM +1030, Alan Modra wrote: > > > The existing "case AND" in this function is not sufficient for > > >

Re: Increase inlining limits for inline functions with builtin_constant_p on parameter

2020-10-21 Thread Jan Hubicka
> On Wed, Oct 21, 2020 at 09:03:03PM +0200, Martin Liška wrote: > > Maybe a silly question, but isn't the code only an obfuscation? > > What about doing: > > > > if (__builtin_constant_p(x)) > > return x < 2 ? 0 : __builtin_clz(x); > > > > which is fully eliminated in a c.031t.ccp1 pass right

libgo patch committed: Update BSD socket code

2020-10-21 Thread Ian Lance Taylor via Gcc-patches
This libgo patch by Nikhil Benesch imports the upstream code for BSD sockets and sysctls into the syscall package. This code is sufficiently different that it doesn't get merged by the scripts. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

Ping: [PATCH][Arm] Auto-vectorization for MVE: vsub

2020-10-21 Thread Dennis Zhang via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555646.html Thanks From: Dennis Zhang Sent: Tuesday, October 6, 2020 5:46 PM To: gcc-patches@gcc.gnu.org Cc: Kyrylo Tkachov; nd; Richard Earnshaw; Ramana Radhakrishnan Subject: Re: [PATCH][Arm]

Re: [PATCH 1/2] [target 87767] Refactor AVX512 broadcast patterns with speical memory constraint.

2020-10-21 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 21, 2020 at 11:04 PM Vladimir Makarov wrote: > > > On 2020-10-20 10:11 p.m., Hongtao Liu wrote: > > > > Changed, and it passed the i386/x86-64 regression test. > > > > Update patch. > > > Thank you, Hongtao. This patch is ok for the trunk. > > Thanks for the review, committed. --

Re: PATCH [DR2303][PR97453]

2020-10-21 Thread Jason Merrill via Gcc-patches
On 10/21/20 6:32 AM, kamlesh kumar wrote: gcc/cp/ChangeLog --- 2020-10-21 Kamlesh Kumar PR c++/97453 * pt.c (get_template_base): Implement DR2303, Consider closest base while template deduction when base of base also matches. gcc/testsuite/ChangeLog

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-21 Thread Alan Modra via Gcc-patches
On Wed, Oct 21, 2020 at 03:29:11PM -0500, Segher Boessenkool wrote: > Anyway: > > + || (outer_code == AND > + && rs6000_is_valid_2insn_and (x, mode))) > { > *total = COSTS_N_INSNS (1); > return true; > > It should return COSTS_N_INSNS (2)

Re: [PATCH] Put absolute address jump table in data.rel.ro.local if targets support relocations

2020-10-21 Thread HAO CHEN GUI via Gcc-patches
I had a wrong email setting and got your reply later. I modified the patch according to your advice. Could you please review it again? Thanks. On 2/10/2020 上午 1:47, Richard Sandiford wrote: Sorry for the slow review. HAO CHEN GUI via Gcc-patches writes: diff --git a/gcc/config/mips/mips.c

Re: [PATCH] phiopt: Optimize x ? __builtin_clz (x) : 32 in GIMPLE [PR97503]

2020-10-21 Thread Rainer Orth
Hi Jakub, > While we have at the RTL level noce_try_ifelse_collapse combined with > simplify_cond_clz_ctz, that optimization doesn't always trigger because > e.g. on powerpc there is an define_insn to compare a reg against zero and > copy that register to another one and so we end up with a

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

2020-10-21 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.

[PATCH] rs6000: MMA type causes an ICE in ranger pass due to incompatible types

2020-10-21 Thread Peter Bergner via Gcc-patches
PR97360 shows a problem in how we create our PXI and POI modes that cause an ICE in the ranger pass. The problem seems to be that the extra call to build_distinct_type_copy() also creates new TYPE_{MIN,MAX}_VALUEs that are not compatible/the same as the base type itself. The simple "fix" is to

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

2020-10-21 Thread Segher Boessenkool
On Wed, Oct 21, 2020 at 06:09:28PM +0200, Uros Bizjak wrote: > On Wed, Oct 21, 2020 at 4:45 PM Qing Zhao wrote: > > Looks like it’s very complicate to use the st/mm register set correctly, So, > > I assume that this set of registers might be very hard to be used by the > > attacker correctly. >

Re: [PATCH] arm: Fix multiple inheritance thunks for thumb-1 with -mpure-code

2020-10-21 Thread Richard Earnshaw via Gcc-patches
On 21/10/2020 17:11, Christophe Lyon via Gcc-patches wrote: > On Wed, 21 Oct 2020 at 18:07, Richard Earnshaw > wrote: >> >> On 21/10/2020 16:49, Christophe Lyon via Gcc-patches wrote: >>> On Tue, 20 Oct 2020 at 13:25, Richard Earnshaw >>> wrote: On 20/10/2020 12:22, Richard Earnshaw

Re: [PATCH] phiopt: Optimize x ? __builtin_clz (x) : 32 in GIMPLE [PR97503]

2020-10-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 21, 2020 at 07:30:46PM +0200, Rainer Orth wrote: > this broke sparc-sun-solaris2.11 bootstrap > > /vol/gcc/src/hg/master/local/gcc/tree-ssa-phiopt.c: In function 'bool > cond_removal_in_popcount_clz_ctz_pattern(basic_block, basic_block, edge, > edge, gimple*, tree, tree)': >

Re: [PATCH] rs6000: MMA type causes an ICE in ranger pass due to incompatible types

2020-10-21 Thread Segher Boessenkool
Hi! On Wed, Oct 21, 2020 at 01:00:20PM -0500, Peter Bergner wrote: > PR97360 shows a problem in how we create our PXI and POI modes that cause > an ICE in the ranger pass. The problem seems to be that the extra call > to build_distinct_type_copy() also creates new TYPE_{MIN,MAX}_VALUEs that >

Re: Increase inlining limits for inline functions with builtin_constant_p on parameter

2020-10-21 Thread Martin Liška
On 10/21/20 5:11 PM, Jan Hubicka wrote: return ( __builtin_constant_p((size) - 1) ? ( __builtin_constant_p((size) - 1) ? ( ((size) - 1) < 2 ? 0 : ((size) - 1) & (1ULL << 63) ? 63 : ((size) - 1) & (1ULL << 62) ? 62 : ((size) - 1) & (1ULL << 61) ? 61 : ((size) - 1) & (1ULL << 60) ? 60 : ((size) -

Re: Increase inlining limits for inline functions with builtin_constant_p on parameter

2020-10-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 21, 2020 at 09:03:03PM +0200, Martin Liška wrote: > Maybe a silly question, but isn't the code only an obfuscation? > What about doing: > > if (__builtin_constant_p(x)) > return x < 2 ? 0 : __builtin_clz(x); > > which is fully eliminated in a c.031t.ccp1 pass right after einline

Re: [PATCH] rs6000: MMA type causes an ICE in ranger pass due to incompatible types

2020-10-21 Thread Peter Bergner via Gcc-patches
On 10/21/20 1:34 PM, Segher Boessenkool wrote: >> The following patch from Andrew and richi fixes the ICE on Martin's test >> case and passes bootstrap and regtesting on powerpc64le-linux. >> Ok for trunk? > > Yes, okay for trunk. Thanks! Ok, pushed to trunk. Thanks! >> Since the ranger

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

2020-10-21 Thread Thomas Rodgers
> On Oct 21, 2020, at 10:34 AM, Jonathan Wakely wrote: > > 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

[committed] libstdc++: Simplify std::shared_ptr construction from std::weak_ptr

2020-10-21 Thread Jonathan Wakely via Gcc-patches
The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of _Sp_counted_base are very similar, except that the former throws an exception when the use count is zero and the latter returns false. The former (and its callers) can be implemented in terms of the latter. This results in a small

[PATCH][pushed] ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1

2020-10-21 Thread Martin Liška
This is one another backport from master. Do not crash when AsanThread::GetStackVariableShadowStart does not find a variable for a pointer on a shadow stack. Cherry-pick from ad2be02a833e56f7fe280797280b219eb3312621. Differential Revision: https://reviews.llvm.org/D89552 ---

[PATCH][pushed] libsanitizer: add test-case

2020-10-21 Thread Martin Liška
And here I'm adding a test-case for the PR. Thanks, Martin gcc/testsuite/ChangeLog: PR sanitizer/97414 * g++.dg/asan/pr97414.C: New test. --- gcc/testsuite/g++.dg/asan/pr97414.C | 19 +++ 1 file changed, 19 insertions(+) create mode 100644

Re: [PATCH] Saturate overflows return from SCEV in ranger.

2020-10-21 Thread Aldy Hernandez via Gcc-patches
On 10/21/20 8:19 AM, Richard Biener wrote: On Tue, Oct 20, 2020 at 5:21 PM Aldy Hernandez via Gcc-patches wrote: bounds_of_var_in_loop is returning an overflowed int, which is causing us to create a range for which we can't compare the bounds causing an ICE in verify_range. Overflowed

[Ada] Fix crash on illegal OTHERS in iterated_component_association

2020-10-21 Thread Pierre-Marie de Rodat
A code for detecting illegal OTHERS clause is handles both component_association and iterated_component_association, whose choice list must be accessed with Choices and Discrete_Choices, respectively. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb

[Ada] Implement missing function result finalization.

2020-10-21 Thread Pierre-Marie de Rodat
In the case where a function call a) has a non-limited result type that requires finalization; and b) the callee has an out-mode (or in-out-mode) formal parameter; and c) the corresponding actual parameter's subtype is subject to an enabled predicate , fix a compiler bug that could

[Ada] Use index parameter for iterated_component_association

2020-10-21 Thread Pierre-Marie de Rodat
Processing of index parameters in iterated_component_association was different within array aggregates (where we created a synonym identifier) and array delta aggregates (where we used the existing defining identifier). Apparently, we can use the existing defining identifiers in both cases. This

[Ada] Compiler crash on prefixed call to controlled function with invariant check

2020-10-21 Thread Pierre-Marie de Rodat
When post call actions are created for a call to a function with a result of a controlled type, such as for performing an invariant check on a parameter with mode out or in out, the compiler can violate an assertion (or crash with a Storage_Error) due to not recognizing the expanded call as a

[Ada] Work around missing Long_Long_Long_Size entry in .atp file

2020-10-21 Thread Pierre-Marie de Rodat
This prevents the compiler from giving an error message when the new Long_Long_Long_Size entry is missing in a target configuration file. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * set_targ.adb (DTN): Fix oversight. (Read_Target_Dependent_Values): Do not error

[Ada] Codepeer remarks take into account

2020-10-21 Thread Pierre-Marie de Rodat
This patch adds pragma Assert to help CodePeer static analysis and pragma Annotate to ignore Intentional or False_Positive warning. Furthermore, some minor changes were added to take into account CodePeer finding. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Fix problematic placement of freeze node after instantiation

2020-10-21 Thread Pierre-Marie de Rodat
This prevents Freeze_Subprogram_Body from moving the freeze node of a package body outside of its scope when it contains the instantiation of a generic subprogram and the parent of the package body happens to be in the same declarative part as the freeze node of the scope of the generic

[Ada] Fix analysis of iterated component expression with null range

2020-10-21 Thread Pierre-Marie de Rodat
When checking legality of the iterated_component_association's expression the index parameter must be in scope, even its range is null. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb (Gen_Loop): Analyze copy of the expression in the scope of the

[Ada] Fix target configuration file used for CodePeer/SPARK for new ints

2020-10-21 Thread Pierre-Marie de Rodat
The new 128-bits integer support requires adapting the special target configuration file used for CodePeer and SPARK analysis. One change was missing in Width_From_Size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * ada_get_targ.adb (Width_From_Size): Add case for 128

[Ada] Fix bootstrap with old GCC

2020-10-21 Thread Pierre-Marie de Rodat
Some gcc versions (4 or less) support the __builtin_*_overflow routines while corresponding g++ compilers do not. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.c (__gnat_file_time): Use regular arithmetic instead of __builtin_*_overflow routines if GCC

[committed] aarch64: [testsuite] Fix typo in diagnostic message

2020-10-21 Thread Andrea Corallo via Gcc-patches
Hi all, just committed as very obvious the following simple patch fixing a nit in an Aarch64 testcase. Andrea >From 9491dfe6c8adc298af34ce13280e0d3411c89d7d Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 21 Oct 2020 08:48:16 +0200 Subject: [PATCH] aarch64: [testsuite] Fix typo in

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

2020-10-21 Thread Uros Bizjak via Gcc-patches
On Tue, Oct 20, 2020 at 10:04 PM Qing Zhao wrote: > +/* Check whether the register REGNO should be zeroed on X86. > + When ALL_SSE_ZEROED is true, all SSE registers have been zeroed > + together, no need to zero it again. > + Stack registers (st0-st7) and mm0-mm7 are aliased with each

Re: [PATCH] Saturate overflows return from SCEV in ranger.

2020-10-21 Thread Richard Biener via Gcc-patches
On Tue, Oct 20, 2020 at 5:21 PM Aldy Hernandez via Gcc-patches wrote: > > bounds_of_var_in_loop is returning an overflowed int, which is causing > us to create a range for which we can't compare the bounds causing > an ICE in verify_range. > > Overflowed bounds cause compare_values() to return

[PATCH] Fix discrepancy in Walloca test on 32-bit systems.

2020-10-21 Thread Aldy Hernandez via Gcc-patches
There is a discrepancy in the way we report -Walloca-larger-than= errors on 32-bit versus 64-bit architectures, due to the nature of ranges derived from a cast operation. For the Walloca-1 tests on 64-bits we get: int num.0_1; long unsigned int _2; [local count: 1073741824]: num.0_1 =

[Ada] Make minimum accessibility level a constant object

2020-10-21 Thread Pierre-Marie de Rodat
Minimum accessibility level was stored in a variable which was never modified. It seems cleaner to store it in a constant, which hopefully allows better optimization (e.g. when tracking know object the value of a variable is killed on a subprogram called). No impact on compiler behaviour, expect

[Ada] Use VxWorks 7 APIs for accessing environment variables in kernel mode

2020-10-21 Thread Pierre-Marie de Rodat
VxWorks 7 provides newer APIs for kernel mode for accessing environment variables that lead to smaller and more efficient code. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * env.c (__gnat_setenv): call setenv for VxWorks 7 kernel mode. (__gnat_environ): envGet

[Ada] Fix bogus error for bit-packed array with volatile component

2020-10-21 Thread Pierre-Marie de Rodat
This fixes a bogus error recently introduced in the compiler for a bit-packed array component in a record type with Volatile_Components aspect on the array definition. The array type should not be deemed requiring strict alignment, although it is a by-reference type. Tested on

[Ada] Incorrect associations for extra accessibility parameters

2020-10-21 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby extra accessibility level actuals did not get expanded properly in calls - leading to mislabed parameter associations. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Modify calls to

[Ada] Remove -mthreads from Linker_Options pragma for x86-lynx178e

2020-10-21 Thread Pierre-Marie de Rodat
The -mthreads flag is no longer needed. It was deprecated in 2.2.4 and in 2.2.5 causes the linker to reference a non-existent directory. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-osinte__lynxos178e.ads: Remove -mthreads switch.diff --git

[Ada] Fix crash with iterated_component_association and -gnatc

2020-10-21 Thread Pierre-Marie de Rodat
When expansion was disabled, e.g. in GNATprove mode or when switch -gnatc was used, analysis of the iterated_component_association's expression was crashing when the expression included a function call. The problem was that a copy of the expression was created with empty parent. Then an

[Ada] Raise Capacity_Error on formal vector insertion

2020-10-21 Thread Pierre-Marie de Rodat
Capacity_Error should be raised on insertion inside a formal vector when the capacity is exceeded. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cofove.adb (Copy): Add explanation in case of Capacity_Error. (Insert_Space): Raise Capacity_Error if

[Ada] Improve precision of Ada.Directories.Modification_Time

2020-10-21 Thread Pierre-Marie de Rodat
The modification file time precision now defined by OS. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.c (__gnat_file_time): New routine. (__gnat_copy_attribs): Copy timestamps in nanoseconds. * libgnat/a-direct.adb (C_Modification_Time): Bind to

[Ada] Disable warnings on entities when building finalizers

2020-10-21 Thread Pierre-Marie de Rodat
GNAT emits references to GNAT-generated entities when generating finalizers. These references are protected by a counter. GCC is unable to detect that the counter protects these references and emits warnings when -Wmaybe-uninitialized is used. This is a problem because users can't do anything to

[Ada] Use helper function in Freeze_Subprogram_Body

2020-10-21 Thread Pierre-Marie de Rodat
This replaces the manual retrieval of the freeze node for the enclosing body of the generic with a mere call to Package_Freeze_Node. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Freeze_Subprogram_Body): Call

[Ada] Simplify the VxWorks implementation of __gnat_environ

2020-10-21 Thread Pierre-Marie de Rodat
The VxWorks kernel implementation of __gnat_environ was more convoluted than it needed to be and had an unneeded dependency on ppGlobalEnviron, a symbol which Wind River has removed in newer versions of VxWorks. This patch simplifies the implementation and uses a common implementation for both

[Ada] Wrong detection of potentially blocking call in protected object

2020-10-21 Thread Pierre-Marie de Rodat
When a protected subprogram invokes a function that returns a limited type, and the sources are compiled with pragma Detect_ Blocking, the code generated by the compiler erroneously invokes the runtime service Activate_Tasks, call which is detected by the runtime as a potentially blocking call (as

Re: [PATCH] Saturate overflows return from SCEV in ranger.

2020-10-21 Thread Richard Biener via Gcc-patches
On Wed, Oct 21, 2020 at 9:30 AM Aldy Hernandez wrote: > > > > On 10/21/20 8:19 AM, Richard Biener wrote: > > On Tue, Oct 20, 2020 at 5:21 PM Aldy Hernandez via Gcc-patches > > wrote: > >> > >> bounds_of_var_in_loop is returning an overflowed int, which is causing > >> us to create a range for

Re: [committed][nvptx] Remove -m32

2020-10-21 Thread Tom de Vries
On 10/20/20 3:48 PM, Tobias Burnus wrote: > On 10/15/20 3:26 PM, Tom de Vries wrote: >>   PR target/97436 >>   * config/nvptx/nvptx.opt (m32): Comment out. >>   * doc/invoke.texi (NVPTX options): Remove -m32. > > This caused the warning: doc/invoke.texi:25617: warning: @itemx should >

[PATCH 1/2] Separate new_edges compute in copy_bbs

2020-10-21 Thread Richard Biener
This separates out a loop finding new_edges from edges in copy_bbs, making its complexity cheaper overall from total number of succs in copied bbs times num_edges to num_edges times the complexity of find_edge. Bootstrapped / tested on x86_64-unknown-linux-gnu, pushed. 2020-10-21 Richard Biener

[PATCH 2/2] Simplify CFG copying tables

2020-10-21 Thread Richard Biener
This simplifies the maps between original and new basic blocks and loops as used for CFG copying. Instead of using a pointer hash table to allocated mapping entries use a hash_map with int_hash, removing the indirection and code duplication. We can use -1 and -2 as empty/deleted values as those

Re: [PATCH] Saturate overflows return from SCEV in ranger.

2020-10-21 Thread Aldy Hernandez via Gcc-patches
On 10/21/20 9:59 AM, Richard Biener wrote: /* Even for valid range info, sometimes overflow flag will leak in. As GIMPLE IL should have no constants with TREE_OVERFLOW set, we drop them. */ if (TREE_OVERFLOW_P (*min)) *min = drop_tree_overflow (*min); if

[PATCH] LTO: get_section: add new argument

2020-10-21 Thread Martin Liška
Hey. During partial linking we ipa_prop_write_jump_functions twice from 2 IPA pass (fnsummary and cp). That produces 2 compressed blocks in an ELF section and then zstd complains as sections size does not correspond to the compressed stream. I'm adding both sanity check changes and the fix in

Re: [patch] Introduce vxworks7r2 support for ppc and ppc64

2020-10-21 Thread Olivier Hainque
Hi Segher! > On 20 Oct 2020, at 22:06, Segher Boessenkool > wrote: > >> +# Wind River 7 post SR0600 is mostly like Linux so we setup >> +# out config in a very similar fashion and adjust to a few >> +# specificities. > > "our config"? > >> + - Starting with VxWorks 7 (post

Re: [PATCH] phiopt: Optimize x ? __builtin_clz (x) : 32 in GIMPLE [PR97503]

2020-10-21 Thread Richard Biener
On Wed, 21 Oct 2020, Jakub Jelinek wrote: > Hi! > > While we have at the RTL level noce_try_ifelse_collapse combined with > simplify_cond_clz_ctz, that optimization doesn't always trigger because > e.g. on powerpc there is an define_insn to compare a reg against zero and > copy that register to

Re: [PATCH][PR 97506] Simplify trivial vcond_expr in expander.

2020-10-21 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 21, 2020 at 02:29:07PM +0800, Hongtao Liu via Gcc-patches wrote: > gcc/ChangeLog: > > PR target/97506 > * config/i386/i386-expand.c (ix86_expand_sse_movcc): Move > op_true to dest directly When op_true equals op_false, Lowercase when in the middle of sentence.

[PATCH] rs6000: Don't split constant operator add before reload, move to temp register for future optimization

2020-10-21 Thread Xionghu Luo via Gcc-patches
This is a revised version of the patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542718.html, resend this since this is a quite high priority performance issue for Power. Don't split code from add3 for SDI to allow a later pass to split. This allows later logic to hoist out

[PATCH] vect: Remove redundant LOOP_VINFO_FULLY_MASKED_P

2020-10-21 Thread Kewen.Lin via Gcc-patches
Hi, This is a very trivial patch, it's to remove a redundant LOOP_VINFO_FULLY_MASKED_P condition check which will be checked in vect_use_loop_mask_for_alignment_p. Is it OK for trunk? BR, Kewen - gcc/ChangeLog: * tree-vect-loop.c (vect_transform_loop): Remove the redundant

[PATCH 1/2] ASAN: Support detect_invalid_pointer_pairs=1 with detect_stack_use_after_return=1

2020-10-21 Thread Martin Liška
Do not crash when AsanThread::GetStackVariableShadowStart does not find a variable for a pointer on a shadow stack. Cherry-pick from ad2be02a833e56f7fe280797280b219eb3312621. Differential Revision: https://reviews.llvm.org/D89552 (cherry picked from commit

[PATCH 2/2] libsanitizer: add test-case

2020-10-21 Thread Martin Liška
gcc/testsuite/ChangeLog: PR sanitizer/97414 * g++.dg/asan/pr97414.C: New test. (cherry picked from commit 6c5b08a2ca935c5db68e79d33e5c5b752252115c) --- gcc/testsuite/g++.dg/asan/pr97414.C | 19 +++ 1 file changed, 19 insertions(+) create mode 100644

[PATCH] tree-optimization/97500 - avoid SLP backedges for inductions

2020-10-21 Thread Richard Biener
Inductions are not vectorized as cycle but materialized from SCEV data. Filling in backedge SLP nodes confuses this process. Bootstrapped / tested on x86_64-unknown-linux-gnu, pushed. 2020-10-21 Richard Biener PR tree-optimization/97500 * tree-vect-slp.c

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

2020-10-21 Thread Jan Hubicka
> Hey. > > During partial linking we ipa_prop_write_jump_functions twice from 2 IPA > pass (fnsummary and cp). That produces 2 compressed blocks in an ELF section > and then zstd complains as sections size does not correspond to the compressed > stream. > > I'm adding both sanity check changes

PATCH [DR2303][PR97453]

2020-10-21 Thread kamlesh kumar via Gcc-patches
gcc/cp/ChangeLog --- 2020-10-21 Kamlesh Kumar PR c++/97453 * pt.c (get_template_base): Implement DR2303, Consider closest base while template deduction when base of base also matches. gcc/testsuite/ChangeLog --

[PATCH][PR 97506] Simplify trivial vcond_expr in expander.

2020-10-21 Thread Hongtao Liu via Gcc-patches
Hi: Bootstrap is ok, so is i386/x86-64 regression test. gcc/ChangeLog: PR target/97506 * config/i386/i386-expand.c (ix86_expand_sse_movcc): Move op_true to dest directly When op_true equals op_false, gcc/testsuite/ChangeLog: PR target/97506 *

[PATCH] Move simplify_cond_using_ranges_2 to tree-vrp.c

2020-10-21 Thread Aldy Hernandez via Gcc-patches
This was slated to be moved last year, as its only use is in tree-vrp.c There are no functional changes. It's just a move and a rename. Pushed. gcc/ChangeLog: * vr-values.h: Remove simplify_cond_using_ranges_2. (range_fits_type_p): New. * vr-values.c

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

2020-10-21 Thread Uros Bizjak via Gcc-patches
On Wed, Oct 21, 2020 at 9:18 AM Uros Bizjak wrote: > > On Tue, Oct 20, 2020 at 10:04 PM Qing Zhao wrote: > > > +/* Check whether the register REGNO should be zeroed on X86. > > + When ALL_SSE_ZEROED is true, all SSE registers have been zeroed > > + together, no need to zero it again. > > +

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

2020-10-21 Thread Hongyu Wang via Gcc-patches
Hi, > IIRC, adding a new regclass is O(n^2), so it should be avoided. I > think that the new patterns should follow the same path as vzeroall > and vzeroupper patterns, where we emit the pattern with explicit hard > regs. > > BTW: We do have SSE_FIRST_REG class, but this class was added to solve

Re: [PATCH] Saturate overflows return from SCEV in ranger.

2020-10-21 Thread Richard Biener via Gcc-patches
On Wed, Oct 21, 2020 at 10:50 AM Aldy Hernandez wrote: > > > > On 10/21/20 9:59 AM, Richard Biener wrote: > > >>> /* Even for valid range info, sometimes overflow flag will leak in. > >>>As GIMPLE IL should have no constants with TREE_OVERFLOW set, we > >>>drop them. */ > >>>

[PATCH] aarch64: Add vcopy(q)__lane(q)_bf16 intrinsics

2020-10-21 Thread Andrea Corallo via Gcc-patches
Hi all, I'd like to submit the following patch implementing the bfloat16_t neon related copy intrinsics: vcopy_lane_bf16, vcopyq_lane_bf16, vcopyq_laneq_bf16, vcopy_laneq_bf16. Please see refer to: ACLE ISA

Re: [PATCH] vect: Remove redundant LOOP_VINFO_FULLY_MASKED_P

2020-10-21 Thread Richard Biener via Gcc-patches
On Wed, Oct 21, 2020 at 10:58 AM Kewen.Lin via Gcc-patches wrote: > > Hi, > > This is a very trivial patch, it's to remove a redundant > LOOP_VINFO_FULLY_MASKED_P condition check which will be > checked in vect_use_loop_mask_for_alignment_p. > > Is it OK for trunk? OK. > > BR, > Kewen > - >

  1   2   >