Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Richard Biener
On Tue, 31 Jul 2018, Ian Lance Taylor wrote: > On Tue, Jul 31, 2018 at 9:19 AM, Bernd Edlinger > wrote: > > On 07/31/18 16:40, Ian Lance Taylor wrote: > >> On Tue, Jul 31, 2018 at 5:14 AM, Bernd Edlinger > >> wrote: > >>> > >>> could someone please review this patch and check it in into the GO F

[PATCH] Fix build with ISL 0.20

2018-08-01 Thread Richard Biener
The following fixes build with ISL 0.20, tested by building with ISL 0.20 and 0.15 (the oldest supported ISL). Applied to trunk, will commit to the branches as well. Richard. 2018-08-01 Richard Biener PR bootstrap/86724 * graphite.h: Include isl/id.h and isl/space.h to allo

Re: [PATCH] Make strlen range computations more conservative

2018-08-01 Thread Richard Biener
On Tue, 31 Jul 2018, Martin Sebor wrote: > On 07/31/2018 09:48 AM, Jakub Jelinek wrote: > > On Tue, Jul 31, 2018 at 09:17:52AM -0600, Martin Sebor wrote: > > > On 07/31/2018 12:38 AM, Jakub Jelinek wrote: > > > > On Mon, Jul 30, 2018 at 09:45:49PM -0600, Martin Sebor wrote: > > > > > Even without

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Bernd Edlinger
> The change to have all STRING_CSTs NUL terminated (but that NUL > termination not necessarily inclided in STRING_LENGTH) is a good > one. > > I'm not sure how we can reliably verify NUL termination after the > fact though and build_string already makes sure to NUL terminate > STRING_CSTs. So if

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Richard Biener
On Wed, 1 Aug 2018, Bernd Edlinger wrote: > > The change to have all STRING_CSTs NUL terminated (but that NUL > > termination not necessarily inclided in STRING_LENGTH) is a good > > one. > > > > I'm not sure how we can reliably verify NUL termination after the > > fact though and build_string al

Re: [PATCH] combine: Allow combining two insns to two insns

2018-08-01 Thread Christophe Lyon
On Tue, 31 Jul 2018 at 15:57, Segher Boessenkool wrote: > > Hi Christophe, > > On Tue, Jul 31, 2018 at 02:34:06PM +0200, Christophe Lyon wrote: > > Since this was committed, I've noticed regressions > > on aarch64: > > FAIL: gcc.dg/zero_bits_compound-1.c scan-assembler-not \\(and: > > This went fr

Re: [PATCH] Make strlen range computations more conservative

2018-08-01 Thread Jakub Jelinek
On Wed, Aug 01, 2018 at 09:19:43AM +0200, Richard Biener wrote: > > And if so, what makes it well defined? > > The fact that strlen takes a char * argument and thus inline-expansion > of a trivial implementation like > > int len = 0; > for (; *p; ++p) >++len; > > will have > > p = &s.a;

Re: [PATCH 01/11] Add __builtin_speculation_safe_value

2018-08-01 Thread Richard Earnshaw (lists)
On 31/07/18 21:51, Ian Lance Taylor via gcc-patches wrote: > On Tue, Jul 31, 2018 at 12:25 PM, H.J. Lu wrote: >> On Mon, Jul 30, 2018 at 6:16 AM, Richard Biener wrote: >>> On Fri, 27 Jul 2018, Richard Earnshaw wrote: >>> This patch defines a new intrinsic function __builtin_specula

Re: [PATCH 01/11] Add __builtin_speculation_safe_value

2018-08-01 Thread Jakub Jelinek
On Wed, Aug 01, 2018 at 09:48:50AM +0100, Richard Earnshaw (lists) wrote: > Sorry about that, I did run a full bootstrap on x86, but I had the x86 > mitigation patch applied, so it didn't trip this. Also, I see FAIL: c-c++-common/spec-barrier-1.c -Wc++-compat (test for excess errors) FAIL: c-c++

Re: [C++ PATCH] Implement P0595R1 - so far as __builtin_is_constant_evaluated rather than std::is_constant_evaluated magic builtin

2018-08-01 Thread Jakub Jelinek
On Wed, Aug 01, 2018 at 12:35:09AM +1000, Jason Merrill wrote: > On Mon, Jul 23, 2018 at 8:50 PM, Richard Biener > wrote: > > On Mon, Jul 23, 2018 at 12:28 PM Jakub Jelinek wrote: > >> > >> On Mon, Jul 23, 2018 at 12:17:42PM +0200, Richard Biener wrote: > >> > > Bootstrapped/regtested on x86_64-l

Re: [GCC][PATCH][Aarch64] Stop redundant zero-extension after UMOV when in DI mode

2018-08-01 Thread Sam Tebbs
On 07/31/2018 11:16 PM, James Greenhalgh wrote: On Thu, Jul 26, 2018 at 11:52:15AM -0500, Sam Tebbs wrote: Thanks for making the changes and adding more test cases. I do however see that you are only covering 2 out of 4 new *aarch64_get_lane_zero_extenddi<> patterns. The *aarch64_get_lane_

Fix over-widening handling of COND_EXPRs (PR 86749)

2018-08-01 Thread Richard Sandiford
This PR is a wrong-code bug caused by the over-widening support. The minimum input precisions for a COND_EXPR are supposed to apply only to the "then" and "else" values, but here we were applying them to the operands of a nested COND_EXPR comparison instead. Tested on aarch64-linux-gnu (with and w

Fix remove_stmt in vectorizable_simd_clone_call (PR 86758)

2018-08-01 Thread Richard Sandiford
vectorizable_simd_clone_call was trying to remove a pattern statement instead of the original statement, Fixes existing tests gcc.dg/pr84452.c and gcc.target/i386/pr84309.c on x86. This relies on a function added by: https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01825.html which can be applied in

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Bernd Edlinger
>> > The change to have all STRING_CSTs NUL terminated (but that NUL >> > termination not necessarily inclided in STRING_LENGTH) is a good >> > one. >> > >> > I'm not sure how we can reliably verify NUL termination after the >> > fact though and build_string already makes sure to NUL terminate >> >

Re: [PATCH 01/11] Add __builtin_speculation_safe_value

2018-08-01 Thread Richard Earnshaw (lists)
On 01/08/18 09:54, Jakub Jelinek wrote: > On Wed, Aug 01, 2018 at 09:48:50AM +0100, Richard Earnshaw (lists) wrote: >> Sorry about that, I did run a full bootstrap on x86, but I had the x86 >> mitigation patch applied, so it didn't trip this. > > Also, I see > FAIL: c-c++-common/spec-barrier-1.c

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Richard Biener
On Wed, 1 Aug 2018, Bernd Edlinger wrote: > >> > The change to have all STRING_CSTs NUL terminated (but that NUL > >> > termination not necessarily inclided in STRING_LENGTH) is a good > >> > one. > >> > > >> > I'm not sure how we can reliably verify NUL termination after the > >> > fact though an

Re: [PATCH] combine: Allow combining two insns to two insns

2018-08-01 Thread Segher Boessenkool
On Wed, Aug 01, 2018 at 10:27:31AM +0200, Christophe Lyon wrote: > On Tue, 31 Jul 2018 at 15:57, Segher Boessenkool > wrote: > > On Tue, Jul 31, 2018 at 02:34:06PM +0200, Christophe Lyon wrote: > > > Since this was committed, I've noticed regressions > > > on aarch64: > > > FAIL: gcc.dg/zero_bits_

[PATCH] Add memmove to value profiling (PR value-prof/35543).

2018-08-01 Thread Martin Liška
Hi. As requested in the PR, I would like to add value profiling for BUILT_IN_MEMMOVE. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Martin gcc/ChangeLog: 2018-07-31 Martin Liska PR value-prof/35543 * value-prof.c (interesting_

Re: [PATCH] Add memmove to value profiling (PR value-prof/35543).

2018-08-01 Thread Jan Hubicka
> Hi. > > As requested in the PR, I would like to add value profiling for > BUILT_IN_MEMMOVE. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Martin > > gcc/ChangeLog: > > 2018-07-31 Martin Liska > > PR value-prof/35543 >

[RFC][PATCH] Clean up of histogram allocation and release.

2018-08-01 Thread Martin Liška
Hi. Attempt of the patch is to remove all histograms right after "profile_estimate" pass. Then nobody should use them. That will simplify code we'll not need verification and currently we leaked some histograms till the end of compilation. Patch can bootstrap on x86_64-linux-gnu and survives regr

[PATCH] __gcov_indirect_call_callee can't be null in __gcov_indirect_call_profiler_v2.

2018-08-01 Thread Martin Liška
Hi. This one is forgotten removal as we call __gcov_indirect_call_profiler_v2 only in situations where __gcov_indirect_call_callee is non-null. I'm going to install that. libgcc/ChangeLog: 2018-07-31 Martin Liska * libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not

[PATCH] Improve dumping of value profiling transformations.

2018-08-01 Thread Martin Liška
Hi. This is format clean-up of value transformations that can happen. It makes it easier to grep them and find how many were actually applied. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Martin gcc/ChangeLog: 2018-07-31 Martin Liska

Re: [PATCH,nvptx] Use CUDA driver API to select default runtime launch, geometry

2018-08-01 Thread Tom de Vries
On 07/31/2018 04:58 PM, Cesar Philippidis wrote: > The attached patch teaches libgomp how to use the CUDA thread occupancy > calculator built into the CUDA driver. Despite both being based off the > CUDA thread occupancy spreadsheet distributed with CUDA, the built in > occupancy calculator differs

Re: [PATCH] Add memmove to value profiling (PR value-prof/35543).

2018-08-01 Thread Martin Liška
On 08/01/2018 12:14 PM, Jan Hubicka wrote: > OK, thanks! > We have other builtins that may fold into string function which we expand > internally (str variants comes to mind) perhaps they could be instrumented, > too. Sure, as mentioned here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35543#c5,

Re: [GCC][PATCH][Aarch64] Stop redundant zero-extension after UMOV when in DI mode

2018-08-01 Thread Sudakshina Das
Hi Sam On 01/08/18 10:12, Sam Tebbs wrote: On 07/31/2018 11:16 PM, James Greenhalgh wrote: On Thu, Jul 26, 2018 at 11:52:15AM -0500, Sam Tebbs wrote: Thanks for making the changes and adding more test cases. I do however see that you are only covering 2 out of 4 new *aarch64_get_lane_zero

Re: [PATCH] Improve dumping of value profiling transformations.

2018-08-01 Thread Jan Hubicka
> Hi. > > This is format clean-up of value transformations that can happen. > It makes it easier to grep them and find how many were actually > applied. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Martin > > gcc/ChangeLog: > > 2018-07

Re: Fold pointer range checks with equal spans

2018-08-01 Thread Richard Sandiford
Richard Biener writes: > On Mon, Jul 30, 2018 at 7:47 PM Richard Sandiford > wrote: >> >> [Sorry, somehow missed this till now] >> >> Richard Biener writes: >> > On Mon, Jul 23, 2018 at 5:05 PM Richard Sandiford >> > wrote: >> >> >> >> Marc Glisse writes: >> >> > On Fri, 20 Jul 2018, Richard S

Re: abstract remaining wide int operations in VRP

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 9:09 AM Aldy Hernandez wrote: > > ...well, most of them anyhow... > > I got tired of submitting these piecemeal, and it's probably easier to > review them in one go. > > There should be no difference in functionality, barring an extra call to > set_and_canonicalize_value_ra

Re: [PATCH][AARCH64] PR target/84521 Fix frame pointer corruption with -fomit-frame-pointer with __builtin_setjmp

2018-08-01 Thread Sudakshina Das
Hi On 31/07/18 22:48, Andrew Pinski wrote: On Tue, Jul 31, 2018 at 2:43 PM James Greenhalgh wrote: On Thu, Jul 12, 2018 at 12:01:09PM -0500, Sudakshina Das wrote: Hi Eric On 27/06/18 12:22, Wilco Dijkstra wrote: Eric Botcazou wrote: This test can easily be changed not to use optimize sin

[PATCH, testsuite]: Fix PR 86153, test case g++.dg/pr83239.C fails

2018-08-01 Thread Uros Bizjak
Hello! The testcase fails with: FAIL: g++.dg/pr83239.C -std=gnu++11 scan-tree-dump-not optimized "_ZNSt6vectorIiSaIiEE17_M_default_appendEm" FAIL: g++.dg/pr83239.C -std=gnu++14 scan-tree-dump-not optimized "_ZNSt6vectorIiSaIiEE17_M_default_appendEm" the test depends on _M_default_append to b

[C++ Patch] PR 59480 ("Missing error diagnostic: friend declaration specifying a default argument must be a definition")​ (Take 2)

2018-08-01 Thread Paolo Carlini
Hi, thus, as you may or may not have noticed I reverted my first try, when Tobias noticed that in his large codebase we were rejecting code like: class Matrix; Matrix rot90 (const Matrix& a, int k = 1); class Matrix {   friend Matrix rot90 (const Matrix&, int); }; Matrix rot90 (const Matrix

Re: [PATCH] Make function clone name numbering independent.

2018-08-01 Thread Richard Biener
On Tue, Jul 31, 2018 at 7:40 PM Michael Ploujnikov wrote: > > On 2018-07-26 01:27 PM, Michael Ploujnikov wrote: > > On 2018-07-24 09:57 AM, Michael Ploujnikov wrote: > >> On 2018-07-20 06:05 AM, Richard Biener wrote: > /* Return a new assembler name for a clone with SUFFIX of a decl named >

Re: [PATCH] combine: Allow combining two insns to two insns

2018-08-01 Thread Christophe Lyon
On Wed, 1 Aug 2018 at 11:40, Segher Boessenkool wrote: > > On Wed, Aug 01, 2018 at 10:27:31AM +0200, Christophe Lyon wrote: > > On Tue, 31 Jul 2018 at 15:57, Segher Boessenkool > > wrote: > > > On Tue, Jul 31, 2018 at 02:34:06PM +0200, Christophe Lyon wrote: > > > > Since this was committed, I've

Re: Fold pointer range checks with equal spans

2018-08-01 Thread Richard Sandiford
Marc Glisse writes: > On Tue, 31 Jul 2018, Richard Biener wrote: > Also, when @2 == @0 + (@1+1) then the original condition is true but ((sizetype) @0 - (sizetype) @2 + @1) > (@1 * 2) is not? (sizetype) @0 - (sizetype) (@0 + @1 + 1) + @1 > @1 * 2 -> -1 > @1 * 2 whi

Re: [PATCH,nvptx] Remove use of 'struct map' from plugin (nvptx)

2018-08-01 Thread Tom de Vries
On 07/31/2018 05:12 PM, Cesar Philippidis wrote: > This is an old patch which removes the struct map from the nvptx plugin. > I believe at one point this was supposed to be used to manage async data > mappings, but in practice that never worked out. I don't quite understand what rationale you're t

Re: [PATCH] Fix target clones (PR gcov-profile/85370).

2018-08-01 Thread Martin Liška
On 07/26/2018 11:00 AM, Richard Biener wrote: > On Thu, Jul 26, 2018 at 10:44 AM Martin Liška wrote: >> >> On 07/25/2018 03:50 PM, Richard Biener wrote: >>> On Wed, Jul 25, 2018 at 3:38 PM Martin Liška wrote: Hi. Target clones have DECL_ARTIFICIAL set to 1, but we want to

Re: [PATCH] Add malloc predictor (PR middle-end/83023).

2018-08-01 Thread Martin Liška
On 07/27/2018 02:38 PM, Marc Glisse wrote: > On Fri, 27 Jul 2018, Martin Liška wrote: > >> So answer is yes, the builtin can be then removed. > > Good, thanks. While looking at how widely it is going to apply, I noticed > that the default, throwing operator new has attribute malloc and everythin

Re: [PATCH,nvptx] Remove use of CUDA unified memory in libgomp

2018-08-01 Thread Tom de Vries
On 07/31/2018 05:27 PM, Cesar Philippidis wrote: > At present, libgomp is using CUDA unified memory only as a buffer pass > to the struct containing the pointers to the data mappings to the > offloaded functions. I'm not sure why unified memory is needed here if > it is still being managed explicit

[PATCH, testsuite]: Xfail pr84512.c on alpha*-*-*.

2018-08-01 Thread Uros Bizjak
2018-08-01 Uros Bizjak * gcc.dg/tree-ssa/pr84512.c: Xfail on alpha*-*-*. Tested on alphaev68-linux-gnu, committed to mainline SVN. Uros. Index: gcc.dg/tree-ssa/pr84512.c === --- gcc.dg/tree-ssa/pr84512.c (revision 263193)

[PATCH] Handle overlength strings in the C FE

2018-08-01 Thread Bernd Edlinger
On 07/30/18 17:49, Joseph Myers wrote: > On Mon, 30 Jul 2018, Bernd Edlinger wrote: > >> Hi, >> >> this is how I would like to handle the over length strings issue in the C FE. >> If the string constant is exactly the right length and ends in one explicit >> NUL character, shorten it by one charac

[PATCH] Handle overlength strings in C++ FE

2018-08-01 Thread Bernd Edlinger
Hi, this makes too long string constants shorter, and fixes one place where a string constant is created non-zero terminated. This is a cleanup in preparation of a more thorough check on the STRING_CST objects in the middle-end. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for tr

Re: [PATCH] Add malloc predictor (PR middle-end/83023).

2018-08-01 Thread Martin Liška
On 07/27/2018 02:38 PM, Marc Glisse wrote: > On Fri, 27 Jul 2018, Martin Liška wrote: > >> So answer is yes, the builtin can be then removed. > > Good, thanks. While looking at how widely it is going to apply, I noticed > that the default, throwing operator new has attribute malloc and everythin

Re: [PATCH] Add malloc predictor (PR middle-end/83023).

2018-08-01 Thread Martin Liška
On 07/31/2018 11:25 AM, Jan Hubicka wrote: >> Hi. >> >> Following patch implements new predictors that annotates malloc-like >> functions. >> These almost every time return a non-null value. >> >> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. >> >> Ready to be installe

[PATCH] Create internally nul terminated string literals in fortan FE

2018-08-01 Thread Bernd Edlinger
Hi, this patch changes the Fortan FE to create NUL terminated STRING_CST objects. This is a cleanup in preparation of a more thorough check on the STRING_CST objects in the middle-end. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. 2018-08-01 Bernd Edli

Re: [PATCH,nvptx] Truncate config/nvptx/oacc-parallel.c

2018-08-01 Thread Tom de Vries
On 07/31/2018 05:55 PM, Cesar Philippidis wrote: > Way back in the GCC 5 days when support for OpenACC was in its infancy, > we used to rely on having various GOACC_ thread functions in the runtime > to implement the execution model, or there lack of (that version of GCC > only supported vector lev

[PATCH] Check the STRING_CSTs in varasm.c

2018-08-01 Thread Bernd Edlinger
Hi, this completes the previous patches, and adds a check in varasm.c that ensures that all string constants are NUL terminated, And that varasm does not strip anything but _exactly_ one NUL character. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. 2018-08

Re: [PATCH][AArch64] Implement new intrinsics vabsd_s64 and vnegd_s64

2018-08-01 Thread Kyrill Tkachov
On 31/07/18 22:48, James Greenhalgh wrote: On Fri, Jul 20, 2018 at 04:37:34AM -0500, Vlad Lazar wrote: > Hi, > > The patch adds implementations for the NEON intrinsics vabsd_s64 and vnegd_s64. > (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ihi0073/latest/ar

Re: [PATCH,nvptx] Truncate config/nvptx/oacc-parallel.c

2018-08-01 Thread Jakub Jelinek
On Wed, Aug 01, 2018 at 01:33:09PM +0200, Tom de Vries wrote: > On 07/31/2018 05:55 PM, Cesar Philippidis wrote: > > Way back in the GCC 5 days when support for OpenACC was in its infancy, > > we used to rely on having various GOACC_ thread functions in the runtime > > to implement the execution mo

Re: Fix over-widening handling of COND_EXPRs (PR 86749)

2018-08-01 Thread Richard Biener
On Wed, Aug 1, 2018 at 11:16 AM Richard Sandiford wrote: > > This PR is a wrong-code bug caused by the over-widening support. > The minimum input precisions for a COND_EXPR are supposed to apply > only to the "then" and "else" values, but here we were applying > them to the operands of a nested CO

Re: Fix remove_stmt in vectorizable_simd_clone_call (PR 86758)

2018-08-01 Thread Richard Biener
On Wed, Aug 1, 2018 at 11:20 AM Richard Sandiford wrote: > > vectorizable_simd_clone_call was trying to remove a pattern statement > instead of the original statement, Fixes existing tests > gcc.dg/pr84452.c and gcc.target/i386/pr84309.c on x86. > > This relies on a function added by: > https://g

Re: Fold pointer range checks with equal spans

2018-08-01 Thread Richard Biener
On Wed, Aug 1, 2018 at 12:25 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Mon, Jul 30, 2018 at 7:47 PM Richard Sandiford > > wrote: > >> > >> [Sorry, somehow missed this till now] > >> > >> Richard Biener writes: > >> > On Mon, Jul 23, 2018 at 5:05 PM Richard Sandiford > >> >

[PATCH, testsuite]: Use -O0 for gcc.dg/plugin/poly-int-07_plugin.c ...

2018-08-01 Thread Uros Bizjak
... as is the case with all other gcc.dg/plugin/poly-int-0{1,2,3,4,5,6}_plugin.c testcases. This lowers testcase wall time from 4min 45 sec to 1min 17sec on a slow target. 2018-08-01 Uros Bizjak * gcc.dg/plugin/poly-int-07_plugin.c (dg-options): Use -O0. Tested on alphaev68-linux-gnu, com

[PATCH] Improve address CSE

2018-08-01 Thread Richard Biener
This removes an odd CSE failure of invariant addresses vs. non-invariant ones. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2018-08-01 Richard Biener * tree-ssa-sccvn.c (visit_phi): Compare invariant addresses as base and offset.

[C++ Patch, obvious] PR 86661

2018-08-01 Thread Paolo Carlini
Hi, when I lately changed a couple of permerrors to permerror + warning and accurate location for the first call, I went for the simple choice of using DECL_SOURCE_LOCATION for the first call and keeping location_of in the second call. Turns out we consistently want location_of for both, beca

Re: [Patch][Aarch64] Implement Aarch64 SIMD ABI and aarch64_vector_pcs attribute

2018-08-01 Thread Kyrill Tkachov
Hi Steve, On 31/07/18 23:24, Steve Ellcey wrote: Here is a new version of my patch to support the Aarch64 SIMD ABI [1] in GCC. I think this is complete enought to be considered for check in. I wrote a few new tests and put them in a new gcc.target/torture directory so they would be run with mu

Re: [PATCH][AArch64] Implement new intrinsics vabsd_s64 and vnegd_s64

2018-08-01 Thread Vlad Lazar
On 31/07/18 22:48, James Greenhalgh wrote: On Fri, Jul 20, 2018 at 04:37:34AM -0500, Vlad Lazar wrote: Hi, The patch adds implementations for the NEON intrinsics vabsd_s64 and vnegd_s64. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ihi0073/latest/arm-neon-int

Re: Fold pointer range checks with equal spans

2018-08-01 Thread Marc Glisse
On Wed, 1 Aug 2018, Richard Sandiford wrote: +/* For pointers @0 and @2 and nonnegative constant offset @1, look for + expressions like: + + A: (@0 + @1 < @2) | (@2 + @1 < @0) + B: (@0 + @1 <= @2) | (@2 + @1 <= @0) Once this is in, we may want to consider the opposite: (@0 + @1 > @2) &

Re: [PATCH] Introduce __builtin_expect_with_probability (PR target/83610).

2018-08-01 Thread Martin Liška
On 07/31/2018 11:24 AM, Jan Hubicka wrote: >> Hi. >> >> This is implementation of new built-in that can be used for more fine >> tweaking of probability. Micro benchmark is attached as part of the PR. >> >> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. >> >> Ready to be

Re: [PATCH] Add malloc predictor (PR middle-end/83023).

2018-08-01 Thread Marc Glisse
On Wed, 1 Aug 2018, Martin Liška wrote: On 07/27/2018 02:38 PM, Marc Glisse wrote: On Fri, 27 Jul 2018, Martin Liška wrote: So answer is yes, the builtin can be then removed. Good, thanks. While looking at how widely it is going to apply, I noticed that the default, throwing operator new h

Re: [PATCH,nvptx] Truncate config/nvptx/oacc-parallel.c

2018-08-01 Thread Tom de Vries
On 08/01/2018 01:55 PM, Jakub Jelinek wrote: > On Wed, Aug 01, 2018 at 01:33:09PM +0200, Tom de Vries wrote: >> On 07/31/2018 05:55 PM, Cesar Philippidis wrote: >>> Way back in the GCC 5 days when support for OpenACC was in its infancy, >>> we used to rely on having various GOACC_ thread functions

Re: [PATCH] Add malloc predictor (PR middle-end/83023).

2018-08-01 Thread Martin Liška
On 08/01/2018 02:25 PM, Marc Glisse wrote: > On Wed, 1 Aug 2018, Martin Liška wrote: > >> On 07/27/2018 02:38 PM, Marc Glisse wrote: >>> On Fri, 27 Jul 2018, Martin Liška wrote: >>> So answer is yes, the builtin can be then removed. >>> >>> Good, thanks. While looking at how widely it is goin

Re: [01/11] Schedule SLP earlier

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:37 PM Richard Sandiford wrote: > > vect_transform_loop used to call vect_schedule_slp lazily when it > came across the first SLP statement, but it seems easier to do it > before the main loop. Indeed. OK. Richard. > > 2018-07-30 Richard Sandiford > > gcc/ >

Re: [02/11] Remove vect_schedule_slp return value

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:37 PM Richard Sandiford wrote: > > Nothing now uses the vect_schedule_slp return value, so it's not worth > propagating the value through vect_schedule_slp_instance. OK. > > 2018-07-30 Richard Sandiford > > gcc/ > * tree-vectorizer.h (vect_schedule_slp): Retu

Re: [03/11] Remove vect_transform_stmt grouped_store argument

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:38 PM Richard Sandiford wrote: > > Nothing now uses the grouped_store value passed back by > vect_transform_stmt, so we might as well remove it. OK. > > 2018-07-30 Richard Sandiford > > gcc/ > * tree-vectorizer.h (vect_transform_stmt): Remove grouped_store >

Re: [04/11] Add a vect_orig_stmt helper function

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:38 PM Richard Sandiford wrote: > > This patch just adds a helper function for going from a potential > pattern statement to the original scalar statement. OK. Richard. > > 2018-07-30 Richard Sandiford > > gcc/ > * tree-vectorizer.h (vect_orig_stmt): New func

Re: [05/11] Add a vect_stmt_to_vectorize helper function

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:39 PM Richard Sandiford wrote: > > This patch adds a helper that does the opposite of vect_orig_stmt: > go from the original scalar statement to the statement that should > actually be vectorised. > > The use in the last two hunks of vectorizable_reduction are because > r

Re: [06/11] Handle VMAT_INVARIANT separately

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:41 PM Richard Sandiford wrote: > > Invariant loads were handled as a variation on the code for contiguous > loads. We detected whether they were invariant or not as a byproduct of > creating the vector pointer ivs: vect_create_data_ref_ptr passed back an > inv_p to say w

Re: [07/11] Use single basic block array in loop_vec_info

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:42 PM Richard Sandiford wrote: > > _loop_vec_info::_loop_vec_info used get_loop_array to get the > order of the blocks when creating stmt_vec_infos, but then used > dfs_enumerate_from to get the order of the blocks that the rest > of the vectoriser uses. We should be abl

Re: C++ PATCH for c++/57891, narrowing conversions in non-type template arguments

2018-08-01 Thread Marek Polacek
Ping. On Mon, Jul 23, 2018 at 04:49:12PM -0400, Marek Polacek wrote: > On Tue, Jul 03, 2018 at 04:27:33PM -0400, Jason Merrill wrote: > > On Tue, Jul 3, 2018 at 3:41 PM, Jason Merrill wrote: > > > On Tue, Jul 3, 2018 at 2:58 PM, Marek Polacek wrote: > > >> On Tue, Jul 03, 2018 at 12:40:51PM -040

Re: [08/11] Make hoist_defs_of_uses use vec_info::lookup_def

2018-08-01 Thread Richard Biener
On Mon, Jul 30, 2018 at 1:43 PM Richard Sandiford wrote: > > This patch makes hoist_defs_of_uses use vec_info::lookup_def instead of: > > if (!gimple_nop_p (def_stmt) > && flow_bb_inside_loop_p (loop, gimple_bb (def_stmt))) > > to test whether a feeding scalar statement needs to be

Re: [PATCH] Make GO string literals properly NUL terminated

2018-08-01 Thread Bernd Edlinger
On 08/01/18 11:29, Richard Biener wrote: > > Hmm. I think it would be nice if TREE_STRING_LENGTH would > match char[2] and TYPE_SIZE_UNIT even if that is inconvenient > for your check above. Because the '\0' doesn't belong to the > string. Then build_string internally appends a '\0' outside >

[PATCHv3 0/6] std::future::wait_* improvements

2018-08-01 Thread Mike Crowe
v2 of this series was originally posted back in January (see https://gcc.gnu.org/ml/libstdc++/2018-01/msg00035.html ) Apart from minor log message tweaks, the changes since that version are: * [1/6] Improve libstdc++-v3 async test Speed up the tests at the risk of more sporadic failures on loa

[PATCHv3 4/6] libstdc++ atomic_futex: Use std::chrono::steady_clock as reference clock

2018-08-01 Thread Mike Crowe
The user-visible effect of this change is that std::future::wait_for now uses std::chrono::steady_clock to determine the timeout. This makes it immune to changes made to the system clock. It also means that anyone using their own clock types with std::future::wait_until will have the timeout conver

[PATCHv3 6/6] Extra async tests, not for merging

2018-08-01 Thread Mike Crowe
These tests show that changing the system clock has an effect on std::future::wait_until when using std::chrono::system_clock but not when using std::chrono::steady_clock. Unfortunately these tests have a number of downsides: 1. Nothing that is attempting to keep the clock set correctly (ntpd,

[PATCHv3 5/6] libstdc++ futex: Loop when waiting against arbitrary clock

2018-08-01 Thread Mike Crowe
If std::future::wait_until is passed a time point measured against a clock that is neither std::chrono::steady_clock nor std::chrono::system_clock then the generic implementation of __atomic_futex_unsigned::_M_load_when_equal_until is called which calculates the timeout based on __clock_t and calls

[PATCHv3 3/6] libstdc++ futex: Support waiting on std::chrono::steady_clock directly

2018-08-01 Thread Mike Crowe
The user-visible effect of this change is for std::future::wait_until to use CLOCK_MONOTONIC when passed a timeout of std::chrono::steady_clock type. This makes it immune to any changes made to the system clock CLOCK_REALTIME. Add an overload of __atomic_futex_unsigned::_M_load_and_text_until_impl

[PATCHv3 2/6] libstdc++ futex: Use FUTEX_CLOCK_REALTIME for wait

2018-08-01 Thread Mike Crowe
The futex system call supports waiting for an absolute time if FUTEX_WAIT_BITSET is used rather than FUTEX_WAIT. Doing so provides two benefits: 1. The call to gettimeofday is not required in order to calculate a relative timeout. 2. If someone changes the system clock during the wait then the

[PATCHv3 1/6] Improve libstdc++-v3 async test

2018-08-01 Thread Mike Crowe
Add tests for waiting for the future using both std::chrono::steady_clock and std::chrono::system_clock in preparation for dealing with those clocks properly in futex.cc. --- libstdc++-v3/testsuite/30_threads/async/async.cc | 33 1 file changed, 33 insertions(+) diff --gi

Re: [PATCH,nvptx] Remove use of 'struct map' from plugin (nvptx)

2018-08-01 Thread Cesar Philippidis
On 08/01/2018 04:01 AM, Tom de Vries wrote: > On 07/31/2018 05:12 PM, Cesar Philippidis wrote: >> This is an old patch which removes the struct map from the nvptx plugin. >> I believe at one point this was supposed to be used to manage async data >> mappings, but in practice that never worked out.

Re: [PATCH,nvptx] Remove use of 'struct map' from plugin (nvptx)

2018-08-01 Thread Tom de Vries
On 08/01/2018 03:43 PM, Cesar Philippidis wrote: > On 08/01/2018 04:01 AM, Tom de Vries wrote: >> On 07/31/2018 05:12 PM, Cesar Philippidis wrote: >>> This is an old patch which removes the struct map from the nvptx plugin. >>> I believe at one point this was supposed to be used to manage async dat

[libgomp, nvptx, committed] Add cuda-lib.def

2018-08-01 Thread Tom de Vries
Hi, This factors out the cuda library calls list into a seperate .def file. Build and reg-tested on x86_64 with nvptx accelerator. Committed. Thanks, - Tom [libgomp, nvptx] Add cuda-lib.def 2018-08-01 Tom de Vries * plugin/cuda-lib.def: New file. Factor out of ... * plugi

[nvptx, committed] Define TARGET_HAVE_SPECULATION_SAFE_VALUE

2018-08-01 Thread Tom de Vries
Hi, this defines new target hook TARGET_HAVE_SPECULATION_SAFE_VALUE for nvptx. Since AFAIK nvidia claims the related security issue does not exist on their video hardware, we set it to speculation_safe_value_not_needed. Build and reg-tested on x86_64 with nvptx accelerator. Committed. Thanks, -

Re: [PATCH] Print default options selection for -march,-mcpu and -mtune for aarch64 (PR driver/83193).

2018-08-01 Thread Martin Liška
PING^1 On 07/18/2018 05:48 PM, Martin Liška wrote: > Hi. > > This is aarch64 fix for PR83193. It's about setting of default options > so that --help=target -Q prints proper numbers: > > Now this is seen on my cross-compiler: > > --- /home/marxin/Downloads/options-2-before.txt 2018-07-18

Re: [PATCH] Provide extension hint for aarch64 target (PR driver/83193).

2018-08-01 Thread Martin Liška
PING^1 On 07/18/2018 05:49 PM, Martin Liška wrote: > Hi. > > This patch improves aarch64 feature modifier hints. > > May I please ask ARM folks to test the patch? > Thanks, > Martin > > gcc/ChangeLog: > > 2018-07-18 Martin Liska > > PR driver/83193 > * common/config/aarch64/a

[PATCH] PR libstdc++/60555 std::system_category() should recognise POSIX errno values

2018-08-01 Thread Jonathan Wakely
PR libstdc++/60555 * src/c++11/system_error.cc (system_error_category::default_error_condition): New override to check for POSIX errno values. * testsuite/19_diagnostics/error_category/generic_category.cc: New * testsuite/19_diagnostics/error_categor

Re: [PATCH,nvptx] Use CUDA driver API to select default runtime launch, geometry

2018-08-01 Thread Cesar Philippidis
On 08/01/2018 03:18 AM, Tom de Vries wrote: > On 07/31/2018 04:58 PM, Cesar Philippidis wrote: >> The attached patch teaches libgomp how to use the CUDA thread occupancy >> calculator built into the CUDA driver. Despite both being based off the >> CUDA thread occupancy spreadsheet distributed with

Re: [ARM/FDPIC v2 00/21] FDPIC ABI for ARM

2018-08-01 Thread Christophe Lyon
Ping? On 13/07/2018 18:10, christophe.l...@st.com wrote: From: Christophe Lyon Hello, This patch series implements the GCC contribution of the FDPIC ABI for ARM targets. This ABI enables to run Linux on ARM MMU-less cores and supports shared libraries to reduce the memory footprint. Withou

Re: [PATCH,nvptx] Use CUDA driver API to select default runtime launch, geometry

2018-08-01 Thread Tom de Vries
On 08/01/2018 04:01 PM, Cesar Philippidis wrote: > On 08/01/2018 03:18 AM, Tom de Vries wrote: >> On 07/31/2018 04:58 PM, Cesar Philippidis wrote: >>> The attached patch teaches libgomp how to use the CUDA thread occupancy >>> calculator built into the CUDA driver. Despite both being based off the

[gomp5] Parse task modifier of reduction clauses

2018-08-01 Thread Jakub Jelinek
Hi! This patch adds just the parsing and diagnostics of task reduction modifier. Such reductions behave then differently, like task_reduction clause on taskgroup construct when used on parallel or for/sections. Tested on x86_64-linux, committed to gomp-5_0-branch. 2018-08-01 Jakub Jelinek

Re: PING [PATCH] warn for strlen of arrays with missing nul (PR 86552)

2018-08-01 Thread Bernd Edlinger
On 07/31/18 05:51, Martin Sebor wrote: > On 07/30/2018 03:11 PM, Bernd Edlinger wrote: >> Hi, >> >>> @@ -621,6 +674,12 @@ c_strlen (tree src, int only_value) >>> maxelts = maxelts / eltsize - 1; >>>   } >>> >>> +  /* Unless the caller is prepared to handle it by passing in a non-null >>> + 

Re: [PATCH] Avoid infinite loop with duplicate anonymous union fields

2018-08-01 Thread Bogdan Harjoc
On Wed, Aug 1, 2018 at 1:20 AM, Joseph Myers wrote: > On Wed, 1 Aug 2018, Bogdan Harjoc wrote: > >> So array[0] < component < array[2], which loops (I removed the gdb p >> commands for field_array[1] and so on). > > Is the key thing here that you end up with DECL_NAME (field) == NULL_TREE, > but D

[PATCH][0/4][RFC] RPO style value-numbering

2018-08-01 Thread Richard Biener
This rewrites the value-numbering algorithm used for FRE and PRE from SSA SCC based to RPO based, thus switching from an algorithm that handles SSA SCCs optimistically to one that handles CFG SCCs optimistically. The main motivation for this besides being more optimistic was that adding CFG con

[PATCH][1/4] Add dynamic CFG flag allocation

2018-08-01 Thread Richard Biener
I've posted this previously and didn't change it, the discussion went down bikeshedding on C++. * cfg.h (struct control_flow_graph): Add edge_flags_allocated and bb_flags_allocated members. (auto_flag): New RAII class for allocating flags. (auto_edge_flag): New RA

Re: [0/5] C-SKY port

2018-08-01 Thread 瞿仙淼
>>> We expect that >>> C-SKY will also be providing a public link to the processor and ABI >>> documentation at some point. >> >> The ABI manual has been posted, but not the ISA documentation yet. (I'd >> guess >> that when it does show up it will be in the same place, though.) >> >> https://

[PATCH][2/4] Add rev_post_order_and_mark_dfs_back_seme

2018-08-01 Thread Richard Biener
This adds RPO finding on SEME regions, marking backedges in the region on-the-fly. RPO value-numbering uses this first and foremost in region mode but also for whole-function since it has a way to visit non-loop-exit edges first leading to a more local iteration order. 2018-07-04 Richard Biene

[PATCH][3/4] Use RPO VN from unrolling

2018-08-01 Thread Richard Biener
This should be 4/4 but I have the main patch on top, so... This uses the region-based VN from GIMPLE unrolling which means we better approximate the effects optimizations on unrolled inner loops when evaluating whether to unroll outer ones. * tree-ssa-loop-ivcanon.c: Include tree-ssa-sc

Re: [PATCH] change %G argument from gcall* to gimple*

2018-08-01 Thread David Malcolm
On Tue, 2018-07-31 at 13:06 -0600, Martin Sebor wrote: > The GCC internal %G directive takes a gcall* argument and prints > the call's inlining stack in diagnostics. The argument type makes > it unsuitable for gimple expressions such as those diagnosed by > -Warray-bounds. > > As the first step i

Re: [PATCH][3/4] Use RPO VN from unrolling

2018-08-01 Thread Richard Sandiford
Richard Biener writes: > This should be 4/4 but I have the main patch on top, so... > > This uses the region-based VN from GIMPLE unrolling which means > we better approximate the effects optimizations on unrolled inner > loops when evaluating whether to unroll outer ones. Great! Sounds like it

[PATCH] Backport gettext fixes to get rid of warnings on macOS

2018-08-01 Thread Simon Marchi
This patch was tested to build binutils-gdb on GNU/Linux and macOS. It can be applied to the gcc repo too, after fixing some trivial merge conflicts (someone else will need to do it, as I don't have push access to gcc). Although I think it is relatively low-risk, building gcc on macOS was not tes

Re: [PATCH] Handle overlength strings in C++ FE

2018-08-01 Thread Nathan Sidwell
On 08/01/2018 04:27 AM, Bernd Edlinger wrote: Hi, this makes too long string constants shorter, and fixes one place where a string constant is created non-zero terminated. This is a cleanup in preparation of a more thorough check on the STRING_CST objects in the middle-end. Bootstrapped and re

  1   2   >