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: [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 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][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: [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: [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

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] 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 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 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 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: [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 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: > > >

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

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

[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

<    1   2