[ping * 2] remove optab functions for [us]divmod_optab in optabs.def

2016-10-05 Thread Prathamesh Kulkarni
Pinging patch: https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01038.html Thanks, Prathamesh

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

2016-10-05 Thread Prathamesh Kulkarni
On 5 October 2016 at 19:45, Martin Jambor wrote: > 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

[PR77862] ICE in add_equivalence

2016-10-05 Thread kugan
Hi, In VRP we can generate new SSA variables while performing the propagation, at least in EVRP. Therefore, when we access array vr_values we have to check num_vr_values. This caused ICE for the PR77862. Attached patch fixes this. Bootstrapped and regression tested on x86_64-linux-gnu with

Go patch committed: avoid allocation of varargs parameter with optimize-allocs

2016-10-05 Thread Ian Lance Taylor
This patch by Chris Manghane fixes a bug in the escape analysis pass of the Go frontend. The slice created to hold the values passed to a varargs parameter would always escape. This also fixes a bug in which a stack-allocated varargs parameter was incorrectly initialized in some cases.

[gomp4] correct a tile bug with combined loops in fortran

2016-10-05 Thread Cesar Philippidis
Nathan spotted a bug where the fortran FE wasn't lowering the tile clause properly in combined parallel/kernels loops. The problem was that gfc_trans_omp_d has two sources of clauses, code->ext.omp_clauses and do_clauses. Because of the way that the fortran FE splits combined loops, the tile

Re: [C++ PATCH] P0258R2 - add __has_unique_object_representations

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 4:02 PM, Jakub Jelinek wrote: > +case INTEGER_TYPE: > + return TYPE_PRECISION (t) == GET_MODE_PRECISION (TYPE_MODE (t)); > + > +case BOOLEAN_TYPE: > + /* For bool values other than 0 and 1 should only appear with > +undefined

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

2016-10-05 Thread Jason Merrill
On 10/05/2016 05:43 PM, Martin Sebor wrote: On 09/23/2016 12:00 PM, Jason Merrill wrote: On Thu, Sep 22, 2016 at 7:39 PM, Martin Sebor wrote: On 09/21/2016 02:43 PM, Jason Merrill wrote: On Tue, Sep 20, 2016 at 1:01 PM, Martin Sebor wrote: On 09/16/2016

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

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, Martin Sebor wrote: > On 10/05/2016 05:11 PM, Joseph Myers wrote: > > On Wed, 5 Oct 2016, Martin Sebor wrote: > > > > > may have been subjected to. Issuing a warning for a safe piece > > > of code only on the basis that there might be some other piece > > > of code in the

Re: [C++/66443] deleted ctor and vbase construction

2016-10-05 Thread Jason Merrill
On Fri, Sep 30, 2016 at 1:39 PM, Nathan Sidwell wrote: > PR 66443 concerns C++14 DR1611. It is now permitted to use the base-ctor of > an abstract class whos complete ctor is deleted because of a virtual base > issue. Specifically, given > > class A { > A (int); > // no

Re: [patch] [gsoc] [gimplefe] GIMPLE FE Project

2016-10-05 Thread Joseph Myers
On Fri, 26 Aug 2016, Prasad Ghangal wrote: > >> Thanks for your feedback. I had missed removing some unwanted code > >> while code cleanup. I have updated the patch. > >> I am not sure if we should move all gimple parsing related functions > >> to the new file (?) > > > > I think it might be good

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

2016-10-05 Thread Martin Sebor
On 10/05/2016 05:11 PM, Joseph Myers wrote: On Wed, 5 Oct 2016, Martin Sebor wrote: may have been subjected to. Issuing a warning for a safe piece of code only on the basis that there might be some other piece of code in the program that does something wrong makes no sense. Suggesting to the

Re: C++ PATCH for P0135, C++17 guaranteed copy elision

2016-10-05 Thread Jason Merrill
On Wed, Oct 5, 2016 at 7:15 PM, Pedro Alves wrote: > On 10/05/2016 11:57 PM, Jason Merrill wrote: >> --- a/gcc/c-family/c-opts.c >> +++ b/gcc/c-family/c-opts.c >> @@ -1579,6 +1579,7 @@ set_std_cxx1z (int iso) >> + flag_elide_constructors = 2; Oops, that was an earlier version

Re: C++ PATCH for P0135, C++17 guaranteed copy elision

2016-10-05 Thread Pedro Alves
On 10/05/2016 11:57 PM, Jason Merrill wrote: > --- a/gcc/c-family/c-opts.c > +++ b/gcc/c-family/c-opts.c > @@ -1579,6 +1579,7 @@ set_std_cxx1z (int iso) >flag_isoc94 = 1; >flag_isoc99 = 1; >flag_isoc11 = 1; > + flag_elide_constructors = 2; >cxx_dialect = cxx1z; >

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

2016-10-05 Thread Joseph Myers
On Wed, 5 Oct 2016, Martin Sebor wrote: > may have been subjected to. Issuing a warning for a safe piece > of code only on the basis that there might be some other piece > of code in the program that does something wrong makes no sense. > Suggesting to the user to change the safe piece of code

Re: Add a testcase for C++17 selection statements with initializer

2016-10-05 Thread Jason Merrill
OK. On Wed, Oct 5, 2016 at 5:47 PM, Marek Polacek wrote: > This adds a further test for selection statements with initializer C++17 > feature. Except that I'm not quite sure if it's valid, but I think it is; > although the standard says > An if statement of the form > > if

C++ PATCHes for temporary lifetime extension bugs

2016-10-05 Thread Jason Merrill
While looking at guaranteed copy elision, I noticed some outstanding issues with temporary lifetime extension. In one case, we were failing to extend temporaries bound to references within another temporary. In another, we were failing to extend a temporary when we bind a reference to a scalar

Re: [Patch 5/11] Add -fpermitted-flt-eval-methods=[c11|ts-18661-3]

2016-10-05 Thread Joseph Myers
On Fri, 30 Sep 2016, James Greenhalgh wrote: > I've added two testcases which test that when this option, or a C standards > dialect, would restrict the range of values to {-1, 0, 1, 2}, those are > the only values we see. At this stage in the patch series this trivially > holds for all targets.

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

2016-10-05 Thread Martin Sebor
The problem is e.g. code calling getwchar and not checking for WEOF. 0xu does not fit in a 32-bit signed variable unless your code is confusing signed and unsigned freely. And even if you consider it OK to check after conversion to wchar_t rather than before, the lack of a wint_t

Re: [PATCH] PR fortran/58991 and fortran/58992

2016-10-05 Thread Steve Kargl
On Tue, Sep 27, 2016 at 11:45:35AM -0700, Steve Kargl wrote: > > 2016-09-27 Steven G. Kargl > > PR fortran/58991 > PR fortran/58992 > * resolve.c (resolve_assoc_var): Fix CHARACTER type-spec for a > selector in ASSOCIATE. >

C++ PATCH for P0135, C++17 guaranteed copy elision

2016-10-05 Thread Jason Merrill
C++17 changes how we describe prvalues so that they express initialization of an object to be named later, rather than objects themselves. This happens to match the front end's use of TARGET_EXPR pretty closely, so I think we don't need to do much more than disable the code that forces us to copy

Re: Patch, Split powerpc -mfloat128 into 2 parts

2016-10-05 Thread Michael Meissner
On Tue, Oct 04, 2016 at 09:42:21PM +, Joseph Myers wrote: > On Tue, 4 Oct 2016, Michael Meissner wrote: > > > It also changes __ibm128/__float128, and only registers the keywords if the > > long double type is not IBM extended double or IEEE 128-bit floating point > > respectively. If the

Re: [PATCH] Remove x86 pcommit instruction

2016-10-05 Thread H.J. Lu
On Wed, Oct 5, 2016 at 1:42 PM, Andrew Senkevich wrote: > 2016-10-05 18:06 GMT+03:00 Uros Bizjak : >> On Wed, Oct 5, 2016 at 3:47 PM, Andrew Senkevich >> wrote: -mpcommit -Target Report Mask(ISA_PCOMMIT)

[PATCH, i386]: Fix PR 77874, two problems with gcc.target/i386/avx-1.c

2016-10-05 Thread Uros Bizjak
2016-10-05 Uros Bizjak PR target/77874 * config/i386/sse.md (3): Remove wrong assert. (float2: Use as operand 1 constraint. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN, will backport to release branches.

Add a testcase for C++17 selection statements with initializer

2016-10-05 Thread Marek Polacek
This adds a further test for selection statements with initializer C++17 feature. Except that I'm not quite sure if it's valid, but I think it is; although the standard says An if statement of the form if constexpr opt ( init-statement condition ) statement is equivalent to {

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

2016-10-05 Thread Martin Sebor
On 09/23/2016 12:00 PM, Jason Merrill wrote: On Thu, Sep 22, 2016 at 7:39 PM, Martin Sebor wrote: On 09/21/2016 02:43 PM, Jason Merrill wrote: On Tue, Sep 20, 2016 at 1:01 PM, Martin Sebor wrote: On 09/16/2016 12:19 PM, Jason Merrill wrote: On 09/14/2016

Re: [PATCH] Remove x86 pcommit instruction

2016-10-05 Thread Andrew Senkevich
2016-10-05 18:06 GMT+03:00 Uros Bizjak : > On Wed, Oct 5, 2016 at 3:47 PM, Andrew Senkevich > wrote: >>> -mpcommit >>> -Target Report Mask(ISA_PCOMMIT) Var(ix86_isa_flags) Save >>> -Support PCOMMIT instruction. >>> - >>> >>> You should not simply

Fix ICE due to map typespecs with different sized charlens being copied

2016-10-05 Thread Fritz Reese
When union type symbols are compared and they contain maps containing characters with different lengths, their type symbols should have different backend declarations otherwise the gimple tree explodes. Strangely enough the gimple checker only explodes with '-g' enabled and certain other specific

[C++ PATCH] P0258R2 - add __has_unique_object_representations

2016-10-05 Thread Jakub Jelinek
Hi! This patch adds a compiler builtin for std::has_unique_object_representations trait implementation. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2016-10-05 Jakub Jelinek Implement P0258R2 - helper for C++17

Re: RFC: A few more fallthrus

2016-10-05 Thread Jason Merrill
One of these was a bug, though it doesn't affect regression testing. commit c49bb7df1d286456f2e5738c05ea56e6816a7475 Author: Jason Merrill Date: Wed Oct 5 11:32:33 2016 -0400 * parser.c (cp_parser_skip_to_end_of_statement): Add missing break. diff --git a/gcc/cp/call.c

Re: MAINTAINERS update

2016-10-05 Thread Ellcey, Steve
> Sorry, my bad.  I should have updated given the length of time between > when the patch was submitted and approved and installed. > > Thanks for taking care of it.  I assume you've got no interest in > maintaining hpux or ia64 anymore?  :-) > > jeff What's hpux and ia64? :-) Steve Ellcey

Re: fold x ^ y to 0 if x == y

2016-10-05 Thread Jeff Law
On 07/20/2016 04:09 PM, Prathamesh Kulkarni wrote: Oops wrong test-case, the dump below is of the following test-case: int f(int x, int y) { int ret = 10; if (x == y) ret = x - y; return ret; } DOM ought to be catching this as well and does with the hack patch I've done for the

Re: fold x ^ y to 0 if x == y

2016-10-05 Thread Jeff Law
On 07/20/2016 04:07 PM, Prathamesh Kulkarni wrote: Not record both equivalences. This might break the testcase it was introduced for (obviously). Which is why I CCed Jeff for his opinion. Well, folding happens for x - y, if x == y. int f(int x, int y) { int ret; if (x == y) ret = x

Re: [PATCH] Remove x86 pcommit instruction

2016-10-05 Thread Uros Bizjak
On Wed, Oct 5, 2016 at 9:03 PM, Andrew Senkevich wrote: >> (Please also provide an entry for Release Changes, since this is >> user-facing change. Also for release branches.) > > What is BKM for doing that for 7.1 release? File a PR and mention it > in ChangeLog?

Re: MAINTAINERS update

2016-10-05 Thread Jeff Law
On 10/05/2016 12:55 PM, Ellcey, Steve wrote: Jeff, FYI: I noticed that your MAINTAINERS update reverted my address from sell...@caviumnetworks.com back to sell...@imgtec.com. I went ahead and fixed it. Steve Ellcey sell...@caviumnetworks.com 2016-10-05 Steve Ellcey

Re: fold x ^ y to 0 if x == y

2016-10-05 Thread Jeff Law
On 07/08/2016 05:17 AM, Richard Biener wrote: On Fri, 8 Jul 2016, Prathamesh Kulkarni wrote: Hi Richard, For the following test-case: int f(int x, int y) { int ret; if (x == y) ret = x ^ y; else ret = 1; return ret; } I was wondering if x ^ y should be folded to 0

Re: [PATCH] Remove x86 pcommit instruction

2016-10-05 Thread Andrew Senkevich
> (Please also provide an entry for Release Changes, since this is > user-facing change. Also for release branches.) What is BKM for doing that for 7.1 release? File a PR and mention it in ChangeLog? -- WBR, Andrew

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

2016-10-05 Thread Jason Merrill
On Tue, Oct 4, 2016 at 11:11 PM, Jason Merrill wrote: > On Tue, Oct 4, 2016 at 4:42 PM, 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

[gomp4] Implement tiling

2016-10-05 Thread Nathan Sidwell
This patch implements the Openacc loop tile clause. Tile is very much like collapse, in that it takes a tight loop nest. However, it transforms it into two nested loops. An outer 'tile' loop and an inner 'element' loop. The size of the element loop is determined by the tile clause

MAINTAINERS update

2016-10-05 Thread Ellcey, Steve
Jeff, FYI: I noticed that your MAINTAINERS update reverted my address from sell...@caviumnetworks.com back to sell...@imgtec.com. I went ahead and fixed it. Steve Ellcey sell...@caviumnetworks.com 2016-10-05 Steve Ellcey * MAINTAINERS: Update email

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

2016-10-05 Thread Richard Biener
On October 5, 2016 5:28:39 PM GMT+02:00, Marek Polacek wrote: >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

Fortran, committed: ICE on using implicit character instead of implicit none etc. (pr 67524)

2016-10-05 Thread Louis Krupp
Fixed in revision 240797.

[wwwdocs] Update C++17 status

2016-10-05 Thread Marek Polacek
This reflects my latest change. Applied. Index: projects/cxx-status.html === RCS file: /cvs/gcc/wwwdocs/htdocs/projects/cxx-status.html,v retrieving revision 1.26 diff -u -r1.26 cxx-status.html --- projects/cxx-status.html5 Oct

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

2016-10-05 Thread Jakub Jelinek
On Wed, Oct 05, 2016 at 07:57:12PM +0200, Bernd Schmidt wrote: > On 10/05/2016 06:51 PM, Marek Polacek wrote: > >On Wed, Oct 05, 2016 at 05:29:49PM +0200, Jakub Jelinek wrote: > >>When writing test for this PR, I've noticed ICE if the header is compiled > >>without -fsanitize=undefined, but source

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

2016-10-05 Thread Bernd Schmidt
On 10/05/2016 06:51 PM, Marek Polacek wrote: 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,

Re: [PATCH] Set -fprofile-update=atomic when -pthread is present

2016-10-05 Thread Jeff Law
On 10/04/2016 06:05 AM, Martin Liška wrote: On 10/03/2016 02:26 PM, Nathan Sidwell wrote: > On 10/03/16 08:13, Martin Liška wrote: >> On 08/18/2016 05:53 PM, Jeff Law wrote: >>> On 08/18/2016 09:51 AM, Andi Kleen wrote: > I'd prefer to make updates atomic in multi-threaded applications.

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,

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

[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

[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.

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

2016-10-05 Thread Jason Merrill
OK.

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

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

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

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

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 >

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

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"));

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 >

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

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

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 not name

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*

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. */ >> >

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

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 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

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):

[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

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 (_obstack); + ptr_locs =

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 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 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) +

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

[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 *

[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

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

[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

[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

[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

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

[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 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. *

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

[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

[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"

[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

[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

[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

[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

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

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) > > +{ >

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

[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

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 >

  1   2   >