Re: [PATCH][i386] Fix PR83358 - increase divide/mod latencies a bit

2017-12-15 Thread Jeff Law
On 12/12/2017 01:28 AM, Markus Trippelsdorf wrote: > As the testcase shows, trunk currently generates horrible code for > divisions used in tight loops. This happens because the algorithm > expanding div/mod doesn't take parallelism into account and this makes > the cost model unrealistic. > Fix

libgo patch committed: use hostname -s on AIX

2017-12-15 Thread Ian Lance Taylor
This patch by Tony Reix changes the libgo tests for the os package on AIX to use hostname -s, not plain hostname. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE ===

libgo patch committed: emulate Flock on AIX

2017-12-15 Thread Ian Lance Taylor
This patch by Tony Reix adds an emulation of the Flock call to libgo's syscall package on AIX. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE === --- gcc/go/gofrontend/MERGE (revision 255666) +++

Re: Backports to 7.3

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 11:23:21PM +0100, Jakub Jelinek wrote: > Hi! > > I've backported today following 23 patches after bootstrapping/regtesting > them on x86_64-linux and i686-linux. And 2 more: Jakub 2017-12-16 Jakub Jelinek Backported from mainline

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Richard Sandiford
Jeff Law writes: > On 11/17/2017 08:58 AM, Richard Sandiford wrote: >> This patch looks for pseudo registers that are live across a call >> and for which no call-preserved hard registers exist. It then >> recomputes the pseudos as necessary to ensure that they are no >> longer

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Richard Sandiford
Jeff Law writes: > On 12/14/2017 12:26 PM, Richard Sandiford wrote: How does it relate to what LRA can do? AFAIK LRA doesn't try to find any global optimal solution and previous hardreg assignments may work against it? >> >> Yeah, both of those are problems. But

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread David Malcolm
On Fri, 2017-12-15 at 13:58 -0500, Jason Merrill wrote: > On Fri, Dec 15, 2017 at 11:35 AM, David Malcolm > wrote: > > On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: > > > On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm > > om> > > > wrote: > > >

[committed][PR tree-optimization/36550] Thread through blocks with real statements if they're all dead with -Os

2017-12-15 Thread Jeff Law
Phew. Got this one fixed before it hit its 10th birthday... pr36550 is a false positive from -Wuninitialized at -Os. When optimizing for size, jump threading is severely limited. Essentially we only thread through blocks that transfer control with no other side effects. This unnecessarily

Backports to 7.3

2017-12-15 Thread Jakub Jelinek
Hi! I've backported today following 23 patches after bootstrapping/regtesting them on x86_64-linux and i686-linux. Some of the backports are just partial backports, in particular for r255133 I've just backported the removal of case BUILT_IN_STPNCPY_CHK:, for r255354 the patch didn't apply at

Re: [PR81165] discount killed stmts when sizing blocks for threading

2017-12-15 Thread Jeff Law
On 12/11/2017 10:17 PM, Alexandre Oliva wrote: > On Dec 11, 2017, Jeff Law wrote: > >>> + gcc_assert (path->length () == 0 || path->last ()->e == e); >>> + if (path->length () == 0) >>> +return estimate_threading_killed_stmts (e->dest); >>> + >>> + int total = 0; >>> +

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Qing Zhao
Hi, Wilco, thanks a lot for your review and comments. > On Dec 15, 2017, at 6:41 AM, Wilco Dijkstra wrote: > > Hi Qing, > > Just looking at a very high level, I have a few comments: > > 1. Constant folding str(n)cmp - folding is done separately in > fold-const-call.c

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Jeff Law
On 11/17/2017 08:58 AM, Richard Sandiford wrote: > This patch looks for pseudo registers that are live across a call > and for which no call-preserved hard registers exist. It then > recomputes the pseudos as necessary to ensure that they are no > longer live across a call. The comment at the

Fix Debug insert_return_type

2017-12-15 Thread François Dumont
Here is a patch to fix those failures of the latest report: UNRESOLVED: 23_containers/map/modifiers/extract.cc compilation failed to produce executable FAIL: 23_containers/set/modifiers/extract.cc (test for excess errors) UNRESOLVED: 23_containers/set/modifiers/extract.cc compilation failed to

Re: [C++ PATCH] Fix ICE on invalid std::tuple_size<...>::value (PR c++/83205)

2017-12-15 Thread Jason Merrill
OK. On Fri, Dec 15, 2017 at 2:46 PM, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 08:09:20PM +0100, Jakub Jelinek wrote: >> On Fri, Dec 15, 2017 at 02:01:36PM -0500, Jason Merrill wrote: >> > On 11/29/2017 08:19 PM, Martin Sebor wrote: >> > > On 11/29/2017 03:32 PM, Jakub

Re: [C++ RFC PATCH] Fix ICE with late attributes in templates (PR c++/83300)

2017-12-15 Thread Jason Merrill
On Fri, Dec 15, 2017 at 3:11 PM, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 03:02:50PM -0500, Jason Merrill wrote: >> On 12/07/2017 11:45 AM, Jakub Jelinek wrote: >> > save_template_attributes ignored flags, when ATTR_FLAG_TYPE_IN_PLACE >> > wasn't set on a type, it would

Re: [PATCH] Fix ICE with extend_ref_init_temps of structured binding (PR c++/81197)

2017-12-15 Thread Jason Merrill
On 12/04/2017 07:00 PM, Jakub Jelinek wrote: @@ -1291,7 +1291,56 @@ write_unqualified_name (tree decl) { found = true; gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl)); - write_source_name (DECL_ASSEMBLER_NAME (decl)); + if (VAR_P (decl) + &&

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Qing Zhao
> On Dec 15, 2017, at 11:47 AM, Jakub Jelinek wrote: > > On Fri, Dec 15, 2017 at 11:17:37AM -0600, Qing Zhao wrote: >> HOST_WIDE_INT const_string_leni = -1; >> >> if (idx1) >>{ >> const_string_leni = compute_string_length (idx1); >> var_string = arg2; >>}

Re: [C++ PATCH] Harmonize C++ flexible array member initialization with C (PR c++/80135, PR c++/81922)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 03:09:53PM -0500, Jason Merrill wrote: > So this change is because the caller is only interested in flexible arrays, > which can't be deeply nested anymore? In that case, this is no longer a Yes. > general purpose function and should be called find_flexarray_init. Done

Re: [C++ RFC PATCH] Fix ICE with late attributes in templates (PR c++/83300)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 03:02:50PM -0500, Jason Merrill wrote: > On 12/07/2017 11:45 AM, Jakub Jelinek wrote: > > save_template_attributes ignored flags, when ATTR_FLAG_TYPE_IN_PLACE > > wasn't set on a type, it would happily attach the attributes to some > > existing type (in this case to

Re: [C++ PATCH] Harmonize C++ flexible array member initialization with C (PR c++/80135, PR c++/81922)

2017-12-15 Thread Jason Merrill
On 12/08/2017 11:15 AM, Jakub Jelinek wrote: Hi! Martin's patch a few years ago started allowing flexible array members inside of nested aggregates, similarly to what we were doing in C. But C rejects cases where we in nested context try to initialize a flexible array member with a non-empty

Re: [C++ RFC PATCH] Fix ICE with late attributes in templates (PR c++/83300)

2017-12-15 Thread Jason Merrill
On 12/07/2017 11:45 AM, Jakub Jelinek wrote: save_template_attributes ignored flags, when ATTR_FLAG_TYPE_IN_PLACE wasn't set on a type, it would happily attach the attributes to some existing type (in this case to integer_type_node). My first approach was to just call

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Jeff Law
On 12/14/2017 12:26 PM, Richard Sandiford wrote: >>> How does it relate to what LRA can do? AFAIK LRA doesn't try to find >>> any global optimal solution and previous hardreg assignments may work >>> against it? > > Yeah, both of those are problems. But the more important problem is > that it

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 08:14:38PM +0100, Richard Biener wrote: > On December 15, 2017 8:10:33 PM GMT+01:00, Jeff Law wrote: > >On 12/14/2017 12:32 PM, Richard Biener wrote: > >> > >> On x86_64 all xmm registers are caller saved for example. That means > >all FP regs and all

Re: [C++ PATCH] Fix ICE on invalid std::tuple_size<...>::value (PR c++/83205)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 08:09:20PM +0100, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 02:01:36PM -0500, Jason Merrill wrote: > > On 11/29/2017 08:19 PM, Martin Sebor wrote: > > > On 11/29/2017 03:32 PM, Jakub Jelinek wrote: > > > > +  if (!tree_fits_uhwi_p (tsize)) > > > > +    { > > > > +  

[PATCH] Fix PR83439

2017-12-15 Thread Richard Biener
Goofed up a backport to the GCC 7 branch. Bootstrap & regtest in progress. Richard. 2017-12-15 Richard Biener PR bootstrap/83439 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Adjust remaining gimple_set_modified to use the modified

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Richard Biener
On December 15, 2017 8:10:33 PM GMT+01:00, Jeff Law wrote: >On 12/14/2017 12:32 PM, Richard Biener wrote: >> >> On x86_64 all xmm registers are caller saved for example. That means >all FP regs and all vectors. (yeah, stupid ABI decision) >But that's precisely what I would

Re: Add an "early rematerialisation" pass

2017-12-15 Thread Jeff Law
On 12/14/2017 12:32 PM, Richard Biener wrote: > > On x86_64 all xmm registers are caller saved for example. That means all FP > regs and all vectors. (yeah, stupid ABI decision) But that's precisely what I would expect if one was looking to maintain backwards compatibility within the core

Re: [C++ PATCH] Fix ICE on invalid std::tuple_size<...>::value (PR c++/83205)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 02:01:36PM -0500, Jason Merrill wrote: > On 11/29/2017 08:19 PM, Martin Sebor wrote: > > On 11/29/2017 03:32 PM, Jakub Jelinek wrote: > > > +  if (!tree_fits_uhwi_p (tsize)) > > > +    { > > > +  error_at (loc, "%u names provided while %qT decomposes into " > > > >

Re: [C++ PATCH] Fix ICE with structured binding & to incomplete type (PR c++/83217)

2017-12-15 Thread Jason Merrill
OK.

Re: [C++ PATCH] Fix ICE on invalid std::tuple_size<...>::value (PR c++/83205)

2017-12-15 Thread Jason Merrill
On 11/29/2017 08:19 PM, Martin Sebor wrote: On 11/29/2017 03:32 PM, Jakub Jelinek wrote: +  if (!tree_fits_uhwi_p (tsize)) +    { +  error_at (loc, "%u names provided while %qT decomposes into " When count is 1 as in the test below the error isn't grammatically correct ("1 names").  I

Re: [PATCH] Avoid excessive function type casts with splay-trees

2017-12-15 Thread Bernd Edlinger
On 12/15/17 11:51, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 10:44:54AM +, Bernd Edlinger wrote: >> when working on the -Wcast-function-type patch I noticed some rather >> ugly and non-portable function type casts that are necessary to accomplish >> some actually very simple tasks. >> >>

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread Jason Merrill
On Fri, Dec 15, 2017 at 11:35 AM, David Malcolm wrote: > On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: >> On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm >> wrote: >> > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: >> > > On 11/10/2017

Re: [PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Bin.Cheng
On Fri, Dec 15, 2017 at 1:19 PM, Richard Biener wrote: > On Fri, Dec 15, 2017 at 1:35 PM, Bin.Cheng wrote: >> On Fri, Dec 15, 2017 at 12:09 PM, Bin.Cheng wrote: >>> On Fri, Dec 15, 2017 at 11:55 AM, Richard Biener >>>

Re: [PR81165] discount killed stmts when sizing blocks for threading

2017-12-15 Thread Jeff Law
On 12/11/2017 10:17 PM, Alexandre Oliva wrote: > On Dec 11, 2017, Jeff Law wrote: > > I've updated it according to richi's and your feedbacks. Regstrapped on > {x86_64,i686}-linux-gnu. Ok to install? > > > We limit the amount of copying for jump threading based on counting >

Re: [committed][PR tree-optimization/83410] Avoid some jump threads when parallelizing loops

2017-12-15 Thread Jeff Law
On 12/15/2017 09:45 AM, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 09:19:14AM -0700, Jeff Law wrote: >> + /* Loop parallelization can be confused by the result of >> + threading through the loop exit test back into the loop. >> + However, theading those jumps seems to help

[committed] Add one further testcase for PR80631

2017-12-15 Thread Jakub Jelinek
Hi! When backporting the PR80631 fix to 7.x, I've noticed there is no runtime FAIL in any of the tests, only the scan-tree-dump test failures. So, I've committed following test that FAILs on x86_64-linux without the patch and succeeds with it. 2017-12-15 Jakub Jelinek

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 11:17:37AM -0600, Qing Zhao wrote: > HOST_WIDE_INT const_string_leni = -1; > > if (idx1) > { > const_string_leni = compute_string_length (idx1); > var_string = arg2; > } > else if (idx2) > { > const_string_leni = compute_string_length

Re: [PATCH] set range for strlen(array) to avoid spurious -Wstringop-overflow (PR 83373 , PR 78450)

2017-12-15 Thread Martin Sebor
On 12/15/2017 09:17 AM, Richard Biener wrote: On December 15, 2017 4:58:14 PM GMT+01:00, Martin Sebor wrote: On 12/15/2017 01:48 AM, Richard Biener wrote: On Thu, Dec 14, 2017 at 5:01 PM, Martin Sebor wrote: On 12/14/2017 03:43 AM, Richard Biener wrote:

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Qing Zhao
> On Dec 15, 2017, at 10:42 AM, Jakub Jelinek wrote: > > On Fri, Dec 15, 2017 at 10:08:03AM -0600, Qing Zhao wrote: >> a little confused here: >> >> in the current code: >> . the first case is: result = strcmp() != 0 >> . the second case is:if (strcmp()

Re: [committed][PR tree-optimization/83410] Avoid some jump threads when parallelizing loops

2017-12-15 Thread Richard Biener
On December 15, 2017 5:19:14 PM GMT+01:00, Jeff Law wrote: >I hate this patch. > >The fundamental problem we have is that there are times when we very >much want to thread jumps and yet there are other times when we do not. > >To date we have been able to largely select between

Re: [committed][PR tree-optimization/83410] Avoid some jump threads when parallelizing loops

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 09:19:14AM -0700, Jeff Law wrote: > + /* Loop parallelization can be confused by the result of > + threading through the loop exit test back into the loop. > + However, theading those jumps seems to help other codes. > + > + I have been

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 10:08:03AM -0600, Qing Zhao wrote: > a little confused here: > > in the current code: > . the first case is: result = strcmp() != 0 > . the second case is:if (strcmp() != 0) > > so, the missing case you mentioned above is: > > result = if

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread David Malcolm
On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: > On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm > wrote: > > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: > > > On 11/10/2017 04:45 PM, David Malcolm wrote: > > > > The initial version of the patch kit added

Re: [PATCH] Fix PR83418

2017-12-15 Thread Richard Biener
On December 15, 2017 5:27:14 PM GMT+01:00, Jeff Law wrote: >On 12/15/2017 01:10 AM, Richard Biener wrote: >> On Thu, 14 Dec 2017, Richard Biener wrote: >> >>> On December 14, 2017 4:43:42 PM GMT+01:00, Jeff Law >wrote: On 12/14/2017 01:54 AM, Richard

Re: [PATCH] Fix PR83418

2017-12-15 Thread Jeff Law
On 12/15/2017 01:10 AM, Richard Biener wrote: > On Thu, 14 Dec 2017, Richard Biener wrote: > >> On December 14, 2017 4:43:42 PM GMT+01:00, Jeff Law wrote: >>> On 12/14/2017 01:54 AM, Richard Biener wrote: IVOPTs (at least) leaves unfolded stmts in the IL and VRP >>>

[committed][PR tree-optimization/83410] Avoid some jump threads when parallelizing loops

2017-12-15 Thread Jeff Law
I hate this patch. The fundamental problem we have is that there are times when we very much want to thread jumps and yet there are other times when we do not. To date we have been able to largely select between those two by looking at the shape of the CFG and the jump thread to see how

Re: [PATCH] set range for strlen(array) to avoid spurious -Wstringop-overflow (PR 83373 , PR 78450)

2017-12-15 Thread Richard Biener
On December 15, 2017 4:58:14 PM GMT+01:00, Martin Sebor wrote: >On 12/15/2017 01:48 AM, Richard Biener wrote: >> On Thu, Dec 14, 2017 at 5:01 PM, Martin Sebor >wrote: >>> On 12/14/2017 03:43 AM, Richard Biener wrote: On Wed, Dec 13, 2017 at 4:47 AM,

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Qing Zhao
Hi, Jakub, thanks a lot for your detailed review. > On Dec 14, 2017, at 2:45 PM, Jakub Jelinek wrote: > > On Thu, Dec 14, 2017 at 01:45:21PM -0600, Qing Zhao wrote: >> 2017-12-11 Qing Zhao > > > No "

Re: [PATCH] set range for strlen(array) to avoid spurious -Wstringop-overflow (PR 83373 , PR 78450)

2017-12-15 Thread Martin Sebor
On 12/15/2017 01:48 AM, Richard Biener wrote: On Thu, Dec 14, 2017 at 5:01 PM, Martin Sebor wrote: On 12/14/2017 03:43 AM, Richard Biener wrote: On Wed, Dec 13, 2017 at 4:47 AM, Martin Sebor wrote: On 12/12/2017 05:35 PM, Jeff Law wrote: On

Re: [compare-debug] use call loc for nop_endbr

2017-12-15 Thread H.J. Lu
On Fri, Dec 15, 2017 at 7:17 AM, Tsimbalist, Igor V wrote: >> -Original Message- >> From: Alexandre Oliva [mailto:aol...@redhat.com] >> Sent: Thursday, December 14, 2017 7:37 PM >> To: Tsimbalist, Igor V >> Cc:

Re: [002/nnn] poly_int: IN_TARGET_CODE

2017-12-15 Thread Jeff Law
On 12/14/2017 06:08 PM, Richard Sandiford wrote: > Jeff Law writes: >> On 10/23/2017 10:58 AM, Richard Sandiford wrote: >>> This patch makes each target-specific TU define an IN_TARGET_CODE macro, >>> which is used to decide whether poly_int<1, C> should convert to C. >>> >>> >>>

Re: [001/nnn] poly_int: add poly-int.h

2017-12-15 Thread Jeff Law
On 12/15/2017 02:08 AM, Richard Biener wrote: > On Fri, Dec 15, 2017 at 4:40 AM, Martin Sebor wrote: >> On 12/07/2017 03:48 PM, Jeff Law wrote: >>> >>> On 12/07/2017 03:38 PM, Richard Sandiford wrote: >>> > So I think that's the final ack on this series.

RE: [compare-debug] use call loc for nop_endbr

2017-12-15 Thread Tsimbalist, Igor V
> -Original Message- > From: Alexandre Oliva [mailto:aol...@redhat.com] > Sent: Thursday, December 14, 2017 7:37 PM > To: Tsimbalist, Igor V > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [compare-debug] use call loc for nop_endbr > > On Dec 14, 2017,

Re: [14/nn] Add helpers for shift count modes

2017-12-15 Thread Richard Sandiford
Richard Biener writes: > On Fri, Dec 15, 2017 at 1:48 AM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Mon, Nov 20, 2017 at 10:02 PM, Richard Sandiford >>> wrote:

Re: [PATCH] Swap affects_type_identity and handler fields in attribute_spec

2017-12-15 Thread Jason Merrill
On Fri, Dec 15, 2017 at 9:18 AM, Jakub Jelinek wrote: > Hi! > > As I said earlier, I'd like to take the opportunity that Martin has added > new field into attribute_spec and all out of tree FEs and backends need > adjustment anyway to swap the affects_type_identity and handler

Re: [PR C++/59930] template friend classes & default args

2017-12-15 Thread Nathan Sidwell
On 12/14/2017 02:31 PM, Nathan Sidwell wrote: PR 59930 concerns some problems with templated friend classes (of templates).  In rying to clean up our handling, I discovered we were accepting default args of such things.  This is ill formed [temp.param]/12 'A default template-argument shall

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread Jason Merrill
On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm wrote: > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: >> On 11/10/2017 04:45 PM, David Malcolm wrote: >> > The initial version of the patch kit added location wrapper nodes >> > around constants and

[PR 81616] Deferring FMA transformations in tight loops

2017-12-15 Thread Martin Jambor
Hello, the patch below prevents creation if fused-multiply-and-add instructions in the widening_mul gimple pass on the Zen-based AMD CPUs and as a result fixes regressions of native znver1 tuning when compared to generic tuning in: - the matrix.c testcase of PR 81616 (straightforward matrix

[PATCH] Swap affects_type_identity and handler fields in attribute_spec

2017-12-15 Thread Jakub Jelinek
Hi! As I said earlier, I'd like to take the opportunity that Martin has added new field into attribute_spec and all out of tree FEs and backends need adjustment anyway to swap the affects_type_identity and handler fields. Previously we had: const char *, 2x int, 3x bool, 1x fnptr, 1x bool, 1x

[Ada] Added warning on membership tests

2017-12-15 Thread Pierre-Marie de Rodat
RM 4.5.3 (28) specifies that (except for records and limited types) a membership operation uses the predefined equality, regardless of whether user-defined equality for the type is available. This can be confusing and deserves a new warning. Compiling code.adb must yield: code.adb:19:42:

[Ada] Spurious alias error on access to array indexed by non-standard enum

2017-12-15 Thread Pierre-Marie de Rodat
This patch prevents the propagation of spurious errors about the prefix of access being non-aliased when getting the access to an array indexed by an enumeration with a custom representation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Justin Squirek

[Ada] Spurious error on equality operator on incomplete type

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on a declaration for an equality operator whose operands have an incomplete type, when the same declarative oart includes another such equality operator on another incomplete type which is used as an actual in an earlier instantiation. Tested on

[Ada] Concurrent types in pragma Initializes

2017-12-15 Thread Pierre-Marie de Rodat
Concurrent types and single concurrent types can now appear in the input list of pragma Initializes as long as the type encloses the pragma. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Hristian Kirtchev * sem_prag.adb

[Ada] Spurious 'W' ALI line due to implicit with clause

2017-12-15 Thread Pierre-Marie de Rodat
This patch "fixes" an issue where an implicit with clause generated to emulate an implicit Elaborate[_All] pragma appears on a 'W' line in the ALI file. As a result, the 'W' line may introduce a spurious build dependency in GPRbuild. -- Source -- -- func.ads function

[Ada] Spurious error and missing warning on static predicate

2017-12-15 Thread Pierre-Marie de Rodat
This patch handles properly a static predicate on a scalar type that is trivially true. Previous to this patch the compiler rejected the predicate on the incorrect grounds that it was not a static expression. Compiling bad_days.ads must yield: bad_days.ads:4:34: warning: predicate is

[Ada] Fix incorrect assignment to array with Component_Size clause

2017-12-15 Thread Pierre-Marie de Rodat
This change fixes a wrong translation of the assignment of an aggregate made up of a single Others choice to an array whose nominal size of the component type is the storage unit and which is subject to a Component_Size clause that effectively bumps this size. The compiler was generating a call

[Ada] Missing error on illegal initialization item

2017-12-15 Thread Pierre-Marie de Rodat
This patch modifies the analysis of pragma Initializes to detect an illegal null initialization item. -- Source -- -- remote.ads package Remote is Y : Integer := 0; end Remote; -- pack.ads with Remote; package Pack with SPARK_Mode, Initializes =>

Re: [05/nn] Add VEC_DUPLICATE_{CST,EXPR} and associated optab

2017-12-15 Thread Richard Biener
On Fri, Dec 15, 2017 at 1:52 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Fri, Dec 15, 2017 at 1:29 AM, Richard Sandiford >> wrote: >>> This patch just adds VEC_DUPLICATE_EXPR, since the

Re: [PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Richard Biener
On Fri, Dec 15, 2017 at 1:35 PM, Bin.Cheng wrote: > On Fri, Dec 15, 2017 at 12:09 PM, Bin.Cheng wrote: >> On Fri, Dec 15, 2017 at 11:55 AM, Richard Biener >> wrote: >>> On Fri, Dec 15, 2017 at 12:30 PM, Bin Cheng

[PATCH] Fix PR77291

2017-12-15 Thread Richard Biener
This adjusts array_at_struct_end_p to more properly adhere to its documentation - if an underlying object constraints the size of the trailing array we still have to return true in case there's room for at least one excess element compared to what the array domain specifies. Bootstrap & regtest

[PATCH] Fix PR81877

2017-12-15 Thread Richard Biener
The following removes safelen handling from LIM - it is not really useful information to it and it was used to derive incorrect conclusions about dependences. Bootstrapped and tested on x86_64-unknown-linux-gnu. I'll commit this on Monday to leave some time for comments (but many are already in

Re: [05/nn] Add VEC_DUPLICATE_{CST,EXPR} and associated optab

2017-12-15 Thread Richard Sandiford
Richard Biener writes: > On Fri, Dec 15, 2017 at 1:29 AM, Richard Sandiford > wrote: >> This patch just adds VEC_DUPLICATE_EXPR, since the VEC_DUPLICATE_CST >> isn't needed with the new VECTOR_CST layout. It's really just the >> original

Re: [PATCH][Middle-end]2nd patch of PR78809 and PR83026

2017-12-15 Thread Wilco Dijkstra
Hi Qing, Just looking at a very high level, I have a few comments: 1. Constant folding str(n)cmp - folding is done separately in fold-const-call.c and gimple-fold.c. There is already code for folding strcmp and strncmp, so we shouldn't need to add new foldings. Or do you have an example

Re: [PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Bin.Cheng
On Fri, Dec 15, 2017 at 12:09 PM, Bin.Cheng wrote: > On Fri, Dec 15, 2017 at 11:55 AM, Richard Biener > wrote: >> On Fri, Dec 15, 2017 at 12:30 PM, Bin Cheng wrote: >>> Hi, >>> As explained in the PR, given below test case:

Re: [PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Bin.Cheng
On Fri, Dec 15, 2017 at 11:55 AM, Richard Biener wrote: > On Fri, Dec 15, 2017 at 12:30 PM, Bin Cheng wrote: >> Hi, >> As explained in the PR, given below test case: >> int a[8][10] = { [2][5] = 4 }, c; >> >> int >> main () >> { >> short b; >>

[PATCH PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md

2017-12-15 Thread Sudakshina Das
Hi This patch fixes the inconsistent behavior observed at -O3 for the unordered comparisons. According to the online docs (https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gccint/Unary-and-Binary-Expressions.html), all of the following should not raise an FP exception: - UNGE_EXPR - UNGT_EXPR -

Re: [PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Richard Biener
On Fri, Dec 15, 2017 at 12:30 PM, Bin Cheng wrote: > Hi, > As explained in the PR, given below test case: > int a[8][10] = { [2][5] = 4 }, c; > > int > main () > { > short b; > int i, d; > for (b = 4; b >= 0; b--) > for (c = 0; c <= 6; c++) > a[c + 1][b + 2] =

[Ada] Verify Part_Of indicator in non-SPARK code

2017-12-15 Thread Pierre-Marie de Rodat
This patch modifies the analysis of Part_Of indicators to verify their associated rules even when the indicator appears in non-SPARK code. This prevents possible tamperings of Part_Of constituents of single concurrent types outside of SPARK code. -- Source -- --

[Ada] Crash on expression function and discriminant-dependent component

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash on an expression function that is a completion, when the return expression includes a reference to a discriminant-dependent component. An expression function that is a completion freezes all types referenced in the expression, but some itypes are excluded because they are

[PATCH PR81740]Enforce dependence check for outer loop vectorization

2017-12-15 Thread Bin Cheng
Hi, As explained in the PR, given below test case: int a[8][10] = { [2][5] = 4 }, c; int main () { short b; int i, d; for (b = 4; b >= 0; b--) for (c = 0; c <= 6; c++) a[c + 1][b + 2] = a[c][b + 1]; for (i = 0; i < 8; i++) for (d = 0; d < 10; d++) if (a[i][d] != (i ==

[PATCH, PR83327] Fix liveness analysis in lra for spilled-into hard regs

2017-12-15 Thread Tom de Vries
[ was: Re: patch to fix PR82353 ] On 12/14/2017 06:01 PM, Vladimir Makarov wrote: On 12/13/2017 07:34 AM, Tom de Vries wrote: On 10/16/2017 10:38 PM, Vladimir Makarov wrote: This is another version of the patch to fix     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82353 The patch was

[Ada] Reject certain constants as constituents

2017-12-15 Thread Pierre-Marie de Rodat
This patch updates the analysis of pragma Refined_State to reject constants which are used as refinement constituents and are either * Part of the visible state of a package * Part of the hidden state of a package, and lack indicator Part_Of. -- Source -- --

[Ada] Optimizing allocators for arrays with non-static upper bound

2017-12-15 Thread Pierre-Marie de Rodat
This patch extends the optimization of allocators for arrays of non-controlled components, when the qualified expression for the aggregate has an unconstrained type and the upper bound of the aggregte is non-static. In this case it is safe to build the array in the allocated object, instead of

[Ada] Spurious warning on default initialized object

2017-12-15 Thread Pierre-Marie de Rodat
This patch updates the implications that pragma Default_Initial_Condition has on full default initialization of objects and types. According to the SPARK RM, the pragma may appear without an expression 7.3.3 The aspect_definition may be omitted; this is semantically equivalent to

Re: [PATCH] Further improvements for the (T)(P+A)-(T)(P+B) folding (PR sanitizer/81281)

2017-12-15 Thread Richard Biener
On Fri, 15 Dec 2017, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 10:28:52AM +0100, Richard Biener wrote: > > > --- gcc/match.pd.jj 2017-12-07 14:00:51.083048186 +0100 > > > +++ gcc/match.pd 2017-12-07 15:17:49.132784931 +0100 > > > @@ -1784,8 +1784,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN

Re: [PATCH] Further improvements for the (T)(P+A)-(T)(P+B) folding (PR sanitizer/81281)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 10:28:52AM +0100, Richard Biener wrote: > > --- gcc/match.pd.jj 2017-12-07 14:00:51.083048186 +0100 > > +++ gcc/match.pd2017-12-07 15:17:49.132784931 +0100 > > @@ -1784,8 +1784,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > > > >/* (T)(P + A) - (T)P -> (T) A */ > >

Re: [PATCH] Fix PR83388

2017-12-15 Thread Richard Biener
On Fri, 15 Dec 2017, Jakub Jelinek wrote: > On Fri, Dec 15, 2017 at 11:08:43AM +0100, Richard Biener wrote: > > --- gcc/internal-fn.def (revision 255678) > > +++ gcc/internal-fn.def (working copy) > > @@ -254,6 +254,9 @@ DEF_INTERNAL_FN (LAUNDER, ECF_LEAF | ECF > > /* Divmod function.

Re: [patch] More robust fix for PR target/66488

2017-12-15 Thread Richard Biener
On Fri, Dec 15, 2017 at 10:38 AM, Eric Botcazou wrote: > Hi, > > this PR was about the blow-up of the garbage collector on x86_64-w64-mingw32 > when more than 3 GB are allocated. The fix was to set HOST_BITS_PER_PTR to > the appropriate value (64) in

Re: [PATCH] Avoid excessive function type casts with splay-trees

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 10:44:54AM +, Bernd Edlinger wrote: > when working on the -Wcast-function-type patch I noticed some rather > ugly and non-portable function type casts that are necessary to accomplish > some actually very simple tasks. > > Often functions taking pointer arguments are

[PATCH] Avoid excessive function type casts with splay-trees

2017-12-15 Thread Bernd Edlinger
Hi, when working on the -Wcast-function-type patch I noticed some rather ugly and non-portable function type casts that are necessary to accomplish some actually very simple tasks. Often functions taking pointer arguments are called with a different signature taking uintptr_t arguments, which is

Re: [PATCH] Fix PR83388

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 11:08:43AM +0100, Richard Biener wrote: > --- gcc/internal-fn.def (revision 255678) > +++ gcc/internal-fn.def (working copy) > @@ -254,6 +254,9 @@ DEF_INTERNAL_FN (LAUNDER, ECF_LEAF | ECF > /* Divmod function. */ > DEF_INTERNAL_FN (DIVMOD, ECF_CONST |

[Ada] Crash on subprogram instantiation in nested package

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash on a subpogram instance that appears within a package that declares the actual type for the instance, when the corresponding type is a private or incomplete formal type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada 2017-12-15 Ed Schonberg

[Ada] Ignore external calls from instances for elaboration

2017-12-15 Thread Pierre-Marie de Rodat
This patch restores the functionality of debug switch -gnatdL to the behavior prior to revision 255412. The existing behavior has been associated with switch -gnatd_i. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ 2017-12-15 Hristian Kirtchev *

[Ada] Completing expression function need not trigger loading of package body

2017-12-15 Thread Pierre-Marie de Rodat
This patch prevents expression functions which complete previous declarations in a package spec from loading the body of the package spec on the basis that the expression function body is needed for inlining. This in turn prevents the generation of spurious dependencies on units in ALI files.

[Ada] Compiler crash with -gnatd.1 (force unnesting of subprograms)

2017-12-15 Thread Pierre-Marie de Rodat
This patch fixes a crash in the compiler when enabling unnesting of subprograms on a generic unit. The following must compile quietly: gcc -c -gnatg -gnatd.1 a-btgbso.adb Tested on x86_64-pc-linux-gnu, committed on trunk 2017-12-15 Ed Schonberg * exp_unst.adb

[PATCH] Fix PR83388

2017-12-15 Thread Richard Biener
The following fixes removal of sanitizer IFN calls during LTO streaming in when not linking with -fsanitize= to not interfer with IPA reference nodes that might be attached to those stmts. The easiest idea I could come up with that would also work with IPA passes refering to those refs is to

Re: [PATCH][ARM][gcc-7] Fix regression on soft float targets for armv8_2-fp16-move-2.c

2017-12-15 Thread Sudakshina Das
Hi On 14/12/17 18:26, Kyrill Tkachov wrote: On 14/12/17 18:17, Sudi Das wrote: Hi On 14/12/17 17:37, Christophe Lyon wrote: > On 14 December 2017 at 17:05, Sudakshina Das wrote: >> Hi >> >> This patch is a follow up on my previous patch with r255536 that was a >> back-port

Re: [PATCH] Use tail calls to memcpy/memset even for structure assignments (PR target/41455, PR target/82935)

2017-12-15 Thread Jakub Jelinek
On Fri, Dec 15, 2017 at 10:30:32AM +0100, Richard Biener wrote: > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Hum, it doesn't look pretty ;) Can we defer this to stage1 given > it's a long-standing issue and we have quite big changes going in still? Ok, deferred.

[Ada] Fix inconsistent usage of Machine in s-fatgen.adb

2017-12-15 Thread Pierre-Marie de Rodat
System.Fat_Gen is a generic unit implementing support routines for floating- point attributes, for example the 'Machine attribute. These routines make themselves use of the 'Machine attribute, some of them by calling the Machine support routine directly, some others by using the attribute.

[patch] More robust fix for PR target/66488

2017-12-15 Thread Eric Botcazou
Hi, this PR was about the blow-up of the garbage collector on x86_64-w64-mingw32 when more than 3 GB are allocated. The fix was to set HOST_BITS_PER_PTR to the appropriate value (64) in config/i386/xm-mingw32.h. This means that the same issue can happen on other P64 hosts so the attached

  1   2   >