Re: [PATCH] Fix PR55152

2016-10-05 Thread Richard Biener
On Tue, 4 Oct 2016, Joseph Myers wrote: > On Tue, 4 Oct 2016, Richard Biener wrote: > > > On Tue, 4 Oct 2016, Joseph Myers wrote: > > > > > On Tue, 4 Oct 2016, Richard Biener wrote: > > > > > > > Possibly. Though then for FP we also want - abs (a) -> copysign (a, > > > > -1). > > > > > > For

Re: [PATCH] Remove .jcr registry from the crtfiles

2016-10-05 Thread Andreas Schwab
* config/ia64/crtbegin.S (__do_jv_register_classes): Remove. (.section .init_array): Don't call __do_jv_register_classes. (.section .init): Likewise. diff --git a/libgcc/config/ia64/crtbegin.S b/libgcc/config/ia64/crtbegin.S index 3bf0e71a3a..cee0cf567d 100644 --- a/libgcc/

Re: [PATCH] DWARF: remove pessimistic DWARF version checks for imported entities

2016-10-05 Thread Pierre-Marie de Rodat
On 10/04/2016 09:50 PM, Jason Merrill wrote: OK. On 10/05/2016 06:53 AM, Dominique d'Humières wrote: The new patch works on darwin without new regression. Thank you both for your help! This is now comitted. -- Pierre-Marie de Rodat

Re: [PATCH] Remove .jcr registry from the crtfiles

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 09:52:31AM +0200, Andreas Schwab wrote: > * config/ia64/crtbegin.S (__do_jv_register_classes): Remove. > (.section .init_array): Don't call __do_jv_register_classes. > (.section .init): Likewise. Oops, sorry for missing that. The patch is ok. > > diff --

Re: [RFC][PATCH] Canonicalize address multiplies

2016-10-05 Thread Richard Biener
On Tue, Oct 4, 2016 at 2:53 PM, Wilco Dijkstra wrote: > GCC currently doesn't canonicalize address expressions. As a result > inefficient code is generated even for trivial index address expressions, > blocking CSE and other optimizations: > > int f(int *p, int i) { return p[i+2] + p[i+1]; } > >

Re: [PATCH] Move strchr folding to gimple-fold

2016-10-05 Thread Richard Biener
On Tue, Oct 4, 2016 at 7:20 PM, Wilco Dijkstra wrote: > As suggested in https://gcc.gnu.org/ml/gcc-patches/2016-09/msg02216.html, > move all existing strchr and strrchr folding from builtins.c to gimple-fold.c. > > Passes C/C++ regression & bootstrap. Ok. Thanks, Richard. > 2016-10-04 Wilco Di

Re: [EVRP] Fold stmts with vrp_fold_stmt

2016-10-05 Thread Richard Biener
On Wed, 5 Oct 2016, kugan wrote: > Hi Richard, > Thanks for the review. > > On 04/10/16 19:56, Richard Biener wrote: > > On Tue, 4 Oct 2016, kugan wrote: > > > > > Hi, > > > > > > This patch improves Early VRP by folding stmts using vrp_fold_stmt as it > > > is > > > done in ssa_propagate for V

Re: [C++ PATCH] Delete GCJ - C++ part

2016-10-05 Thread Andreas Schwab
FAIL: g++.dg/pr49847-2.C -std=gnu++11 (test for excess errors) Excess errors: /daten/aranym/gcc/gcc-20161005/gcc/testsuite/g++.dg/pr49847-2.C:5:13: error: '__java_int' does not name a type /daten/aranym/gcc/gcc-20161005/gcc/testsuite/g++.dg/pr49847-2.C:6:13: error: '__java_float

Re: [C++ PATCH] Delete GCJ - C++ part

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 11:04:05AM +0200, Andreas Schwab wrote: > FAIL: g++.dg/pr49847-2.C -std=gnu++11 (test for excess errors) > Excess errors: > /daten/aranym/gcc/gcc-20161005/gcc/testsuite/g++.dg/pr49847-2.C:5:13: error: > '__java_int' does not name a type > /date

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 08:58:08AM +0200, Marc Glisse wrote: > On Tue, 4 Oct 2016, Jason Merrill wrote: > > > C++17 adds the ability to omit the template arguments for a class > > template when declaring a variable with an initializer, much like auto > > but supporting a wider variety of initializ

[PATCH] Fix PR77842

2016-10-05 Thread Richard Biener
Committed as obvious. Richard. 2016-10-05 Richard Biener PR middle-end/77842 * genmatch.c (parser::parse_c_expr): Handle premature EOF. Index: gcc/genmatch.c === --- gcc/genmatch.c (revision 240770) +++ gcc

Re: [PATCH] add uClibc target hook (PR bootstrap/77819)

2016-10-05 Thread Bernd Schmidt
On 10/04/2016 10:25 PM, Martin Sebor wrote: Sounds good. Attached is an updated patch reflecting these changes. Restested by building the powerpc64-linux and tic6x-uclinux cross toolchains. (Sharing the Glibc and uClibc implementation of the target hook and defining it in targhooks.c also obvi

Re: [PATCH] Tree-level fix for PR 69526

2016-10-05 Thread Robin Dapp
Ping.

Re: [PATCH] Fix PR55152

2016-10-05 Thread Richard Biener
On Wed, 5 Oct 2016, Richard Biener wrote: > On Tue, 4 Oct 2016, Joseph Myers wrote: > > > On Tue, 4 Oct 2016, Richard Biener wrote: > > > > > On Tue, 4 Oct 2016, Joseph Myers wrote: > > > > > > > On Tue, 4 Oct 2016, Richard Biener wrote: > > > > > > > > > Possibly. Though then for FP we also

[PATCH] PR 70564 disambiguate constructors for not_fn call wrapper

2016-10-05 Thread Jonathan Wakely
The _Not_fn::_Not_fn<_Fn2>(_Fn2&&) ctor gets chosen by overload resolution when trying to copy the call wrapper object (although only for direct-initialization, because it's explicit). Rather than constraining it using SFINAE I'm just adding a second parameter, so it isn't viable for copying or mo

[PATCH] Remove invalid alias declaration from _Node_handle

2016-10-05 Thread Jonathan Wakely
This alias-declaration isn't valid (it should go through allocator_traits) but isn't needed anyway. * include/bits/node_handle.h (_Node_handle): Remove invalid and unused alias declaration. Tested powerpc64le-linux, committing to trunk. commit 7ba39a821c7af0991abdec3f071d8f12706

Re: [PATCH] Fix PR77826

2016-10-05 Thread Richard Biener
On Tue, 4 Oct 2016, Richard Biener wrote: > > The following will fix PR77826, the issue that in match.pd matching > up two things uses operand_equal_p which is too lax about the type > of the toplevel entity (at least for integer constants). > > Bootstrap / regtest pending on x86_64-unknown-linu

[PATCH] 77864 Fix noexcept conditions for map/set default constructors

2016-10-05 Thread Jonathan Wakely
I added conditional noexcept to maps and sets, but forgot to account for the comparison function, which could throw when constructed. PR libstdc++/77864 * include/bits/stl_map.h (map::map()): Use nothrow constructibility of comparison function in conditional noexcept.

[PATCH] Fix PR77863

2016-10-05 Thread Richard Biener
Applied as obvious. Richard. 2016-10-05 Richard Biener PR middle-end/77863 * genmatch.c (capture_info::walk_c_expr): Diagnose unknown capture ids in c-exprs. Index: gcc/genmatch.c === --- gcc/genmatch.c

[PATCH] PR 70101 fix allocator-extended ctors for std::priority_queue

2016-10-05 Thread Jonathan Wakely
These constructors were just completely borked. PR libstdc++/70101 * include/bits/stl_queue.h (priority_queue): Fix allocator-extended constructors. * testsuite/23_containers/priority_queue/allocator.cc: New test. Tested powerpc64le-linux, committing to trunk and

Re: [PATCH] 77864 Fix noexcept conditions for map/set default constructors

2016-10-05 Thread Marc Glisse
On Wed, 5 Oct 2016, Jonathan Wakely wrote: I added conditional noexcept to maps and sets, but forgot to account for the comparison function, which could throw when constructed. IMO you are fighting a losing battle. We should implement noexcept(auto) (possibly with some private __noexcept_auto

[PATCH] Fix ICE for sparc targets in function_arg_record_value (PR target/77759)

2016-10-05 Thread James Clarke
gcc/ PR target/77759 * config/sparc/sparc.c (classify_data_t): Remove unused int_regs field. (classify_registers): Don't set int_regs. (function_arg_slotno): Don't initialise int_regs. Check slotno is within range for empty structs, just like int register-onl

Re: [PATCH] 77864 Fix noexcept conditions for map/set default constructors

2016-10-05 Thread Jonathan Wakely
On 05/10/16 14:10 +0200, Marc Glisse wrote: On Wed, 5 Oct 2016, Jonathan Wakely wrote: I added conditional noexcept to maps and sets, but forgot to account for the comparison function, which could throw when constructed. IMO you are fighting a losing battle. We should implement noexcept(auto

Re: [BUILDROBOT] Selftest failed for i686-wrs-vxworks

2016-10-05 Thread Thomas Schwinge
Hi! I've now also run into this issue, during contrib/config-list.mk testing; log/arm-wrs-vxworks-make.out, log/i686-wrs-vxworks-make.out, log/i686-wrs-vxworksae-make.out, log/mips-wrs-vxworks-make.out, log/powerpc-wrs-vxworks-make.out, log/powerpc-wrs-vxworksae-make.out, log/powerpc-wrs-vxworksmi

Re: [PATCH] PR 70564 disambiguate constructors for not_fn call wrapper

2016-10-05 Thread Jonathan Wakely
On 05/10/16 12:31 +0100, Jonathan Wakely wrote: diff --git a/libstdc++-v3/testsuite/20_util/not_fn/1.cc b/libstdc++-v3/testsuite/20_util/not_fn/1.cc index 375c7cc..8d6e9ec 100644 --- a/libstdc++-v3/testsuite/20_util/not_fn/1.cc +++ b/libstdc++-v3/testsuite/20_util/not_fn/1.cc @@ -84,6 +84,12 @@

Re: [PATCH] PR 70564 disambiguate constructors for not_fn call wrapper

2016-10-05 Thread Jonathan Wakely
On 05/10/16 12:31 +0100, Jonathan Wakely wrote: Tested powerpc64le-linux, committing to trunk and gcc-6-branch. And here's the slightly diffeernt patch for the branch (because we only have experimental::not_fn there, not std::not_fn). commit 2484aeb5b25372c3a7833a000b798e3bf6f41c6b Author: re

C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Marek Polacek
This is my attempt to implement P0305R1, Selection statements with initializer. It allows the users to write if (init; cond) // ... which is equivalent to { init if (cond) // ... } Similarly for if-else, if constexpr, and switch. The approach I had taken was to tentatively parse

Compile-time improvement for if conversion.

2016-10-05 Thread Yuri Rumyantsev
Hi All, Here is implementation of Richard proposal: < For general infrastructure it would be nice to expose a (post-)dominator < compute for MESE (post-dominators) / SEME (dominators) regions. I believe < what makes if-conversion expensive is the post-dom compute which happens < for each loop fo

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 03:14:25PM +0200, Marek Polacek wrote: > This is my attempt to implement P0305R1, Selection statements with > initializer. > It allows the users to write > > if (init; cond) // ... > > which is equivalent to > > { > init > if (cond) // ... > } Well, it isn

[PATCH,committed] PR77847: Add FALLTRHOUGH comment to fix build error

2016-10-05 Thread Kelvin Nilsen
This trivial/obvious patch was committed without review as svn revision 240783. The patch fixes a compile-time error that recently surfaced with big-endian Power architecture builds. libcpp/ChangeLog: 2016-10-04 Kelvin Nilsen PR target/77847 * lex.c (search_line_fast): Add a

Re: [PATCH] Remove x86 pcommit instruction

2016-10-05 Thread Andrew Senkevich
> -mpcommit > -Target Report Mask(ISA_PCOMMIT) Var(ix86_isa_flags) Save > -Support PCOMMIT instruction. > - > > You should not simply delete a option that was in the released > compiler, but a warning should be emitted instead. Please see how > msse5 is handled in i386.opt. Thank you, it is fixed

Re: [Patch, libgfortran] Inquire internal unit within child dtio procedure

2016-10-05 Thread Dominique d'Humières
Dear Jerry, > Committed as trivial. Many things are trivial unless noted otherwise! The patch causes the following failures: FAIL: gfortran.dg/inquire_13.f90 -O0 execution test FAIL: gfortran.dg/inquire_15.f90 -O0 execution test FAIL: gfortran.dg/inquire_6.f90 -O0 execution test FAIL:

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 5:29 AM, Marek Polacek wrote: > On Wed, Oct 05, 2016 at 08:58:08AM +0200, Marc Glisse wrote: >> On Tue, 4 Oct 2016, Jason Merrill wrote: >> >> > C++17 adds the ability to omit the template arguments for a class >> > template when declaring a variable with an initializer, muc

[PATCH][fold-const] Fix native_encode_real for HFmode constants

2016-10-05 Thread Kyrill Tkachov
Hi all, I encountered a wrong-code issue with my WIP store merging pass when it was trying to encode HFmode constants. I am using native_encode_real to write the constants to a byte array and it's breaking on big-endian. For a 2-byte constant it ended up writing bytes at offsets 3 and 2 rather

Re: [BUILDROBOT] Selftest failed for i686-wrs-vxworks

2016-10-05 Thread David Malcolm
On Wed, 2016-10-05 at 14:34 +0200, Thomas Schwinge wrote: > Hi! > > I've now also run into this issue, during contrib/config-list.mk > testing; > log/arm-wrs-vxworks-make.out, log/i686-wrs-vxworks-make.out, > log/i686-wrs-vxworksae-make.out, log/mips-wrs-vxworks-make.out, > log/powerpc-wrs-vxworks

[PATCH] Non-backwards compatible improvements to std::deque

2016-10-05 Thread Jonathan Wakely
This is a proof-of-concept showing how we can fix some known deficiencies in std::deque (24693, 77524, throwing moves) for builds using --enable-symvers=gnu-versioned-namespace, which don't need to preserve ABI compatibility. I'm also considering defining an allocator adaptor that would also enab

Re: [RFC] Extend ipa-bitwise-cp with pointer alignment propagation

2016-10-05 Thread Martin Jambor
Hi, sorry, my main desktop disk has died (a slow but certain) death so I am not particularly responsive either. On Tue, Oct 04, 2016 at 12:37:38AM +0530, Prathamesh Kulkarni wrote: > On 22 September 2016 at 17:26, Jan Hubicka wrote: > > Yes, can you please verify that alignments it computes are

Re: [PATCH][fold-const] Fix native_encode_real for HFmode constants

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 04:06 PM, Kyrill Tkachov wrote: The fix in this patch makes the logic in native_encode_real match the logic in native_interpret_real, I just copied the logic across. Looks reasonable to me. Ok. Bernd

Re: [BUILDROBOT] Selftest failed for i686-wrs-vxworks

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 04:14 PM, David Malcolm wrote: Thanks. I'm not able to formally approve these changes, but FWIW these patches look good to me (assuming usual testing). LGTM too, so OK. Bernd

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Marc Glisse
On Wed, 5 Oct 2016, Jason Merrill wrote: On Wed, Oct 5, 2016 at 5:29 AM, Marek Polacek wrote: On Wed, Oct 05, 2016 at 08:58:08AM +0200, Marc Glisse wrote: On Tue, 4 Oct 2016, Jason Merrill wrote: C++17 adds the ability to omit the template arguments for a class template when declaring a var

Re: C++ PATCH for C++17 class template placeholders

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 10:47 AM, Marc Glisse wrote: > On Wed, 5 Oct 2016, Jason Merrill wrote: >> On Wed, Oct 5, 2016 at 5:29 AM, Marek Polacek wrote: >>> On Wed, Oct 05, 2016 at 08:58:08AM +0200, Marc Glisse wrote: On Tue, 4 Oct 2016, Jason Merrill wrote: > C++17 adds the ability t

Re: [Patch, libgfortran] Inquire internal unit within child dtio procedure

2016-10-05 Thread Jerry DeLisle
On 10/05/2016 06:47 AM, Dominique d'Humières wrote: Dear Jerry, Committed as trivial. Many things are trivial unless noted otherwise! The patch causes the following failures: FAIL: gfortran.dg/inquire_13.f90 -O0 execution test FAIL: gfortran.dg/inquire_15.f90 -O0 execution test FAIL:

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 9:14 AM, Marek Polacek wrote: > +/* Return true if we're looking at (init; cond), false otherwise. */ > + > +static bool > +cp_parser_init_statement_p (cp_parser *parser) > +{ > + unsigned paren_depth = 0; > + unsigned brace_depth = 0; Do we really need another one of th

[committed] Fix a comment

2016-10-05 Thread Jakub Jelinek
Hi! I've noticed the c_common_reswords table has been changed to use D_CXX11 in 6.x, but the corresponding comment has not been updated (most likely because of typo in it CXXOX vs. CXX0X. Also, the -std= options look bogus. Fixed thusly, committed as obvious to trunk. 2016-10-05 Jakub Jelinek

[PATCH] Fix -fsanitize=undefined with PCH (PR sanitizer/66343)

2016-10-05 Thread Jakub Jelinek
Hi! As mentioned in the PR, ubsan.c uses ASM_GENERATE_INTERNAL_LABEL with static counters that aren't registered with GC, and those functions can be called already during parsing, so we can get clashes between labels created during PCH creation and labels created afterwards. Fixed thusly, bootstr

Re: [PATCH] Fix -fsanitize=undefined with PCH (PR sanitizer/66343)

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 05:25:23PM +0200, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, ubsan.c uses ASM_GENERATE_INTERNAL_LABEL with > static counters that aren't registered with GC, and those functions can be > called already during parsing, so we can get clashes between labels > create

[PATCH] Fix -fsanitize=undefined with PCH, part #2 (PR sanitizer/66343)

2016-10-05 Thread Jakub Jelinek
Hi! When writing test for this PR, I've noticed ICE if the header is compiled without -fsanitize=undefined, but source is compiled with it. We had various issues like this in the past, and we handle it by calling initialize_sanitizer_builtins, which does nothing if the sanitizer bultins are alrea

Re: [PATCH] Improve target pass registration

2016-10-05 Thread Jakub Jelinek
On Tue, Oct 04, 2016 at 04:54:34PM +0200, Jakub Jelinek wrote: > > Typo in the comment: duplicated 'after'. > > Will fix. ... Here is updated patch, bootstrapped/regtested on x86_64-linux and i686-linux. I'll still wait a few days before committing to see if somebody likes to comment on the awk

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 03:31:51PM +0200, Jakub Jelinek wrote: > On Wed, Oct 05, 2016 at 03:14:25PM +0200, Marek Polacek wrote: > > This is my attempt to implement P0305R1, Selection statements with > > initializer. > > It allows the users to write > > > > if (init; cond) // ... > > > > which

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 10:48:19AM -0400, Jason Merrill wrote: > On Wed, Oct 5, 2016 at 9:14 AM, Marek Polacek wrote: > > +/* Return true if we're looking at (init; cond), false otherwise. */ > > + > > +static bool > > +cp_parser_init_statement_p (cp_parser *parser) > > +{ > > + unsigned paren_d

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Joseph Myers
On Tue, 4 Oct 2016, Martin Sebor wrote: > > Well, typically cases where one of long and int is passed and the other is > > expected, but they have the same size, are bugs waiting to happen when the > > code is built on a 64-bit system. That is, they *should* warn. > > Typically, yes. In the cas

[PATCH 01/16] read-md.c: Add various cleanups to ~rtx_reader

2016-10-05 Thread David Malcolm
Various global data items relating to reading .md files are currently initialized in rtx_reader::read_md_files, and are not cleaned up. The selftests for the RTL frontend require supporting multiple reader instances being alive one after another in-process, so this lack of cleanup would become a l

[PATCH 02/16] (approved) Add selftest::read_file

2016-10-05 Thread David Malcolm
Jeff: "Seems reasonable. Install when you have a need." This is used later in the kit by the selftests for final.c gcc/ChangeLog: * selftest.c (selftest::read_file): New function. (selftest::test_read_file): New function. (selftest::selftest_c_tests): Call test_read_file.

[PATCH 03/16] (approved) selftest.h: add temp_override fixture

2016-10-05 Thread David Malcolm
Jeff: "When you need it, this is fine." We have a lot of global state in our code. Ideally we'd reduce the amount of such global state, but a prerequisite for sane refactoring is having automated testing in place to ensure that the refactoring doesn't break anything. However, the global state it

[PATCH 07/16] read-md: add some helper functions

2016-10-05 Thread David Malcolm
Add some functions for use by the RTL frontend. gcc/ChangeLog: * read-md.c (require_char): New function. (require_word_ws): New function. (peek_char): New function. * read-md.h (peek_char): New decl. (require_char): New decl. (require_word_ws): New d

[PATCH 00/16] RTL frontend (v3)

2016-10-05 Thread David Malcolm
This patch kit is v3 of the RTL frontend. For reference, the earlier versions were: v1 (2016-05-04): "[PATCH 0/4] RFC: RTL frontend" https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00352.html v2 (2016-09-08): "[PATCH 0/9] RFC: selftests based on RTL dumps" https://gcc.gnu.org/ml/gcc-

[PATCH 09/16] Split class rtx_reader into base_rtx_reader vs rtx_reader

2016-10-05 Thread David Malcolm
This moves read_rtx and friends into rtx_reader, and splits rtx_reader into two classes: class base_rtx_reader: has responsibility for reading chars, managing include files, top-level directives etc. It is the read-md.o part. class rtx_reader, a subclass, has the code for reading hierarchical rt

[PATCH 08/16] (partially-approved): Introduce selftest::locate_file

2016-10-05 Thread David Malcolm
Jeff: > I do think we should go ahead and plan for a target subdirectory. With > that added, this should be OK once dependencies are in. Loading RTL dumps from files rather than embedding them as strings in the source requires a way to locate the relevant files. This patch adds a selftest::locat

[PATCH 06/16] Introduce emit_status::ensure_regno_capacity

2016-10-05 Thread David Malcolm
gcc/ChangeLog: * emit-rtl.c (gen_reg_rtx): Move regno_pointer_align and regno_reg_rtx resizing logic to... (emit_status::ensure_regno_capacity): ...this new method. (init_emit): Allocate regno_reg_rtx using ggc_cleared_vec_alloc rather than ggc_vec_alloc.

[PATCH 05/16] Introduce rtl_data::init_stack_alignment

2016-10-05 Thread David Malcolm
Move this part of "expand"'s initialization of crtl into its own method so that it can used by the RTL frontend when postprocessing RTL dumps. gcc/ChangeLog: * cfgexpand.c (pass_expand::execute): Move stack initializations to rtl_data::init_stack_alignment and call it. * em

[PATCH 11/16] df selftests (v3)

2016-10-05 Thread David Malcolm
Changes since v2: * moved dump from a string literal to an external file * update for addition of selftest::location to rtl_dump_test * remove debug prints gcc/ChangeLog: * df-core.c: Include selftest.h and selftest-rtl.h. (selftest::dataflow_test::dataflow_test): New ctor.

[PATCH 04/16] (approved) Expose forcibly_ggc_collect and run it after all selftests

2016-10-05 Thread David Malcolm
Jeff: > Seems reasonable and doesn't depend on earlier patches, right? > Assuming that's correct it seems fine for the trunk whenever you want to > install it. gcc/ChangeLog: * ggc-tests.c (forcibly_ggc_collect): Rename to... (selftest::forcibly_ggc_collect): ...this, and remove "s

[PATCH 16/16] Add "__RTL" to cc1

2016-10-05 Thread David Malcolm
This patch implements Richi's idea of having a custom __RTL marker in C function definitions, to indicate that the body of the function is to be parsed as RTL, rather than C: int __RTL test_fn_1 (int i) { (function "times_two" (insn-chain (note 1 0 4 (nil) NOTE_INSN_DELETED) ;; etc

[PATCH 12/16] combine.c selftests (v2)

2016-10-05 Thread David Malcolm
Changed in v2: * moved dumps from a string literal to external files (sharing a dump with read-rtl-function.c) * update for addition of selftest::location to rtl_dump_test gcc/ChangeLog: * combine.c: Include selftest.h and selftest-rtl.h. (try_combine): Add assertion on this_basic_

[PATCH 13/16] cse.c selftests

2016-10-05 Thread David Malcolm
Changed in v2: * move test dumps into external files * update for addition of selftest::location to rtl_dump_test Blurb from v1: This patch uses rtl_dump_test to start building out a test suite for cse. I attempted to create a reproducer for PR 71779; however I'm not yet able to replicate the bo

[PATCH 14/16] RTL interpreter (work-in-progress)

2016-10-05 Thread David Malcolm
This patch is much less polished than the rest of the kit; it's more of an idea, showing an RTL interpreter. My hope is that something like this could be used to build a valgrind for RTL, allowing us to run RTL fragments with a variety of inputs, for sanity checking. For example: capture the resu

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 03:40:18PM +, Joseph Myers wrote: > On Tue, 4 Oct 2016, Martin Sebor wrote: > > > > Well, typically cases where one of long and int is passed and the other is > > > expected, but they have the same size, are bugs waiting to happen when the > > > code is built on a 64-bi

[PATCH 15/16] RTL frontend (rtl1), on top of dump reader

2016-10-05 Thread David Malcolm
This patch implements the RTL frontend, using the function_reader class from earlier in the patch kit. Compared to this patch in v1 of the kit, most of the work has been split into earlier patches. Other changes relative to v1 include: * fix autodeps (by renaming RTL_OBJS to rtl_OBJS in rtl/Make-

[PATCH 10/16] Introduce class function_reader (v3)

2016-10-05 Thread David Malcolm
This patch implements class function_reader, which implements the dump-parsing functionality used in the rest of the kit. Changed in v3: * rather than hardcoding the selftest input dumps as escaped C strings in the source code, move them out into separate files, using selftest::locate_file * updat

Re: [PATCH 05/16] Introduce rtl_data::init_stack_alignment

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:14 PM, David Malcolm wrote: Move this part of "expand"'s initialization of crtl into its own method so that it can used by the RTL frontend when postprocessing RTL dumps. gcc/ChangeLog: * cfgexpand.c (pass_expand::execute): Move stack initializations to rtl_data:

Re: [PATCH 06/16] Introduce emit_status::ensure_regno_capacity

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:15 PM, David Malcolm wrote: - /* Make sure regno_pointer_align, and regno_reg_rtx are large - enough to have an element for this pseudo reg number. */ + int cur_size = crtl->emit.regno_pointer_align_length; + if (reg_rtx_no == cur_size) +crtl->emit.ensure_regno_capaci

Re: [PATCH 06/16] Introduce emit_status::ensure_regno_capacity

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:15 PM, David Malcolm wrote: - regno_reg_rtx = ggc_vec_alloc (crtl->emit.regno_pointer_align_length); + regno_reg_rtx = +ggc_cleared_vec_alloc (crtl->emit.regno_pointer_align_length); Oops, also: formatting, operators go first on a newline. Bernd

Re: [PATCH 07/16] read-md: add some helper functions

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:15 PM, David Malcolm wrote: +void require_char (char expected) > +void require_word_ws (const char *expected) Function name goes on a new line. Otherwise ok. Bernd

Re: [PATCH 01/16] read-md.c: Add various cleanups to ~rtx_reader

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:14 PM, David Malcolm wrote: The selftests for the RTL frontend require supporting multiple reader instances being alive one after another in-process, so this lack of cleanup would become a leak. + /* Initialize global data. */ + obstack_init (&string_obstack); + ptr_locs =

[RFA] [PR tree-optimization/71661] Fix forwarder removal when new loops are exposed

2016-10-05 Thread Jeff Law
Removal of forwarder blocks is a two step process. First we build a worklist of potential forwarder blocks, Then we iterate over that worklist attempting to remove each potential forwarder block in the worklist. The code which builds the worklist is aware that we do not want to remove a fo

Re: [PATCH 10/16] Introduce class function_reader (v3)

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:15 PM, David Malcolm wrote: * errors.c: Use consistent pattern for bconfig.h vs config.h includes. (progname): Wrap with #ifdef GENERATOR_FILE. (error): Likewise. Add "error: " to message. (fatal): Likewise. (internal_error): Likew

Re: [PATCH 08/16] (partially-approved): Introduce selftest::locate_file

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:15 PM, David Malcolm wrote: selftest: s-selftest s-selftest: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs - $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test + $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test=$(srcdir) $(STAMP) $@ I suspect the Makefile parts

Re: [PATCH 16/16] Add "__RTL" to cc1

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, David Malcolm wrote: > @@ -1752,6 +1759,35 @@ c_parser_declaration_or_fndef (c_parser *parser, bool > fndef_ok, >c_parser_skip_to_end_of_block_or_statement (parser); >return; > } > + > + if (c_parser_next_token_is (parser, CPP_KEYWORD)) > +{ > +

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, Jakub Jelinek wrote: > On Wed, Oct 05, 2016 at 03:40:18PM +, Joseph Myers wrote: > > On Tue, 4 Oct 2016, Martin Sebor wrote: > > > > > > Well, typically cases where one of long and int is passed and the other > > > > is > > > > expected, but they have the same size, are b

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 11:29 AM, Marek Polacek wrote: > On Wed, Oct 05, 2016 at 10:48:19AM -0400, Jason Merrill wrote: >> On Wed, Oct 5, 2016 at 9:14 AM, Marek Polacek wrote: >> > +/* Return true if we're looking at (init; cond), false otherwise. */ >> > + >> > +static bool >> > +cp_parser_init_

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Martin Sebor
On 10/05/2016 09:40 AM, Joseph Myers wrote: On Tue, 4 Oct 2016, Martin Sebor wrote: Well, typically cases where one of long and int is passed and the other is expected, but they have the same size, are bugs waiting to happen when the code is built on a 64-bit system. That is, they *should* war

Re: [C++ PATCH] Delete GCJ - C++ part

2016-10-05 Thread Jeff Law
On 10/05/2016 03:07 AM, Jakub Jelinek wrote: On Wed, Oct 05, 2016 at 11:04:05AM +0200, Andreas Schwab wrote: FAIL: g++.dg/pr49847-2.C -std=gnu++11 (test for excess errors) Excess errors: /daten/aranym/gcc/gcc-20161005/gcc/testsuite/g++.dg/pr49847-2.C:5:13: error: '__java_int' does

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, Martin Sebor wrote: > The warning would only helpful if there was a target where wchar_t > didn't promote to a type with the same precision as wint_t, or in Or it could show up a logical error where the code should have had a wint_t variable and checked for WEOF somewhere but

Re: [PATCH] Delete GCJ

2016-10-05 Thread Jeff Law
On 10/04/2016 12:39 PM, Iain Sandoe wrote: I don't know who wants to review it, but if people want me to, Ok. The idea is that if ObjC is the last remaining user in tree for boehm-gc, then reasonably I'm the last man standing. Of course, if others want to review approve the patch, I'm fine

Re: [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788)

2016-10-05 Thread Jeff Law
On 10/04/2016 03:16 AM, Martin Liška wrote: Hello. In the attached patch I resolve couple of warnings seen during make profiledbootstrap. I can survive bootstrap on both ppc64le-redhat-linux and x86_64-linux-gnu targets. Ready to be installed? Martin 0001-Fix-warnings-for-make-profiledboots

Re: [AArch64][0/14] ARMv8.2-A FP16 extension support

2016-10-05 Thread Jiong Wang
On 27/09/16 17:03, Jiong Wang wrote: > > Now as ARM patches have gone in around r240427, I have done a quick confirmation > on the status of these four pending testsuite patches: > > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00337.html > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg0033

Re: [PATCH 13/16] cse.c selftests

2016-10-05 Thread Bernd Edlinger
David, I think this could be added to the pr71779 test case: test_pr71779 () { /* Only run this tests for target==aarch64. */ #ifndef GCC_AARCH64_H +#ifndef I386_OPTS_H return; +#endif #endif rtl_dump_test t (SELFTEST_LOCATION, locate_file ("pr71779.rtl")); dataflow_te

Re: [PATCH] Fix ubsan ICE on vector shift (PR sanitizer/77823)

2016-10-05 Thread Jeff Law
On 10/03/2016 11:31 AM, Jakub Jelinek wrote: Hi! libsanitizer isn't right now prepared to handle vector types, and we don't instrument vector additions/multiplications etc. for overflow etc. either, so this patch just turns the single case that slipped through. As I wrote in the PR, in the futu

Re: [PATCH] Fix -fsanitize=undefined with PCH, part #2 (PR sanitizer/66343)

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 05:29:49PM +0200, Jakub Jelinek wrote: > Hi! > > When writing test for this PR, I've noticed ICE if the header is compiled > without -fsanitize=undefined, but source is compiled with it. > > We had various issues like this in the past, and we handle it by calling > initial

Re: Fix missing -Wimplicit-fallthrough warning

2016-10-05 Thread Marek Polacek
Ping. On Thu, Sep 29, 2016 at 06:10:27PM +0200, Marek Polacek wrote: > Here, a missing -Wimplicit-fallthrough warning was caused by a misplaced > FALLTHROUGH_LABEL_P check. As it is now, for FALLTHROUGH_LABEL_P we'd > never gotten around to > 1933 /* So that next warn_implicit_fallth

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Marek Polacek
On Wed, Oct 05, 2016 at 12:11:40PM -0400, Jason Merrill wrote: > On Wed, Oct 5, 2016 at 11:29 AM, Marek Polacek wrote: > > How about the version I just posted, i.e. > > ? > > That doesn't address my first comment. The following uses cp_pa

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Martin Sebor
On 10/05/2016 10:27 AM, Joseph Myers wrote: On Wed, 5 Oct 2016, Martin Sebor wrote: The warning would only helpful if there was a target where wchar_t didn't promote to a type with the same precision as wint_t, or in Or it could show up a logical error where the code should have had a wint_t

[Patch, testsuite] Fix pr69941.c test failure for avr

2016-10-05 Thread Senthil Kumar Selvaraj
Hi, The below patch fixes gcc.dg/torture/pr69941.c to pass for int size != 32 targets like avr. For the avr target, ints are 16 bits wide. VRP concludes that a right shift by 9 followed by an equality comparison to 0x74 can never be true, and ends up eliminating the conditional. The

Re: [PATCH] define TARGET_PRINTF_POINTER_FORMAT for powerpc-linux (77837)

2016-10-05 Thread Martin Sebor
On 10/03/2016 08:11 PM, Martin Sebor wrote: On 10/03/2016 07:10 PM, Segher Boessenkool wrote: On Mon, Oct 03, 2016 at 05:30:35PM -0600, Martin Sebor wrote: The attached patch adds definitions of TARGET_PRINTF_POINTER_FORMAT to the rs6000 pair of linux.h and linux64.h headers, analogous to the c

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, Martin Sebor wrote: > > Or it could show up a logical error where the code should have had a > > wint_t variable and checked for WEOF somewhere but just assumed things > > would fit in wchar_t > > WEOF that fits in a wint_t also fits in a wchar_t when the two types > have the

Re: C++ PATCH for C++17 selection statements with initializer

2016-10-05 Thread Jason Merrill
OK.

[PATCH] rs6000: Use "dg-warning ... 0" in a few places

2016-10-05 Thread Segher Boessenkool
GCC used to give warnings for line # 1 for these, but it prints no line number anymore. Adjust. 2016-10-05 Segher Boessenkool gcc/testsuite/ * gcc.target/powerpc/warn-1.c: Change line number in dg-warning. * gcc.target/powerpc/warn-2.c: Ditto. --- gcc/testsuite/gcc.target/p

[PATCH] testsuite: Prune "non-standard ABI extension" warnings

2016-10-05 Thread Segher Boessenkool
Various testcases fail with "excess errors" for 32-bit PowerPC, for the warnings about vectors without -mabi=altivec. This patch adds dg-prune-output directives to ignore those warnings. Is there a better way to handle this? dg-prune-output does not allow a "target" condition, even. Segher 2

Re: [PATCH] testsuite: Prune "non-standard ABI extension" warnings

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 05:47:30PM +, Segher Boessenkool wrote: > Various testcases fail with "excess errors" for 32-bit PowerPC, for > the warnings about vectors without -mabi=altivec. This patch adds > dg-prune-output directives to ignore those warnings. > > Is there a better way to handle

Re: [PATCH] Extend -Wint-in-bool-context to more conditional expressions

2016-10-05 Thread Jeff Law
On 10/03/2016 11:09 AM, Bernd Edlinger wrote: Hi! This is a next step in extending the -Wint-in-bool-context warning to cover the case when a conditional expression has only one arm which evaluates to a non-boolean integer value. With a previous version of this warning, we found PR 77574, among

  1   2   >