Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Martin Sebor
On 07/30/2018 02:21 PM, Bernd Edlinger wrote: On 07/30/18 21:52, Martin Sebor wrote: On 07/30/2018 09:24 AM, Bernd Edlinger wrote: On 07/30/18 01:05, Martin Sebor wrote: On 07/29/2018 04:56 AM, Bernd Edlinger wrote: Hi! This fixes two wrong code bugs where string_constant returns over

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

2018-07-30 Thread Martin Sebor
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 + ARR, fail if the terminating nul doesn't fit in the array

Re: [PATCH] Make strlen range computations more conservative

2018-07-30 Thread Martin Sebor
On 07/27/2018 12:48 AM, Bernd Edlinger wrote: I have one more example similar to PR86259, that resembles IMHO real world code: Consider the following: int fun (char *p) { char buf[16]; assert(strlen(p) < 4); //here: security relevant check sprintf(buf, "echo %s - %s", p, p); //here:

Re: [PATCH] Libraries' configure scripts should not read config-ml.in when multilib is disabled

2018-07-30 Thread John Ericson
On 07/30/18 19:48, Joseph Myers wrote: On the contrary, I think an important principle here is that non-multilib and multilib builds follow the same code paths as far as possible, with the multilib variables just set to trivial values (modulo osdirname) in the case of a non-multilib build - a

[PATCH] convert braced initializers to strings (PR 71625)

2018-07-30 Thread Martin Sebor
The middle-end contains code to determine the lengths of constant character arrays initialized by string literals. The code is used in a number of optimizations and warnings. However, the code is unable to deal with constant arrays initialized using the braced initializer syntax, as in const

Re: [PATCH] Libraries' configure scripts should not read config-ml.in when multilib is disabled

2018-07-30 Thread Joseph Myers
On Mon, 30 Jul 2018, John Ericson wrote: > I understand this building them separately is not supported, but am > nevertheless hoping the patch can nevertheless be upstreamed on the grounds > that this generally cleans up the build system in accordance with the > principle that "feature foo"

[PATCH] Libraries' configure scripts should not read config-ml.in when multilib is disabled

2018-07-30 Thread John Ericson
Currently some multilib variables are initialized, and config.ml.in instantiated, whether or not a multilib build is being performed. I ran into this because I am building the runtime libraries (libatomic right now) separately from GCC. Multilib is disabled, and no multilib variables are set,

Re: [PATCH] Introduce instance discriminators

2018-07-30 Thread Alexandre Oliva
On Jul 24, 2018, Alexandre Oliva wrote: > Ok to install the first two patches? (the third is just for reference) Ping? https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01419.html > Introduce instance discriminators > From: Alexandre Oliva > With -gnateS, the Ada compiler sets itself up to

Re: [PATCH] Move -Walloca and related warnings from c.opt to common.opt

2018-07-30 Thread Iain Buclaw
On 30 July 2018 at 17:45, Martin Sebor wrote: > On 07/30/2018 09:28 AM, Jakub Jelinek wrote: >> >> On Sun, Jul 29, 2018 at 08:35:39PM +0200, Iain Buclaw wrote: >>> >>> Since r262910, it was noticed that new -Walloca-larger-than= warnings >>> started appearing when building the D frontend's

Re: Fwd: [PATCH, rs6000] Replace __uint128_t and __int128_t with __uint128 and __int128 in Power PC built-in documentation

2018-07-30 Thread Segher Boessenkool
On Fri, Jul 27, 2018 at 10:07:20AM -0500, Kelvin Nilsen wrote: > On 7/26/18 9:54 AM, Segher Boessenkool wrote: > > On Thu, Jul 26, 2018 at 08:40:01AM -0500, Kelvin Nilsen wrote: > >> To improve internal consistency and to improve consistency with published > >> ABI documents, this patch replaces

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

2018-07-30 Thread Bernd Edlinger
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 >+ ARR, fail if the terminating nul doesn't fit in the array the string >+ is stored in (as in

Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Bernd Edlinger
On 07/30/18 21:52, Martin Sebor wrote: > On 07/30/2018 09:24 AM, Bernd Edlinger wrote: >> On 07/30/18 01:05, Martin Sebor wrote: >>> On 07/29/2018 04:56 AM, Bernd Edlinger wrote: Hi! This fixes two wrong code bugs where string_constant returns over length string constants. 

[PATCH] avoid incomplete types in -Warray-bounds (PR 86741)

2018-07-30 Thread Martin Sebor
The enhanced handling of MEM_REFs in -Warray-bounds assumes the object from whose address an offset is being computed has a complete type. Since the size of such objects isn't known, whether the offset (or index) from its beginning is valid cannot be reliably determined. The attached patch

Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Martin Sebor
On 07/30/2018 09:24 AM, Bernd Edlinger wrote: On 07/30/18 01:05, Martin Sebor wrote: On 07/29/2018 04:56 AM, Bernd Edlinger wrote: Hi! This fixes two wrong code bugs where string_constant returns over length string constants. Initializers like that are rejected in C++, but valid in C. If

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

2018-07-30 Thread Martin Sebor
On 07/26/2018 02:53 AM, Bernd Edlinger wrote: @@ -567,13 +597,17 @@ string_length (const void *ptr, unsigned eltsize, unsigned maxelts) accesses. Note that this implies the result is not going to be emitted into the instruction stream. + When ARR is non-null and the string is not

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

2018-07-30 Thread Martin Sebor
Attached is an updated version of the patch that handles more instances of calling strlen() on a constant array that is not a nul-terminated string. No other functions except strlen are explicitly handled yet, and neither are constant arrays with braced-initializer lists like const char a[] = {

Re: Fold pointer range checks with equal spans

2018-07-30 Thread Richard Sandiford
[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 Sandiford wrote: >> > >> >> --- gcc/match.pd 2018-07-18 18:44:22.565914281 +0100 >> >> +++ gcc/match.pd

Re: [PATCH] arm: Generate correct const_ints (PR86640)

2018-07-30 Thread Segher Boessenkool
On Mon, Jul 30, 2018 at 03:55:30PM +0100, Kyrill Tkachov wrote: > Hi Segher, > > On 30/07/18 14:14, Segher Boessenkool wrote: > >In arm_block_set_aligned_vect 8-bit constants are generated as zero- > >extended const_ints, not sign-extended as required. Fix that. > > > >Tamar tested the patch

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Richard Biener
On July 30, 2018 4:41:19 PM GMT+02:00, Bernd Edlinger wrote: > > >On 07/30/18 15:03, Richard Biener 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

[PATCH] PR libstdc++/86734 make reverse_iterator::operator-> more robust

2018-07-30 Thread Jonathan Wakely
Implement the proposed resolution from LWG 1052, which also resolves DR 2118 by avoiding taking the address in the first place. PR libstdc++/86734 * include/bits/stl_iterator.h (reverse_iterator::operator->): Call _S_to_pointer (LWG 1052, LWG 2118).

[PATCH] Add workaround for aligned_alloc bug on AIX

2018-07-30 Thread Jonathan Wakely
20_util/memory_resource/2.cc FAILs on AIX 7.2.0.0, because aligned_alloc incorrectly requires the alignment to be a multiple of sizeof(void*). This adds a workaround to the operator new overload taking an alignment value, to increase the alignment (and size) if needed. *

Re: [0/5] C-SKY port

2018-07-30 Thread Sandra Loosemore
On 07/26/2018 05:04 PM, Joseph Myers wrote: Could you provide the proposed GCC website changes for the port (backends.html, readings.html, news item for index.html)? readings.html, in particular, would link to the ABI and ISA documentation, while backends.html gives summary information about

[5/5] C-SKY port v2: libgcc

2018-07-30 Thread Sandra Loosemore
2018-07-30 Jojo Huibin Wang Sandra Loosemore Chung-Lin Tang C-SKY port: libgcc libgcc/ * config.host: Add C-SKY support. * config/csky/*: New. diff --git a/libgcc/config.host b/libgcc/config.host index 18cabaf..bd4ef1e

[0/5] C-SKY port v2

2018-07-30 Thread Sandra Loosemore
This patch series is a revised version of the C-SKY port, taking into account review comments received so far on the initial patch set. The changes made are: - Removed excess whitespace in predicates.md and other places (part 2). - Defined TARGET_CUSTOM_FUNCTION_DESCRIPTORS (part 2). - Moved

[4/5] C-SKY port v2: Testsuite

2018-07-30 Thread Sandra Loosemore
2018-07-30 Sandra Loosemore Chung-Lin Tang Xianmiao Qu C-SKY port: Testsuite gcc/testsuite/ * g++.dg/Wno-frame-address.C: Adjust for C-SKY. * g++.dg/torture/type-generic-1.C: Likewise. * gcc.c-torture/compile/2804-1.c:

[3/5] C-SKY port v2: Documentation

2018-07-30 Thread Sandra Loosemore
2018-07-30 Sandra Loosemore C-SKY port: Documentation gcc/ * doc/extend.texi (C-SKY Function Attributes): New section. * doc/invoke.texi (Option Summary): Add C-SKY options. (C-SKY Options): New section. * doc/md.texi (Machine Constraints):

[2/5] C-SKY port v2: Backend implementation

2018-07-30 Thread Sandra Loosemore
2018-07-30 Jojo Huibin Wang Sandra Loosemore Chung-Lin Tang C-SKY port: Backend implementation gcc/ * config/csky/*: New. * common/config/csky/*: New. csky-gcc-2.patch.gz Description: application/gzip

[1/5] C-SKY port v2: Configury

2018-07-30 Thread Sandra Loosemore
2018-07-30 Jojo Huibin Wang Sandra Loosemore Chung-Lin Tang Andrew Jenner C-SKY port: Configury gcc/ * config.gcc (csky-*-*): New. * configure.ac: Add csky to targets for dwarf2 debug_line support.

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Jakub Jelinek
On Mon, Jul 30, 2018 at 04:28:50PM +, Bernd Edlinger wrote: > >>> generic.texi says they need not be. Making the STRING_CST contain only > >>> the bytes of the initializer and not the trailing NUL in the C case where > >>> the trailing NUL does not fit in the object initialized would of

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Bernd Edlinger
On 07/30/18 18:01, Joseph Myers wrote: > On Mon, 30 Jul 2018, Jakub Jelinek wrote: > >> On Mon, Jul 30, 2018 at 03:52:39PM +, Joseph Myers wrote: >>> On Mon, 30 Jul 2018, Bernd Edlinger wrote: >>> In the moment I would already be happy if all STRING_CSTs would be zero terminated.

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

2018-07-30 Thread Segher Boessenkool
On Tue, Jul 24, 2018 at 05:18:41PM +, Segher Boessenkool wrote: > This patch allows combine to combine two insns into two. This helps > in many cases, by reducing instruction path length, and also allowing > further combinations to happen. PR85160 is a typical example of code > that it can

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Bernd Edlinger
On 07/30/18 17:57, Jakub Jelinek wrote: > On Mon, Jul 30, 2018 at 03:52:39PM +, Joseph Myers wrote: >> On Mon, 30 Jul 2018, Bernd Edlinger wrote: >> >>> In the moment I would already be happy if all STRING_CSTs would >>> be zero terminated. >> >> generic.texi says they need not be. Making the

[PATCH] testcase for 2-2 combine

2018-07-30 Thread Segher Boessenkool
Committing. Segher 2018-07-30 Segher Boessenkool gcc/testsuite/ PR rtl-optimization/85160 * gcc.target/powerpc/combine-2-2.c: New testcase. --- gcc/testsuite/gcc.target/powerpc/combine-2-2.c | 17 + 1 file changed, 17 insertions(+) create mode 100644

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Joseph Myers
On Mon, 30 Jul 2018, Jakub Jelinek wrote: > On Mon, Jul 30, 2018 at 03:52:39PM +, Joseph Myers wrote: > > On Mon, 30 Jul 2018, Bernd Edlinger wrote: > > > > > In the moment I would already be happy if all STRING_CSTs would > > > be zero terminated. > > > > generic.texi says they need not

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Jakub Jelinek
On Mon, Jul 30, 2018 at 03:52:39PM +, Joseph Myers wrote: > On Mon, 30 Jul 2018, Bernd Edlinger wrote: > > > In the moment I would already be happy if all STRING_CSTs would > > be zero terminated. > > generic.texi says they need not be. Making the STRING_CST contain only > the bytes of the

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Joseph Myers
On Mon, 30 Jul 2018, Bernd Edlinger wrote: > In the moment I would already be happy if all STRING_CSTs would > be zero terminated. generic.texi says they need not be. Making the STRING_CST contain only the bytes of the initializer and not the trailing NUL in the C case where the trailing NUL

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Joseph Myers
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 character. I don't think shortening should be

Re: [PATCH] Move -Walloca and related warnings from c.opt to common.opt

2018-07-30 Thread Martin Sebor
On 07/30/2018 09:28 AM, Jakub Jelinek wrote: On Sun, Jul 29, 2018 at 08:35:39PM +0200, Iain Buclaw wrote: Since r262910, it was noticed that new -Walloca-larger-than= warnings started appearing when building the D frontend's standard library. These have been checked and verified as valid, and

[PATCH][c++] Fix DECL_BY_REFERENCE of clone parms

2018-07-30 Thread Tom de Vries
Hi, Consider test.C compiled at -O0 -g: ... class string { public: string (const char *p) { this->p = p ; } string (const string ) { this->p = s.p; } private: const char *p; }; class foo { public: foo (string dir_hint) {} }; int main (void) { std::string s = "This is just a string";

Re: [PATCH] Move -Walloca and related warnings from c.opt to common.opt

2018-07-30 Thread Jakub Jelinek
On Sun, Jul 29, 2018 at 08:35:39PM +0200, Iain Buclaw wrote: > Since r262910, it was noticed that new -Walloca-larger-than= warnings > started appearing when building the D frontend's standard library. > These have been checked and verified as valid, and appropriate fixes > will be sent on

Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Bernd Edlinger
On 07/30/18 01:05, Martin Sebor wrote: > On 07/29/2018 04:56 AM, Bernd Edlinger wrote: >> Hi! >> >> This fixes two wrong code bugs where string_constant >> returns over length string constants.  Initializers >> like that are rejected in C++, but valid in C. > > If by valid you are referring to

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Martin Sebor
On 07/30/2018 05:51 AM, 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 character. I thought Martin would be working on it, but

Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Martin Sebor
On 07/30/2018 12:57 AM, Richard Biener wrote: On Sun, 29 Jul 2018, Martin Sebor wrote: On 07/29/2018 04:56 AM, Bernd Edlinger wrote: Hi! This fixes two wrong code bugs where string_constant returns over length string constants. Initializers like that are rejected in C++, but valid in C.

Re: [PATCH] arm: Generate correct const_ints (PR86640)

2018-07-30 Thread Kyrill Tkachov
Hi Segher, On 30/07/18 14:14, Segher Boessenkool wrote: In arm_block_set_aligned_vect 8-bit constants are generated as zero- extended const_ints, not sign-extended as required. Fix that. Tamar tested the patch (see PR); no problems were found. Is this okay for trunk? The patch is okay but

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Bernd Edlinger
On 07/30/18 15:03, Richard Biener 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

Re: [libgomp, nvptx, committed] Calculate default dims per device

2018-07-30 Thread Cesar Philippidis
On 07/30/2018 03:19 AM, Tom de Vries wrote: > > [libgomp, nvptx] Calculate default dims per device > > The default dimensions are calculated using per-device properties, but > initialized once and used on all devices. > > This patch fixes this problem by introducing per-device default

Re: [PATCH][GCC][AARCH64] Canonicalize aarch64 widening simd plus insns

2018-07-30 Thread Kyrill Tkachov
On 30/07/18 14:30, Christophe Lyon wrote: Hi, On Tue, 24 Jul 2018 at 17:39, Kyrill Tkachov wrote: On 24/07/18 16:12, James Greenhalgh wrote: On Thu, Jul 19, 2018 at 07:35:22AM -0500, Matthew Malcomson wrote: Hi again. Providing an updated patch to include the formatting suggestions.

Re: [PATCH][Middle-end] disable strcmp/strncmp inlining with O2 below and Os

2018-07-30 Thread Christophe Lyon
On Wed, 25 Jul 2018 at 19:08, Qing Zhao wrote: > > Hi, > > As Wilco suggested, the new added strcmp/strncmp inlining should be only > enabled with O2 and above. > > this is the simple patch for this change. > > tested on both X86 and aarch64. > > Okay for thunk? > > Qing > > gcc/ChangeLog: > >

Re: [PATCH][GCC][AARCH64] Canonicalize aarch64 widening simd plus insns

2018-07-30 Thread Christophe Lyon
Hi, On Tue, 24 Jul 2018 at 17:39, Kyrill Tkachov wrote: > > > On 24/07/18 16:12, James Greenhalgh wrote: > > On Thu, Jul 19, 2018 at 07:35:22AM -0500, Matthew Malcomson wrote: > > > Hi again. > > > > > > Providing an updated patch to include the formatting suggestions. > > > > Please try not to

Re: [PATCH] Fix PR middle-end/86705

2018-07-30 Thread Richard Biener
On Sun, Jul 29, 2018 at 6:27 PM Jozef Lawrynowicz wrote: > > pr45678-2.c ICEs for msp430-elf with -mlarge, because an alignment of > POINTER_SIZE is attempted. POINTER_SIZE with -mlarge is 20-bits, so further > code in the middle-end that expects this to be a power or 2 causes odd > alignments to

Re: [PATCH 08/11] targhooks - provide an alternative hook for targets that never execute speculatively

2018-07-30 Thread Richard Biener
On Fri, 27 Jul 2018, Richard Earnshaw wrote: > > This hook adds an alternative implementation for the target hook > TARGET_HAVE_SPECULATION_SAFE_VALUE; it can be used by targets that have no > CPU implementations that execute code speculatively. All that is needed for > such targets now is to

Re: [PATCH 01/11] Add __builtin_speculation_safe_value

2018-07-30 Thread Richard Biener
On Fri, 27 Jul 2018, Richard Earnshaw wrote: > > This patch defines a new intrinsic function > __builtin_speculation_safe_value. A generic default implementation is > defined which will attempt to use the backend pattern > "speculation_safe_barrier". If this pattern is not defined, or if it >

[PATCH] arm: Generate correct const_ints (PR86640)

2018-07-30 Thread Segher Boessenkool
In arm_block_set_aligned_vect 8-bit constants are generated as zero- extended const_ints, not sign-extended as required. Fix that. Tamar tested the patch (see PR); no problems were found. Is this okay for trunk? Segher 2018-07-30 Segher Boessenkool PR target/86640 *

Re: [PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Richard Biener
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 character. > > I thought Martin would be working on

[OBVIOUS][ARM][libgcc] Fix comment for code working on architectures >= 4

2018-07-30 Thread Christophe Lyon
Hi, In r261840 I added an inaccurate comment: the code works on architectures >= 4, not > 4. I committed this obvious fix as r263066: 2018-07-30 Christophe Lyon * config/arm/ieee754-df.S: Fix comment for code working on architectures >= 4. * config/arm/ieee754-sf.S:

[PATCH] Fix the damage done by my other patch from yesterday to strlenopt-49.c

2018-07-30 Thread Bernd Edlinger
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 character. I thought Martin would be working on it, but as this is a really simple fix, I would dare to

[11/11] Insert pattern statements into vec_basic_blocks

2018-07-30 Thread Richard Sandiford
The point of this patch is to put pattern statements in the same vec_basic_block as the statements they replace, with the pattern statements for S coming between S and S's original predecessor. This removes the need to handle them specially in various places. 2018-07-30 Richard Sandiford

[10/11] Make the vectoriser do its own DCE

2018-07-30 Thread Richard Sandiford
The vectoriser normally leaves a later DCE pass to remove the scalar code, but we've accumulated various bits of code to remove cases that DCE can't handle, such as removing the scalar stores that have been replaced by vector stores, and the scalar calls to internal functions. (The latter must be

[09/11] Add a vec_basic_block structure

2018-07-30 Thread Richard Sandiford
This patch adds a vec_basic_block that records the scalar phis and scalar statements that we need to vectorise. This is a slight simplification in its own right, since it avoids unnecesary statement lookups and shaves >50 LOC. But the main reason for doing it is to allow the final patch in the

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

2018-07-30 Thread Richard Sandiford
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 hoisted out of the vectorised loop. It isn't worth doing in its own

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

2018-07-30 Thread Richard Sandiford
_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 able to use that order for creating stmt_vec_infos too. 2018-07-30

[06/11] Handle VMAT_INVARIANT separately

2018-07-30 Thread Richard Sandiford
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 whether the pointer was invariant. But vectorised invariant loads

[05/11] Add a vect_stmt_to_vectorize helper function

2018-07-30 Thread Richard Sandiford
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 reduc_stmt_info (first hunk) and stmt_info (second hunk) are already

[04/11] Add a vect_orig_stmt helper function

2018-07-30 Thread Richard Sandiford
This patch just adds a helper function for going from a potential pattern statement to the original scalar statement. 2018-07-30 Richard Sandiford gcc/ * tree-vectorizer.h (vect_orig_stmt): New function. * tree-vect-data-refs.c (vect_preserves_scalar_order_p): Use it.

[03/11] Remove vect_transform_stmt grouped_store argument

2018-07-30 Thread Richard Sandiford
Nothing now uses the grouped_store value passed back by vect_transform_stmt, so we might as well remove it. 2018-07-30 Richard Sandiford gcc/ * tree-vectorizer.h (vect_transform_stmt): Remove grouped_store argument. * tree-vect-stmts.c (vect_transform_stmt): Likewise.

[02/11] Remove vect_schedule_slp return value

2018-07-30 Thread Richard Sandiford
Nothing now uses the vect_schedule_slp return value, so it's not worth propagating the value through vect_schedule_slp_instance. 2018-07-30 Richard Sandiford gcc/ * tree-vectorizer.h (vect_schedule_slp): Return void. * tree-vect-slp.c (vect_schedule_slp_instance): Likewise.

[01/11] Schedule SLP earlier

2018-07-30 Thread Richard Sandiford
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. 2018-07-30 Richard Sandiford gcc/ * tree-vect-loop.c (vect_transform_loop_stmt): Remove slp_scheduled argument.

[00/11] Add a vec_basic_block of scalar statements

2018-07-30 Thread Richard Sandiford
This series puts the statements that need to be vectorised into a "vec_basic_block" structure of linked stmt_vec_infos, and then puts pattern statements into this block rather than hanging them off the original scalar statement. Partly this is clean-up, since making pattern statements more like

Re: [GCC][PATCH][Aarch64] Exploiting BFXIL when OR-ing two AND-operations with appropriate bitmasks

2018-07-30 Thread Sam Tebbs
Hi all, This update fixes an issue where the predicate would match but during register allocation the constraints wouldn't match and so an internal compiler error would be raised. This was fixed by adding two left_consecutive checks to the pattern's predicate to stop it from matching and

[committed] Resync inline implementation of ceil_log2 (PR 86506)

2018-07-30 Thread Richard Sandiford
In r262961 I only updated the out-of-line copy of ceil_log2. This patch applies the same change to the other (inline) one. Tested on aarch64-linux-gnu and x86_64-linux-gnu. Applied as obvious. Richard 2018-07-30 Richard Sandiford gcc/ * hwint.h (ceil_log2): Resync with hwint.c

[C++2A] Implement P1008R1 - prohibit aggregates with user-declared constructors

2018-07-30 Thread Jakub Jelinek
Hi! Seems what is considered an aggregate type keeps changing in every single C++ version. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2018-07-27 Jakub Jelinek P1008R1 - prohibit aggregates with user-declared constructors * class.c

[libgomp, nvptx. committed] Handle per-function max-threads-per-block in default dims

2018-07-30 Thread Tom de Vries
Hi, Build and reg-tested on x86_64 with nvptx accelerator. Committed to trunk. Thanks, - Tom [libgomp, nvptx] Handle per-function max-threads-per-block in default dims Currently parallel-loop-1.c fails at -O0 on a Quadro M1200, because one of the kernel launch configurations exceeds the

[libgomp, nvptx, committed] Calculate default dims per device

2018-07-30 Thread Tom de Vries
Hi, Build and reg-tested on x86_64 with nvptx accelerator. Committed to trunk. Thanks, - Tom [libgomp, nvptx] Calculate default dims per device The default dimensions are calculated using per-device properties, but initialized once and used on all devices. This patch fixes this problem by

Re: [patch] adjust default nvptx launch geometry for OpenACC offloaded regions

2018-07-30 Thread Tom de Vries
On 07/11/2018 09:13 PM, Cesar Philippidis wrote: > 2018-07-XX Cesar Philippidis > Tom de Vries > > gcc/ > * config/nvptx/nvptx.c (PTX_GANG_DEFAULT): Rename to ... > (PTX_DEFAULT_RUNTIME_DIM): ... this. > (nvptx_goacc_validate_dims): Set default worker and

abstract remaining wide int operations in VRP

2018-07-30 Thread Aldy Hernandez
...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_range (instead of set_value_range) due to the way I've organized

Re: [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)

2018-07-30 Thread Richard Biener
On Sun, 29 Jul 2018, Martin Sebor wrote: > On 07/29/2018 04:56 AM, Bernd Edlinger wrote: > > Hi! > > > > This fixes two wrong code bugs where string_constant > > returns over length string constants. Initializers > > like that are rejected in C++, but valid in C. > > If by valid you are

Re: [PATCH] Avoid another non zero terminated string constant

2018-07-30 Thread Richard Biener
On Sun, 29 Jul 2018, Bernd Edlinger wrote: > Hi! > > This fixes another not NUL terminated string literal that is created > in tree-ssa-forwprop.c at simplify_builtin_call. > > src_buf is set up to contain a NUL at src_buf[src_len], thus use src_len + 1 > as length parameter to

[PING][PATCH] [v4][aarch64] Avoid tag collisions for loads falkor

2018-07-30 Thread Siddhesh Poyarekar
Hello, Ping! On 07/24/2018 12:37 PM, Siddhesh Poyarekar wrote: Hi, This is a rewrite of the tag collision avoidance patch that Kugan had written as a machine reorg pass back in February. The falkor hardware prefetching system uses a combination of the source, destination and offset to decide