Re: [PATCH] Builtin function roundeven folding implementation

2019-08-13 Thread Tejas Joshi
Hi. Here is a clean patch that does not fold roundeven resulting for integer type and the conditions for folding functions round/ceil/floor/roundeven and trunc only checks for signaling NaN. This patch also conforms to GNU's coding style and standards. The fact that it should be CASE_MATHFN_FLOATN

[Committed] PR fortran/87991 -- Pointer data object requires a target

2019-08-13 Thread Steve Kargl
Committed as obviously. 2019-08-13 Steven G. Kargl PR fortran/87991 * resolve.c (check_data_variable): data-stmt-object with pointer attribute requires a data-stmt-value with the target attribute. 2019-08-13 Steven G. Kargl PR fortran/87991 *

Re: enforce canonicalization of value_range's

2019-08-13 Thread Aldy Hernandez
On 8/12/19 7:32 PM, Jeff Law wrote: On 8/12/19 12:48 PM, Aldy Hernandez wrote: This is a ping of: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg8.html I have addressed the comments Jeff mentioned there. This patch goes before the VR_VARYING + types patch, but I can adapt either one to

Re: types for VR_VARYING

2019-08-13 Thread Aldy Hernandez
On 8/12/19 7:46 PM, Jeff Law wrote: On 8/12/19 12:43 PM, Aldy Hernandez wrote: This is a fresh re-post of: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg6.html Andrew gave me some feedback a week ago, and I obviously don't remember what it was because I was about to leave on PTO. 

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Marc Glisse
On Tue, 13 Aug 2019, Robin Dapp wrote: diff --git a/gcc/match.pd b/gcc/match.pd index 0317bc704f7..94400529ad8 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -2020,6 +2020,107 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (cst && !TREE_OVERFLOW (cst)) (plus { cst; } @0 +/* ((T)(A +

Re: [PATCH] fold more string comparison with known result (PR 90879)

2019-08-13 Thread Jeff Law
On 8/13/19 3:43 PM, Martin Sebor wrote: > On 8/13/19 2:07 PM, Jeff Law wrote: >> On 8/9/19 10:51 AM, Martin Sebor wrote: >>> >>> PR tree-optimization/90879 - fold zero-equality of strcmp between a >>> longer string and a smaller array >>> >>> gcc/c-family/ChangeLog: >>> >>> PR

Re: [PATCH] fold more string comparison with known result (PR 90879)

2019-08-13 Thread Martin Sebor
On 8/13/19 2:07 PM, Jeff Law wrote: On 8/9/19 10:51 AM, Martin Sebor wrote: PR tree-optimization/90879 - fold zero-equality of strcmp between a longer string and a smaller array gcc/c-family/ChangeLog: PR tree-optimization/90879 * c.opt (-Wstring-compare): New option.

[PATCH 3/3] [og9] Wait on queue-full condition in AMD GCN libgomp offloading plugin

2019-08-13 Thread Julian Brown
This patch lets the AMD GCN libgomp plugin wait for asynchronous queues to have some space to push new operations when they are full, rather than just erroring out immediately on that condition. This fixes the libgomp.oacc-c-c++-common/da-4.c test. Julian ChangeLog libgomp/ *

[PATCH 2/3] [og9] Use temporary buffers for async host2dev copies

2019-08-13 Thread Julian Brown
In libgomp, host-to-device transfers are instigated in several places where the source data is either on the stack, or in an unstable heap location (i.e. which is immediately freed after performing the host-to-device transfer). When the transfer is asynchronous, this means that taking the address

[PATCH 1/3] [og9] Wait at end of OpenACC asynchronous kernels regions

2019-08-13 Thread Julian Brown
This patch provides a workaround for unreliable operation of asynchronous kernels regions on AMD GCN. At present, kernels regions are decomposed into a series of parallel regions surrounded by a data region capturing the data-movement clauses needed by the region as a whole: #pragma acc kernels

[PATCH 0/3] [og9] OpenACC async fixes for AMD GCN

2019-08-13 Thread Julian Brown
These patches stabilise async support for AMD GCN. Several tests that previously failed (some intermittently) now work. Further commentary is provided alongside each patch. Tested with offloading to AMD GCN. I will apply shortly to the openacc-gcc-9-branch. Thanks, Julian Julian Brown (3):

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Jeff Law
On 8/13/19 2:42 PM, Robin Dapp wrote: >> +/* ((T)(A + CST1)) + CST2 -> (T)(A) + CST */ >> Do you want to handle MINUS? What about POINTER_PLUS_EXPR? > > When I last attempted this patch I had the MINUS still in it but got > confused easily by needing to think of too many cases at once leading

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Robin Dapp
> +/* ((T)(A + CST1)) + CST2 -> (T)(A) + CST */ > Do you want to handle MINUS? What about POINTER_PLUS_EXPR? When I last attempted this patch I had the MINUS still in it but got confused easily by needing to think of too many cases at once leading to lots of stupid mistakes. Hence, I left it

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Jeff Law
On 8/13/19 2:33 AM, Robin Dapp wrote: > We would like to simplify code like > (larger_type)(var + const1) + const2 > to > (larger_type)(var + combined_const1_const2) > when we know that no overflow happens. > --- > gcc/match.pd | 101 +++ > 1 file

Re: [PATCH 2/2] Add more entries to the C++ get_std_name_hint array

2019-08-13 Thread Jason Merrill
On 8/13/19 9:36 AM, Jonathan Wakely wrote: This adds some commonly-used C++11/14 names, and some new C++17/20 names. The latter aren't available when using the -std=gnu++14 default, so the fix-it suggesting to use a newer dialect is helpful. * name-lookup.c (get_std_name_hint): Add more

Re: [PATCH 1/2] PR c++/91436 fix C++ dialect for std::make_unique fix-it hint

2019-08-13 Thread Jason Merrill
On 8/13/19 9:32 AM, Jonathan Wakely wrote: * g++.dg/lookup/missing-std-include-6.C: Don't check make_unique in test that runs for C++11. I'm not comfortable removing this test coverage entirely. Doesn't it give a useful diagnostic in C++11 mode as well? Jason

Re: [PATCH] fold more string comparison with known result (PR 90879)

2019-08-13 Thread Jeff Law
On 8/9/19 10:51 AM, Martin Sebor wrote: > > PR tree-optimization/90879 - fold zero-equality of strcmp between a longer > string and a smaller array > > gcc/c-family/ChangeLog: > > PR tree-optimization/90879 > * c.opt (-Wstring-compare): New option. > > gcc/testsuite/ChangeLog: >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread H.J. Lu
On Tue, Aug 13, 2019 at 8:20 AM Jeff Law wrote: > > On 8/12/19 6:27 AM, Richard Biener wrote: > > On Fri, 9 Aug 2019, Uros Bizjak wrote: > > > >> On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: > >> > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI >

[Darwin, committed] There is no need to distinguish PIC/non-PIC symbol stubs.

2019-08-13 Thread Iain Sandoe
As per $SUBJECT, We can use a single flag for both pic and non-pic. Rename this now, before a confusing name gets into the wild. Other than the name, this is NFC. tested on i686/powerpc/x86-64 darwin, x86_64-linux-gnu, powerpc64-linux-gnu applied to mainline. thanks Iain gcc/ 2019-08-13 Iain

Re: [PATCH] PR fortran/89647 -- Allow host associated procedure to be a binding target

2019-08-13 Thread Steve Kargl
On Tue, Aug 13, 2019 at 09:52:01AM +0300, Janne Blomqvist wrote: > On Tue, Aug 13, 2019 at 1:32 AM Steve Kargl > wrote: > > > > The attached patch fixes PR fortran/89647, and has been > > regression tested on x86_64-*-freebsd. > > > > If a procedure is made accessible by host association, the > >

[patch, fortran, committed] Fix PR 90563, error while warning about do subscripts

2019-08-13 Thread Thomas Koenig
Hi, I just committed as simple and obvious the patch below. This fixes a 8/9/10 regression where a false positive with -Wdo-subscript (which we know about) was compounded by an also invalid error. Fixed by suppressing errors at the right time. I will also commit the patch to the other affected

Re: Use checking forms of DECL_FUNCTION_CODE (PR 91421)

2019-08-13 Thread Jeff Law
On 8/13/19 3:36 AM, Richard Sandiford wrote: > We were shoe-horning all built-in enumerations (including frontend > and target-specific ones) into a field of type built_in_function. This > was accessed as either an lvalue or an rvalue using DECL_FUNCTION_CODE. > > The obvious danger with this

Re: [PATCH] PR fortran/87993 -- An array can have a kind type inquiry suffix

2019-08-13 Thread Steve Kargl
On Tue, Aug 13, 2019 at 09:53:34AM +0300, Janne Blomqvist wrote: > On Tue, Aug 13, 2019 at 3:35 AM Steve Kargl > wrote: > > > > The attached patch ahs been regression tested on x86_64-*-freebsd. > > It probably borders on obvious, but I'll ask away. OK to commit? > > > > 2019-08-12 Steven G.

Re: Optimise constant IFN_WHILE_ULTs

2019-08-13 Thread Jeff Law
On 8/13/19 4:54 AM, Richard Sandiford wrote: > This patch is a combination of two changes that have to be committed as > a single unit, one target-independent and one target-specific: > > (1) Try to fold IFN_WHILE_ULTs with constant arguments to a VECTOR_CST > (which is always possible for

[PATCH, i386]: Add missing *mmx_pextrb and *mmx_pextr{b,w}_zext patterns

2019-08-13 Thread Uros Bizjak
We can implement these for TARGET_MMX_WITH_SSE (and TARGET_SSE4_1 in case of.pextrb). 2019-08-13 Uroš Bizjak * config/i386/i386.md (ix86_expand_vector_extract) : Use vec_extr path for TARGET_MMX_WITH_SSE && TARGET_SSE4_1. : Ditto. * config/i386/mmx.md (*mmx_pextrw_zext):

Re: [PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards

2019-08-13 Thread Rainer Orth
Hi Joseph, > However, I strongly encourage a followup to refactor this code > (*_CHECK_LINKER_FEATURES and *_ENABLE_SYMVERS that use it, not just the > fragment that determines the linker version number), which is evidently > duplicated far too much in different target library directories,

Re: [PATCH] Add generic support for "noinit" attribute

2019-08-13 Thread Christophe Lyon
Ping? On Tue, 30 Jul 2019 at 15:35, Christophe Lyon wrote: > > Hi, > > Thanks for the useful feedback. > > > On Tue, 16 Jul 2019 at 11:54, Richard Sandiford > wrote: > > > > Thanks for doing this in a generic way. > > > > Christophe Lyon writes: > > > @@ -2224,6 +2234,50 @@

Re: [PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards

2019-08-13 Thread Joseph Myers
On Thu, 4 Jul 2019, Chung-Lin Tang wrote: > Bringing back this issue, as this is still bothering our OpenACC toolchains. > > If the main variance in format was the 2007 ' ' to '.' change for non-release > binutils builds, then is the attached patch okay? > > What the patch does is to first look

Re: [PATCH] Add missing popcount simplifications (PR90693)

2019-08-13 Thread Andrew Pinski
On Tue, Aug 13, 2019 at 8:50 AM Wilco Dijkstra wrote: > > Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and > popcount (x) == 1 into (x-1) single-use cases and support an optional convert. A microbenchmark > shows a speedup of 2-2.5x on both x64 and AArch64. > > Bootstrap OK, OK

Re: [PATCH] Add missing popcount simplifications (PR90693)

2019-08-13 Thread Marc Glisse
On Tue, 13 Aug 2019, Wilco Dijkstra wrote: Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and popcount (x) == 1 into (x-1) Is that true even on targets that have a popcount instruction? (-mpopcnt for x64) diff --git a/gcc/match.pd b/gcc/match.pd index

[PATCH] Add missing popcount simplifications (PR90693)

2019-08-13 Thread Wilco Dijkstra
Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and popcount (x) == 1 into (x-1) gcc/ PR middle-end/90693 * match.pd: Add popcount simplifications. testsuite/ PR middle-end/90693 * gcc.dg/fold-popcount-5.c: Add new test. --- diff --git

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread Jeff Law
On 8/12/19 6:27 AM, Richard Biener wrote: > On Fri, 9 Aug 2019, Uros Bizjak wrote: > >> On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: >> (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI "TARGET_AVX512F"]) and then we need to

Re: [PATCH] Add --with-static-standard-libraries to the top level

2019-08-13 Thread Tom Tromey
Jonathan> What I don't understand is why GDB crashes. It should still be able to Jonathan> catch exceptions from a shared library even if linked to libstdc++.a, Jonathan> unless the static libstdc++.a is somehow incompatible with the shared Jonathan> libstdc++.so the shared lib linked to.

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread Jeff Law
On 8/9/19 7:00 AM, Richard Biener wrote: > On Fri, 9 Aug 2019, Richard Biener wrote: > >> On Fri, 9 Aug 2019, Richard Biener wrote: >> >>> On Fri, 9 Aug 2019, Uros Bizjak wrote: >>> On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: >> (define_mode_iterator MAXMIN_IMODE [SI

Re: [PATCH] Improve DSE to handle redundant zero initializations.

2019-08-13 Thread Matthew Beliveau
Hello, This should have the changes you all asked for! Let me know if I missed anything! Thank you, Matthew Beliveau On Tue, Aug 13, 2019 at 5:15 AM Richard Biener wrote: > > On Tue, Aug 13, 2019 at 10:18 AM Richard Sandiford > wrote: > > > > Thanks for doing this. > > > > Matthew Beliveau

Re: [PATCH, contrib]: Do not escape "=".

2019-08-13 Thread Jeff Law
On 8/13/19 2:55 AM, Uros Bizjak wrote: > Attached patch fixes the following gawk-5.0.1 warning: > > gawk: cmd. line:36: warning: regexp escape sequence `\=' is not a > known regexp operator > > 2019-08-13 Uros Bizjak > > * test_summary: Do not escape "=". > > Tested by building

Re: Protect some checks of DECL_FUNCTION_CODE

2019-08-13 Thread Jeff Law
On 8/13/19 3:34 AM, Richard Sandiford wrote: > This patch protects various uses of DECL_FUNCTION_CODE that didn't > obviously check for BUILT_IN_NORMAL first (either directly or in callers). > They could therefore trigger for functions that either aren't built-ins > or are a different kind of

Re: [PATCH] Improve documentation of target hooks for libc functions

2019-08-13 Thread Jeff Law
On 8/13/19 7:24 AM, Jonathan Wakely wrote: > * target.def (libc_has_function, libc_has_fast_function): Improve > documentation strings. > * doc/tm.texi: Regenerate. > > Bootstrapped x86_64-linux. > > OK for trunk? > > OK jeff

Re: [C++ Patch] Improve grok_array_decl location

2019-08-13 Thread Jason Merrill
On 8/13/19 5:22 AM, Paolo Carlini wrote: Hi, for this error message about the types involved in array subscripting I think we can exploit the available location argument and point to the open square bracket instead of simply using input_location. Tested x86_64-linux. Thanks, Paolo Carlini.

Re: C++ PATCH for c++/91416 - GC during late parsing collects live data

2019-08-13 Thread Jason Merrill
On 8/12/19 4:37 AM, Richard Biener wrote: On Sun, Aug 11, 2019 at 7:12 PM Marek Polacek wrote: This is a crash that points to a GC problem. Consider this test: __attribute__ ((unused)) struct S { S() { } } s; We're parsing a simple-declaration. While parsing the decl specs, we

Re: [PATCH 0/3] Libsanitizer: merge from trunk

2019-08-13 Thread Jeff Law
On 8/13/19 7:07 AM, Martin Liska wrote: > Hi. > > For this year, I decided to make a first merge now and the > next (much smaller) at the end of October. > > The biggest change is rename of many files from .cc to .cpp. > > I bootstrapped the patch set on x86_64-linux-gnu and run >

Re: C++ PATCH for more checking of DECL_MUTABLE_P

2019-08-13 Thread Jason Merrill
On 8/10/19 2:57 PM, Marek Polacek wrote: Some preparatory work before adding constinit. mutable is only appropriate for FIELD_DECLs (when they're not static), but we've never made sure that we're not setting DECL_MUTABLE_P on a different _DECL. I mean to use DECL_LANG_FLAG_0 in a VAR_DECL for

Re: [C++ Patch] Improve start_function and grokmethod locations

2019-08-13 Thread Jason Merrill
On 8/9/19 7:46 AM, Paolo Carlini wrote: + error_at (id_loc, + "typedef may not be a function definition"); We might use the location of the typedef keyword. OK either way. Jason

Re: C++ PATCH for c++/90473 - wrong code with nullptr in default argument

2019-08-13 Thread Jason Merrill
On 8/8/19 8:56 PM, Marek Polacek wrote: This is a wrong-code bug where we are throwing away the function call in the default argument here: void fn1 (void* p = (f(), nullptr)) { } and thus dropping the possible side-effects of that call to the floor. That happens because

Re: [PATCH][2/2][i386] STV changes, reg-copy as vector

2019-08-13 Thread Richard Biener
On Tue, 13 Aug 2019, Uros Bizjak wrote: > On Tue, Aug 13, 2019 at 2:33 PM Richard Biener wrote: > > > > > > The following splits out the change that makes the live-range split / > > mode change copy pseudos vector mode pseudos. I've tried reproducing > > the issue I faced with SImode chains but

Re: [PATCH][2/2][i386] STV changes, reg-copy as vector

2019-08-13 Thread Uros Bizjak
On Tue, Aug 13, 2019 at 2:33 PM Richard Biener wrote: > > > The following splits out the change that makes the live-range split / > mode change copy pseudos vector mode pseudos. I've tried reproducing > the issue I faced with SImode chains but failed likely because we're > never using simple

[PATCH] Update to MAINTAINERS

2019-08-13 Thread Mark Eggleston
I have added myself to the MAINTAINERS file. -- https://www.codethink.co.uk/privacy.html Index: MAINTAINERS === --- MAINTAINERS (revision 274379) +++ MAINTAINERS (working copy) @@ -371,6 +371,7 @@ Jason Eckhardt Bernd

Re: [patch, fortran] Fix PR 90561

2019-08-13 Thread Paul Richard Thomas
Hi Thomas, Yes that's good to apply to 9 and 10 branches. I am certain that there are other places where the new function will be very helpful. Thanks for the patch. Paul On Tue, 13 Aug 2019 at 13:59, Thomas König wrote: > > Hello world, > > this patch fixes a 9/10 regression by placing the

[PATCH 2/2] Add more entries to the C++ get_std_name_hint array

2019-08-13 Thread Jonathan Wakely
This adds some commonly-used C++11/14 names, and some new C++17/20 names. The latter aren't available when using the -std=gnu++14 default, so the fix-it suggesting to use a newer dialect is helpful. * name-lookup.c (get_std_name_hint): Add more entries. Tested x86_64-linux. OK for

[PATCH 1/2] PR c++/91436 fix C++ dialect for std::make_unique fix-it hint

2019-08-13 Thread Jonathan Wakely
The std::make_unique function wasn't added until C++14, and neither was the std::complex_literals namespace. gcc/cp: PR c++/91436 * name-lookup.c (get_std_name_hint): Fix min_dialect field for complex_literals and make_unique entries. gcc/testsuite: PR

[PATCH] Improve documentation of target hooks for libc functions

2019-08-13 Thread Jonathan Wakely
* target.def (libc_has_function, libc_has_fast_function): Improve documentation strings. * doc/tm.texi: Regenerate. Bootstrapped x86_64-linux. OK for trunk? commit c3645cae6c78896218c60135349056a5bf943b8a Author: Jonathan Wakely Date: Tue Aug 13 14:01:01 2019 +0100

[PATCH 0/3] Libsanitizer: merge from trunk

2019-08-13 Thread Martin Liska
Hi. For this year, I decided to make a first merge now and the next (much smaller) at the end of October. The biggest change is rename of many files from .cc to .cpp. I bootstrapped the patch set on x86_64-linux-gnu and run asan/ubsan/tsan tests on x86_64, ppc64le (power8) and aarch64. Libasan

[PATCH 2/3] Reapply all revisions mentioned in LOCAL_PATCHES.

2019-08-13 Thread Martin Liska
libsanitizer/ChangeLog: 2019-08-13 Martin Liska * asan/asan_globals.cpp (CheckODRViolationViaIndicator): Reapply patch from trunk. (CheckODRViolationViaPoisoning): Likewise. (RegisterGlobal): Likewise. * asan/asan_mapping.h: Likewise. *

[PATCH 3/3] Fix a test-case scan pattern.

2019-08-13 Thread Martin Liska
gcc/testsuite/ChangeLog: 2019-08-13 Martin Liska * c-c++-common/asan/memcmp-1.c: There's a new function in the stack-trace on the top. So shift expected output in stack trace. --- gcc/testsuite/c-c++-common/asan/memcmp-1.c | 4 ++-- 1 file changed, 2 insertions(+),

Re: [PATCH v3] Missed function specialization + partial devirtualization

2019-08-13 Thread Martin Liška
And I would also suggest to come up with parameter that will drive minimum probability, maximum number of promotions and maybe minimal number of edge executions to consider a speculation. Clang provides all these:

[patch, fortran] Fix PR 90561

2019-08-13 Thread Thomas König
Hello world, this patch fixes a 9/10 regression by placing the variable used to hold a string length at function scope. I chose to implement this version of gfc_evaluate_now as a separate function because I have a sneaking suspicion this may not be the last time we are going to encounter

Re: [PATCH v3] Missed function specialization + partial devirtualization

2019-08-13 Thread Martin Liška
On 7/31/19 7:29 AM, luoxhu wrote: > This patch aims to fix PR69678 caused by PGO indirect call profiling > performance issues. > The bug that profiling data is never working was fixed by Martin's pull > back of topN patches, performance got GEOMEAN ~1% improvement. > Still, currently the default

Re: [PATCH][testsuite] Fix PR91419

2019-08-13 Thread Hans-Peter Nilsson
> From: Richard Biener > Date: Tue, 13 Aug 2019 09:50:34 +0200 > 2019-08-13 Richard Biener > > PR testsuite/91419 > * lib/target-supports.exp (natural_alignment_32): Amend target > list based on BIGGEST_ALIGNMENT. > (natural_alignment_64): Targets not

[PATCH][2/2][i386] STV changes, reg-copy as vector

2019-08-13 Thread Richard Biener
The following splits out the change that makes the live-range split / mode change copy pseudos vector mode pseudos. I've tried reproducing the issue I faced with SImode chains but failed likely because we're never using simple moves in the end while for SImode we can end up with (set

[PATCH][1/2][i386] STV changes, DImode chain cost

2019-08-13 Thread Richard Biener
The following splits out the DImode chain cost changes from the patch adding SImode chain handling. There are two main parts: 1) fix REG_P (src) && REG_P (dst) costing which currently favors SSE because we use COSTS_N_INSNS based costs for GPR but move costs for SSE. 2) Use

Re: [PATCH] Come up with json::integer_number and use it in GCOV.

2019-08-13 Thread Martin Liška
On 8/2/19 2:40 PM, David Malcolm wrote: > Something that occurred to me reading the updated patch: maybe it would > make things easier to have utility member functions of json::object to > implicitly make the child, e.g.: > > void > json::object::set (const char *key, long v) > { >set (key,

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Robin Dapp
> I have become rather wary of INTEGRAL_TYPE_P recently because it > includes enum types, which with -fstrict-enum can have a surprising > behavior. If I have > enum E { A, B, C }; > and e has type enum E, with -fstrict-enum, do your tests manage to > prevent (long)e+1 from becoming (long)(e+1)

Re: [PATCH 1/3] Perform fold when propagating.

2019-08-13 Thread Robin Dapp
> May I suggest to add a parameter to the substitute-and-fold engine > so we can do the folding on all stmts only when enabled and enable > it just for VRP? That also avoids the testsuite noise. Would something along these lines do? diff --git a/gcc/tree-ssa-propagate.c

Re: [patch] handle casesi dispatch insns in create_trace_edges

2019-08-13 Thread Olivier Hainque
Hi Jeff, > On 12 Aug 2019, at 16:48, Jeff Law wrote: > I think part of the reason I settled on rtl.c was because we're not > really just looking at the form, not doing any real "analysis". BUt I > think either location for the implementation is fine. The reference to pc_rtx and to single_set

Re: [PATCH 2/3] C++20 constexpr lib part 2/3 - swappish functions.

2019-08-13 Thread Jonathan Wakely
On 01/08/19 13:16 -0400, Ed Smith-Rowland via libstdc++ wrote: Greetings, Here is a patch for C++20 p0879 - Constexpr for swap and swap related functions. This essentially constexprifies the rest of . Built and tested with C++20 (and pre-c++20) on x86_64-linux. Ok? Regards, Ed

Optimise constant IFN_WHILE_ULTs

2019-08-13 Thread Richard Sandiford
This patch is a combination of two changes that have to be committed as a single unit, one target-independent and one target-specific: (1) Try to fold IFN_WHILE_ULTs with constant arguments to a VECTOR_CST (which is always possible for fixed-length vectors but is not necessarily so for

[committed][AArch64] Improve SVE constant moves

2019-08-13 Thread Richard Sandiford
If there's no SVE instruction to load a given constant directly, this patch instead tries to use an Advanced SIMD constant move and then duplicates the constant to fill an SVE vector. The main use of this is to support constants in which each byte is in { 0, 0xff }. Also, the patch prefers a

Re: [PATCH] Add --with-static-standard-libraries to the top level

2019-08-13 Thread Jonathan Wakely
On 08/08/19 14:53 -0600, Jeff Law wrote: On 8/5/19 12:02 PM, Tom Tromey wrote: gdb should normally not be linked with -static-libstdc++. Currently this has not caused problems, but it's incompatible with catching an exception thrown from a shared library -- and a subsequent patch changes gdb

Re: [patch, fortran] Some corrections for DO loop index warnings

2019-08-13 Thread Thomas Koenig
Hi Steve, Ok. If it regression cleanly on gcc9, go ahead an commit there as well. Committed to both (after doing a regression test on gcc 9 and also waiting for gcc-testresults containing the revision). Thanks for the review!

[committed][AArch64] Use simd_immediate_info for SVE predicate constants

2019-08-13 Thread Richard Sandiford
This patch makes predicate constants use the normal simd_immediate_info machinery, rather than treating PFALSE and PTRUE as special cases. This makes it easier to add other types of predicate constant later. Tested on aarch64-linux-gnu (with and without SVE) and aarch64_be-elf. Applied as

[committed][AArch64] Make simd_immediate_info INDEX explicit

2019-08-13 Thread Richard Sandiford
This patch tweaks the representation of SVE INDEX instructions in simd_immediate_info so that it's easier to add new types of constant on top. Tested on aarch64-linux-gnu (with and without SVE) and aarch64_be-elf. Applied as r274371. Richard 2019-08-13 Richard Sandiford gcc/ *

Re: [PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Marc Glisse
On Tue, 13 Aug 2019, Robin Dapp wrote: +/* ((T)(A)) + CST -> (T)(A + CST) */ +#if GIMPLE + (simplify + (plus (convert SSA_NAME@0) INTEGER_CST@1) +(if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) + && INTEGRAL_TYPE_P (type) I have become rather wary of INTEGRAL_TYPE_P recently because it

Re: [MSP430][PATCH 2/2] Read MCU data from external file

2019-08-13 Thread Jozef Lawrynowicz
On Mon, 12 Aug 2019 14:34:39 -0600 Jeff Law wrote: > On 8/8/19 6:17 AM, Jozef Lawrynowicz wrote: > > This patch extends the MCU data handling so that MCU data can be provided > > in an external file (devices.csv). This means the compiler doesn't have to > > be > > updated and rebuilt to support

Re: [AArch64] Add a "y" constraint for V0-V7

2019-08-13 Thread Richard Sandiford
James Greenhalgh writes: > On Wed, Aug 07, 2019 at 07:19:12PM +0100, Richard Sandiford wrote: >> Some indexed SVE FCMLA operations have a 3-bit register field that >> requires one of Z0-Z7. This patch adds a public "y" constraint for that. >> >> The patch also documents "x", which is again

Use checking forms of DECL_FUNCTION_CODE (PR 91421)

2019-08-13 Thread Richard Sandiford
We were shoe-horning all built-in enumerations (including frontend and target-specific ones) into a field of type built_in_function. This was accessed as either an lvalue or an rvalue using DECL_FUNCTION_CODE. The obvious danger with this (as was noted by several ??? comments) is that the ranges

Protect some checks of DECL_FUNCTION_CODE

2019-08-13 Thread Richard Sandiford
This patch protects various uses of DECL_FUNCTION_CODE that didn't obviously check for BUILT_IN_NORMAL first (either directly or in callers). They could therefore trigger for functions that either aren't built-ins or are a different kind of built-in. Also, the patch removes a redundant

Re: [PATCH 1/3] Perform fold when propagating.

2019-08-13 Thread Richard Biener
On Tue, Aug 13, 2019 at 10:36 AM Robin Dapp wrote: > > This patch performs more aggressive folding in order for the > match.pd changes to kick in later. > > Some test cases rely on VRP doing something which now already > happens during CCP so adjust them accordingly. > > Also, the loop versioning

Re: [MSP430][PATCH 1/2] Consolidate handling of hard-coded MCU data

2019-08-13 Thread Jozef Lawrynowicz
On Mon, 12 Aug 2019 14:30:06 -0600 Jeff Law wrote: > On 8/8/19 6:14 AM, Jozef Lawrynowicz wrote: > > This patch improves the handling of MCU data by consolidating multiple > > copies of hard-coded MCU data into a single location, and adds a new > > function > > to be used as a single entry

[C++ Patch] Improve grok_array_decl location

2019-08-13 Thread Paolo Carlini
Hi, for this error message about the types involved in array subscripting I think we can exploit the available location argument and point to the open square bracket instead of simply using input_location. Tested x86_64-linux. Thanks, Paolo Carlini. /cp 2019-08-13

Re: [PATCH] Improve DSE to handle redundant zero initializations.

2019-08-13 Thread Richard Biener
On Tue, Aug 13, 2019 at 10:18 AM Richard Sandiford wrote: > > Thanks for doing this. > > Matthew Beliveau writes: > > diff --git gcc/tree-ssa-dse.c gcc/tree-ssa-dse.c > > index 5b7c4fc6d1a..dcaeb8edbfe 100644 > > --- gcc/tree-ssa-dse.c > > +++ gcc/tree-ssa-dse.c > > @@ -628,11 +628,8 @@

Re: [Patch v2] Enable math functions linking with static library for LTO

2019-08-13 Thread Richard Biener
On Tue, Aug 13, 2019 at 4:22 AM luoxhu wrote: > > Hi Richard, > > On 2019/8/12 16:51, Richard Biener wrote: > > On Mon, Aug 12, 2019 at 8:50 AM luoxhu wrote: > >> > >> Hi Richard, > >> Thanks for your comments, updated the v2 patch as below: > >> 1. Define and use builtin_with_linkage_p. > >> 2.

Re: [PATCH] PR fortran/91414: Improved PRNG

2019-08-13 Thread Janne Blomqvist
On Mon, Aug 12, 2019 at 11:23 PM Steve Kargl wrote: > > On Sun, Aug 11, 2019 at 12:37:49PM +0300, Janne Blomqvist wrote: > > Update the PRNG from xorshift1024* to xoshiro256** by the same > > author. For details see > > > > http://prng.di.unimi.it/ > > > > and the paper at > > > >

[PATCH, contrib]: Do not escape "=".

2019-08-13 Thread Uros Bizjak
Attached patch fixes the following gawk-5.0.1 warning: gawk: cmd. line:36: warning: regexp escape sequence `\=' is not a known regexp operator 2019-08-13 Uros Bizjak * test_summary: Do not escape "=". Tested by building mail-report.log with gawk-5.0.1 and gawk-4.2.1. OK for mainline?

[Ada] Do not remove side-effects in an others_clause with function calls

2019-08-13 Thread Pierre-Marie de Rodat
An aggregate can be handled by the backend if it consists of static constants of an elementary type, or null. If a component is a type conversion we must preanalyze and resolve it to determine whether the ultimate value is in one of these categories. Previously we did a full analysis and

[Ada] Legality rule on ancestors of type extensions in generic bodies

2019-08-13 Thread Pierre-Marie de Rodat
This patch adds an RM reference for the rule that in a generic body a type extension cannot have ancestors that are generic formal types. The patch also extends the check to interface progenitors that may appear in a derived type declaration or private extension declaration. Tested on

[PATCH 2/3] Add simplify rules for wrapped binary operations.

2019-08-13 Thread Robin Dapp
We would like to simplify code like (larger_type)(var + const1) + const2 to (larger_type)(var + combined_const1_const2) when we know that no overflow happens. --- gcc/match.pd | 101 +++ 1 file changed, 101 insertions(+) diff --git a/gcc/match.pd

[PATCH 3/3] Add new test cases for wrapped binop simplification.

2019-08-13 Thread Robin Dapp
--- .../gcc.dg/tree-ssa/copy-headers-5.c | 2 +- .../gcc.dg/tree-ssa/copy-headers-7.c | 2 +- .../gcc.dg/wrapped-binop-simplify-run.c | 52 .../gcc.dg/wrapped-binop-simplify-signed-1.c | 60 +++ .../wrapped-binop-simplify-unsigned-1.c

[Ada] Wrong dispatching call in type with aspect Implicit_Dereference

2019-08-13 Thread Pierre-Marie de Rodat
When a record type with an an access to class-wide type discriminant has aspect Implicit_Dereference, and the discriminant is used as the controlling argument of a dispatching call, the compiler may generate wrong code to dispatch the call. Tested on x86_64-pc-linux-gnu, committed on trunk

[PATCH 0/3] Simplify wrapped binops.

2019-08-13 Thread Robin Dapp
Hi, after a long time I remembered to dig out this patch again. It deals with simplifying additions wrapped inside a cast like (larger_type)(var + const1) + const2 to (larger_type)(var + combined_const1_const2). The original pattern is created quite frequently on S/390 (see PR 69526) and

[PATCH 1/3] Perform fold when propagating.

2019-08-13 Thread Robin Dapp
This patch performs more aggressive folding in order for the match.pd changes to kick in later. Some test cases rely on VRP doing something which now already happens during CCP so adjust them accordingly. Also, the loop versioning pass was missing one case when deconstructing addresses that

[Ada] Build full derivation for private concurrent type

2019-08-13 Thread Pierre-Marie de Rodat
This extends the processing done for the derivation of private discriminated types to concurrent types, which is now required because this derivation is no longer redone when a subtype of the derived concurrent type is built. This increases the number of entities generated internally in the

[Ada] Show Bit_Order and Scalar_Storage_Order in -gnatR4 output

2019-08-13 Thread Pierre-Marie de Rodat
This patch modifies the behavior of -gnatR4 so that representation information for bit and scalar storage order gets displayed in all cases and not just when defaults are overriden. -- Source -- -- pkg.ads package Pkg is type Root is tagged record Data0 :

[Ada] Add conformance check on actual subp. in instance of child unit

2019-08-13 Thread Pierre-Marie de Rodat
This patch properly diagnoses a conformance error between a formal subprogram and the corresponding actual, when the instance is that of a child unit that is instantiated as a compilation unit. The error is normally suppressed on an instantiation nested within another generic, given that analysis

[Ada] Implement pragma Max_Entry_Queue_Length

2019-08-13 Thread Pierre-Marie de Rodat
This patch implements AI12-0164-1 for the aspect/pragma Max_Entry_Queue_Length. Previously, the GNAT specific pragma Max_Queue_Length fulfilled this role, but was not named to match the standard and thus was insufficent. -- Source -- -- pass.ads with System; package

[Ada] Fix spurious instantiation error on private record type

2019-08-13 Thread Pierre-Marie de Rodat
This change was initially aimed at fixing a spurious instantiation error due to a disambiguation issue which happens when a generic unit with two formal type parameters is instantiated on a single actual type that is private. The compiler internally sets the Is_Generic_Actual_Type flag on the

[Ada] Small cleanup and improvement in inlining machinery

2019-08-13 Thread Pierre-Marie de Rodat
This is a small cleanup in the inlining machinery of the front-end dealing with back-end inlining. It should save a few cycles at -O0 by stopping it from doing useless work. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Eric Botcazou gcc/ada/

[Ada] Avoid crash in GNATprove_Mode on allocator inside type

2019-08-13 Thread Pierre-Marie de Rodat
In the special mode for GNATprove, subtypes should be declared for allocators when constraints are used. This was done previously but it does not work inside spec expressions, as the declaration is not inserted and analyzed in the AST in that case, leading to a later crash on an incomplete entity.

[Ada] Avoid spurious errors on dimensionality checking in GNATprove

2019-08-13 Thread Pierre-Marie de Rodat
Complete the partial treatment that was started in r273405. Instead of checking for the special case of nodes inside inlined bodies at the call site, check for this condition inside the top-level procedures called for dimensionality checking. There is no impact on compilation. Tested on

[Ada] Spurious error on nested instantiation

2019-08-13 Thread Pierre-Marie de Rodat
This fixes a spurious error given by the compiler for a call to a subprogram which is the formal subprogram parameter of a generic package, if the generic package is instantiated in the body of an enclosing generic package with two formal types and two formal subprogram parameter homonyms taking

[Ada] Avoid crash in GNATprove due to inlining inside type

2019-08-13 Thread Pierre-Marie de Rodat
The special inlining for GNATprove should not inline calls inside record types, used for the constraints of components. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-13 Yannick Moy gcc/ada/ * sem_res.adb (Resolve_Call): Do not inline

  1   2   >