[PATCH 6/9] sel-sched: Don't mess with register restores

2016-07-31 Thread Segher Boessenkool
If selective scheduling copies register restores it confuses dwarf2cfi. 2016-06-07 Segher Boessenkool * sel-sched-ir.c (init_global_and_expr_for_insn): Don't copy instructions with a REG_CFA_RESTORE note. --- gcc/sel-sched-ir.c | 1 + 1 file

[PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-07-31 Thread Segher Boessenkool
Unfortunately even after the previous patch there are still a few cases where regrename creates invalid code when used together with separate shrink-wrapping. At noreturn exits regrename thinks it can use all callee-saved registers, but that is not true. This patch disables regrename for

[PATCH 8/9] shrink-wrap: shrink-wrapping for separate components

2016-07-31 Thread Segher Boessenkool
This is the main substance of this patch series. Instead of doing all of the prologue and epilogue in one spot, it often is better to do components of it at different places, so that they are executed less frequently. What exactly is a component is completely up to the target; this code treats

[PATCH 7/9] cprop: Leave RTX_FRAME_RELATED_P instructions alone

2016-07-31 Thread Segher Boessenkool
Doing cprop on frame-related instructions blows up spectacularly. So don't. 2016-06-07 Segher Boessenkool * regcprop.c (copyprop_hardreg_forward_1): Don't change RTX_FRAME_RELATED_P instructions. --- gcc/regcprop.c | 4 1 file changed, 4

[PATCH 4/9] regrename: Don't rename restores

2016-07-31 Thread Segher Boessenkool
A restore is supposed to restore some certain register. Restoring it into some other register will not work. Don't. 2016-06-07 Segher Boessenkool * regrename.c (build_def_use): Invalidate chains that have a REG_CFA_RESTORE on some instruction. ---

[PATCH 9/9] rs6000: Separate shrink-wrapping

2016-07-31 Thread Segher Boessenkool
This implements the hooks for separate shrink-wrapping for rs6000. It handles GPRs and LR. The GPRs get a component number corresponding to their register number; LR gets component number 0. This improves specint by 1.8%, specfp by 0.5%, separate benchmarks much more. It improves the hot path

[PATCH 2/9] cfgcleanup: Don't confuse CFI when -fshrink-wrap-separate

2016-07-31 Thread Segher Boessenkool
cfgcleanup would try to join noreturn paths with different components handled. This then fails in dwarf2cfi. 2016-06-07 Segher Boessenkool * cfgcleanup.c (outgoing_edges_match): Don't join noreturn calls if shrink_wrapped_separate. ---

[PATCH 1/9] separate shrink-wrap: New command-line flag, status flag, hooks, and doc

2016-07-31 Thread Segher Boessenkool
This patch adds a new command-line flag "-fshrink-wrap-separate", a status flag "shrink_wrapped_separate", hooks for abstracting the target components, and documentation for all those. 2016-06-07 Segher Boessenkool * common.opt (-fshrink-wrap-separate): New

[PATCH 3/9] dce: Don't dead-code delete separately wrapped restores

2016-07-31 Thread Segher Boessenkool
Deleting restores (before a noreturn) that are dead confuses dwarf2cfi. 2016-06-07 Segher Boessenkool * dce.c (delete_unmarked_insns): Don't delete instructions with a REG_CFA_RESTORE note. --- gcc/dce.c | 9 + 1 file changed, 9

[PATCH v2 0/9] Separate shrink-wrapping

2016-07-31 Thread Segher Boessenkool
This is the second version. Concern was renamed to component, and all other comments were addressed (I hope). It still uses only two bitmaps for the component placement, but now they are called needs_components and has_components, which hopefully is easier to follow. The "can this prologue be

Re: [PATCH] Replacing gcc's dependence on libiberty's fnmatch to gnulib's fnmatch

2016-07-31 Thread Manuel López-Ibáñez
On 31 July 2016 at 23:39, Joseph Myers wrote: > On Sat, 30 Jul 2016, Manuel López-Ibáñez wrote: > >> > Building for different targets is fairly irrelevant here; the issue is >> > building for different hosts, which is harder. >> >> What about my suggestion of forcing GCC

Re: [PATCH] Replacing gcc's dependence on libiberty's fnmatch to gnulib's fnmatch

2016-07-31 Thread Joseph Myers
On Sat, 30 Jul 2016, Manuel López-Ibáñez wrote: > > Building for different targets is fairly irrelevant here; the issue is > > building for different hosts, which is harder. > > What about my suggestion of forcing GCC to use the gnulib functions by > temporarily removing the system-wide

Re: [patch] Some testsuite cleanup

2016-07-31 Thread Jonathan Wakely
On 31/07/16 20:21 +0100, Jonathan Wakely wrote: (I'm getting really annoyed with line numbers matching columns!) testsuite/20_util/pair/cons/explicit_construct.cc is another one where this happens. If you remove a blank line near the top of the file it starts FAILing, because the error at

Re: [PATCH] accept flexible arrays in struct in unions (c++/71912 - [6/7 regression])

2016-07-31 Thread Martin Sebor
On 07/31/2016 10:28 AM, Jason Merrill wrote: On Fri, Jul 29, 2016 at 7:22 PM, Martin Sebor wrote: On 07/26/2016 12:53 PM, Jason Merrill wrote: On 07/23/2016 01:18 PM, Martin Sebor wrote: + /* A pair of the first non-static non-empty data members following + either

[PATCH] Change std::conditional test to compile-only

2016-07-31 Thread Jonathan Wakely
This can use static_assert instead of a runtime assert(). * testsuite/20_util/conditional/requirements/typedefs.cc: Change to compile-only test. Tested x86_64-linux, committed to trunk. commit 26ae1ac1207f9cdc6d533eaa3c0786a2a09f5dac Author: Jonathan Wakely

Re: [patch] Some testsuite cleanup

2016-07-31 Thread Jonathan Wakely
On 28/07/16 22:06 +0100, Jonathan Wakely wrote: The dg-options for FreeBSD and Dragonfly should have included -std=gnu++11, or should have used dg-additional-options to add to, rather than override, the common dg-options. Use dg-additional-options in libstdc++ tests *

Re: [patch] Some testsuite cleanup

2016-07-31 Thread Jonathan Wakely
On 28/07/16 22:06 +0100, Jonathan Wakely wrote: The dg-prune-output directives in these tests are needed to prune some additional errors that are only issued in C++98 mode, but the line numbers had got out of date. I've replaced the hardcoded numbers with strings that will stay valid. Fix DR

Re: [PATCH] Fix non-portable std::regex test and test more cases

2016-07-31 Thread Jonathan Wakely
On 31/07/16 19:46 +0100, Jonathan Wakely wrote: diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc index 5625653..758f216 100644 ---

[PATCH] Fix non-portable std::regex test and test more cases

2016-07-31 Thread Jonathan Wakely
This test uses \n inside a raw string literal, which is not a newline but just a backslash followed by 'n', and that's not a valid POSIX BRE so the test fails when run with -std=c++11 rather than -std=gnu++11. I've replaced \n with newlines, and also tested the "expected fail" string, which

Re: [PATCH] libstdc++/72745 add static assertion for invalid tuple access

2016-07-31 Thread Jonathan Wakely
On 31/07/16 18:10 +0100, Jonathan Wakely wrote: PR libstdc++/72745 * include/std/array (get): Use positive message for static assertions. * include/std/functional (_Safe_tuple_element_t): Fix indentation. * include/std/tuple (tuple_element>): Add

Re: [RFC] warn on dead function calls in ipa-pure-const [1/4]

2016-07-31 Thread Prathamesh Kulkarni
On 31 July 2016 at 22:01, Jan Hubicka wrote: >> On Tue, 26 Jul 2016, Prathamesh Kulkarni wrote: >> >> > + warning_at (gimple_location (g), OPT_Wunused_value, >> > + "Call from %s to %s has no effect", >> > + e->caller->name (), e->callee->name ()); >>

[PATCH] libstdc++/72745 add static assertion for invalid tuple access

2016-07-31 Thread Jonathan Wakely
PR libstdc++/72745 * include/std/array (get): Use positive message for static assertions. * include/std/functional (_Safe_tuple_element_t): Fix indentation. * include/std/tuple (tuple_element>): Add partial specialization for invalid indices,

[PATCH] Move dg-error directives to relevant lines

2016-07-31 Thread Jonathan Wakely
I'm moving { dg-error "..." "" { target *-*-* } NN } to line NN so it can just be { dg-error "..." } with an implied line number. That makes the tests less fragile if the test changes and the line moves. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Move dg-error to

Re: [RFC] warn on dead function calls in ipa-pure-const [1/4]

2016-07-31 Thread Jan Hubicka
> On Tue, 26 Jul 2016, Prathamesh Kulkarni wrote: > > > + warning_at (gimple_location (g), OPT_Wunused_value, > > + "Call from %s to %s has no effect", > > + e->caller->name (), e->callee->name ()); > > Diagnostics should not start with capital letters. Function

Re: [PATCH] accept flexible arrays in struct in unions (c++/71912 - [6/7 regression])

2016-07-31 Thread Jason Merrill
On Fri, Jul 29, 2016 at 7:22 PM, Martin Sebor wrote: On 07/26/2016 12:53 PM, Jason Merrill wrote: On 07/23/2016 01:18 PM, Martin Sebor wrote: + /* A pair of the first non-static non-empty data members following + either the flexible array member, if found, or the

Re: [PATCH RFC] do not throw in std::make_exception_ptr

2016-07-31 Thread Gleb Natapov
On Sun, Jul 31, 2016 at 02:28:51PM +0100, Jonathan Wakely wrote: > On 28/07/16 10:20 +0300, Gleb Natapov wrote: > > [resent with hopefully correct libstdc++ mailing list address this time] > > > > Here is my attempt to fix > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68297. The resulting

Re: [PATCH RFC] do not throw in std::make_exception_ptr

2016-07-31 Thread Jonathan Wakely
On 28/07/16 10:20 +0300, Gleb Natapov wrote: [resent with hopefully correct libstdc++ mailing list address this time] Here is my attempt to fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68297. The resulting patch is a little bit long because I had to split and cxxabi.h include files. The

Re: [v3 PATCH] Implement C++17 variable templates for type traits.

2016-07-31 Thread Jonathan Wakely
On 31/07/16 15:50 +0300, Ville Voutilainen wrote: diff --git a/libstdc++-v3/include/bits/uses_allocator.h b/libstdc++-v3/include/bits/uses_allocator.h index b1ff58a..8fdeda7 100644 --- a/libstdc++-v3/include/bits/uses_allocator.h +++ b/libstdc++-v3/include/bits/uses_allocator.h @@ -108,8

[PATCH] Check __STRICT_ANSI__ for 128-bit arithmetic types

2016-07-31 Thread Jonathan Wakely
The library specializations for __int128 and __float128 are not defined when __STRICT_ANSI__ is defined, so some tests fail when compiled with -std=c++NN rather than -std=gnu++NN. This lets them pass. * testsuite/18_support/numeric_limits/40856.cc [__STRICT_ANSI__]: Do not test

[PATCH] Fix file extension of libstdc++ test

2016-07-31 Thread Jonathan Wakely
* testsuite/26_numerics/headers/cstdlib/54686.c: Rename to 54686.cc. There doesn't seem to be any reason for this file to have a .c extensions, so I've renamed it. Committed to trunk. commit 5c2f6316e6d2c8d1d0d4817e7e5850758dcf714c Author: redi

Re: [v3 PATCH] Implement C++17 variable templates for type traits.

2016-07-31 Thread Ville Voutilainen
On 31 July 2016 at 14:53, Ville Voutilainen wrote: >> Somebody didn't run the whole testsuite. > I will send a patch shortly. I'm finishing testing this patch on Linux-PPC64. 2016-07-31 Ville Voutilainen Add missing variable

Re: [v3 PATCH] Implement C++17 variable templates for type traits.

2016-07-31 Thread Ville Voutilainen
On 31 July 2016 at 14:49, Jonathan Wakely wrote: > A number of tests are now failing because their dg-error lines need > adjusting: > > FAIL: 20_util/declval/requirements/1_neg.cc (test for errors, line 2259) > FAIL: 20_util/declval/requirements/1_neg.cc (test for excess

Re: [v3 PATCH] Implement C++17 variable templates for type traits.

2016-07-31 Thread Jonathan Wakely
On 29/07/16 22:47 +0300, Ville Voutilainen wrote: Argh, I missed uses_allocator_v, is_placeholder_v and is_bind_expression_v, aka the ones in and . I'll send a follow-up patch in a week or so unless someone else fixes those in the meanwhile. :) A number of tests are now failing because their

Re: [PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-07-31 Thread Andris Pavenis
On 07/31/2016 10:57 AM, Arnaud Charlet wrote: Frankly at this stage, I do not think it makes sense to maintain an Ada port for DJGPP and in particular maintain all these extra special cases and #ifdefs. I don't think this is a reasonable attitude to take with people who are willing to do the

Re: [PATCH] Fix wrong code on aarch64 due to paradoxical subreg

2016-07-31 Thread Bernd Edlinger
On 07/31/16 12:43, Bernd Edlinger wrote: > I found out that the trouble starts one instruction earlier: > > (insn 19 40 20 2 (set (subreg:DI (reg:QI 93) 0) > ) pr.c:8 50 {*movdi_aarch64} > (expr_list:REG_DEAD (reg:DI 110 [ D.3037 ]) > (nil))) > oops, my e-mail missed one

Re: [PATCH] Fix wrong code on aarch64 due to paradoxical subreg

2016-07-31 Thread Bernd Edlinger
On 07/30/16 13:39, Segher Boessenkool wrote: > On Sat, Jul 30, 2016 at 08:17:59AM +, Bernd Edlinger wrote: >> Ok, I the incorrect REG_POINTER is done here: >> >> cse_main -> reg_scan -> reg_scan_mark_refs -> set_reg_attrs_from_value >> >> and here I see a bug, because if

Re: [PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-07-31 Thread Arnaud Charlet
> > Frankly at this stage, I do not think it makes sense to maintain an > > Ada port for DJGPP and in particular maintain all these extra > > special cases and #ifdefs. > > I don't think this is a reasonable attitude to take with people who > are willing to do the work to do it. OK, let me