Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-13 Thread Martin Sebor
On 02/13/2018 08:59 AM, Michael Matz wrote: Hi, On Mon, 12 Feb 2018, Martin Sebor wrote: Removing noreturn from the whitelist means having to prevent the attribute from causing conflicts with the attributes on the blacklist. E.g., in this: template [[malloc]] void* allocate (int

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-13 Thread Martin Sebor
On 02/13/2018 10:07 AM, Manuel López-Ibáñez wrote: On 13/02/18 03:10, Martin Sebor wrote: PS Is there any reason why diagnostic-core.h and diagnostic.c does not/should not include tree.h and other GCC headers? The short reason is that we want to keep the core diagnostics as independent of the

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-13 Thread Martin Sebor
On 02/13/2018 07:47 AM, Jason Merrill wrote: On Mon, Feb 12, 2018 at 6:39 PM, Martin Sebor wrote: I really don't think it's helpful to try to force noreturn to match between the primary and its specializations. I continue to disagree. Can you explain what use case you are conce

Re: [PATCH] diagnose specializations of deprecated templates (PR c++/84318)

2018-02-13 Thread Martin Sebor
On 02/13/2018 09:24 AM, Martin Sebor wrote: On 02/13/2018 08:35 AM, Martin Sebor wrote: On 02/13/2018 07:40 AM, Jason Merrill wrote: On Mon, Feb 12, 2018 at 6:32 PM, Martin Sebor wrote: While testing my fix for 83871 (handling attributes on explicit specializations) I noticed another old

Re: [PATCH] avoid warning for members declared both aligned and packed (PR 84108)

2018-02-13 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00125.html On 02/02/2018 11:58 AM, Martin Sebor wrote: The design of the attribute exclusion framework includes support for different exclusions applying to different kinds of declarations (functions, types, and variables or fields), but the

Re: [PATCH] diagnose specializations of deprecated templates (PR c++/84318)

2018-02-13 Thread Martin Sebor
On 02/13/2018 12:15 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 1:31 PM, Martin Sebor wrote: On 02/13/2018 09:24 AM, Martin Sebor wrote: On 02/13/2018 08:35 AM, Martin Sebor wrote: On 02/13/2018 07:40 AM, Jason Merrill wrote: On Mon, Feb 12, 2018 at 6:32 PM, Martin Sebor wrote

Re: [PATCH] diagnose specializations of deprecated templates (PR c++/84318)

2018-02-13 Thread Martin Sebor
On 02/13/2018 01:09 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 2:59 PM, Martin Sebor wrote: On 02/13/2018 12:15 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 1:31 PM, Martin Sebor wrote: On 02/13/2018 09:24 AM, Martin Sebor wrote: On 02/13/2018 08:35 AM, Martin Sebor wrote

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-13 Thread Martin Sebor
On 02/13/2018 01:59 PM, Manuel López-Ibáñez wrote: On 13 Feb 2018 5:58 pm, "Martin Sebor" mailto:mse...@gmail.com>> wrote: I wanted to make the _n() functions like warning_n() more robust by letting them accept a tree argument (as well as offset_int and wide_int

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-13 Thread Martin Sebor
On 02/13/2018 04:05 PM, David Malcolm wrote: On Tue, 2018-02-13 at 15:37 -0700, Martin Sebor wrote: On 02/13/2018 01:59 PM, Manuel López-Ibáñez wrote: On 13 Feb 2018 5:58 pm, "Martin Sebor" mailto:mse...@gmail.com>> wrote: I wanted to make the _n() functions like

Re: [PATCH] diagnose specializations of deprecated templates (PR c++/84318)

2018-02-14 Thread Martin Sebor
On 02/13/2018 10:28 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 5:20 PM, Martin Sebor wrote: On 02/13/2018 01:09 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 2:59 PM, Martin Sebor wrote: On 02/13/2018 12:15 PM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 1:31 PM, Martin Sebor

update LTO test harness README

2018-02-14 Thread Martin Sebor
I was excited to find out about the recent enhancement to the LTO test harness to support the new dg-lto-warning and dg-lto-message directives (thanks, David). To make them easier to find and use (there is a C++ LTO test that uses them but no C tests yet) the attached patch updates the README to

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-14 Thread Martin Sebor
On 02/13/2018 02:05 PM, Joseph Myers wrote: On Mon, 12 Feb 2018, Martin Sebor wrote: Bug 84207 - Hard coded plural in gimple-fold.c points out one of a number of warning_at() calls where warning_n() should have been used. The attached patch both replaces the calls and also changes the

Re: [Patch] Minor GCC documentation correction for -Wformat-overflow

2018-02-14 Thread Martin Sebor
On 02/14/2018 02:28 PM, Indu Bhagat wrote: In section "-Wformat-overflow=1", following is stated : void f (int a, int b) { char buf [12]; sprintf (buf, "a = %i, b = %i\n", a, b); } " Increasing the size of the buffer by a single byte is sufficient to avoid the warning," [size of an unknown

Re: [PATCH] correct -Wrestrict handling of arrays of arrays (PR 84095)

2018-02-15 Thread Martin Sebor
On 02/13/2018 11:14 PM, Jeff Law wrote: On 02/01/2018 04:45 PM, Martin Sebor wrote: The previous patch didn't resolve all the false positives in the Linux kernel. The attached is an update that fixes the remaining one having to do with multidimensional array members: struct S { char a

Re: [testsuite, committed] Require et alloca for Wstringop-overflow-3.c

2018-02-15 Thread Martin Sebor
Thanks. I've seen these fixes before but I still keep forgetting to add the directive. It would be nice if the test harness could detect this automatically for us and remind us to add the directive even on targets where alloca is supported. Some sort of a script (or even DejaGnu itself) would d

[PATCH] replace ICE with error for failed template deduction (PR 84355)

2018-02-15 Thread Martin Sebor
A failed template deduction in template member of a template triggers an ICE with -std=c++17 due to what seems like a missing handling of invalid input. Replacing the gcc_unreachable() call that causes the ICE with a return statement indicating the deduction failure eliminates the ICE and restore

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-16 Thread Martin Sebor
On 02/16/2018 05:43 AM, Nick Clifton wrote: Hi David, Attached is a revised version of the patch which I hope addresses all of your (very helpful) comments on the v3 patch. OK to apply once the sources are back on stage 1 ? Thanks (also) for adding the documentation! I have just one mi

Re: [testsuite, committed] Require et alloca for Wstringop-overflow-3.c

2018-02-16 Thread Martin Sebor
On 02/16/2018 01:14 AM, Tom de Vries wrote: On 02/15/2018 07:01 PM, Martin Sebor wrote: Thanks. I've seen these fixes before but I still keep forgetting to add the directive. Hi, I also forget about these directives when I do an x86_64 build-test-commit. The alloca effective target i

Re: [PATCH] Fix bootstrap with GCC 3.4 (and likely anything < 4.4 except 4.2.[0-3]) (PR bootstrap/84405)

2018-02-16 Thread Martin Sebor
On 02/16/2018 01:38 AM, Jakub Jelinek wrote: Hi! As the system.h comment says, it took us years to get value initialization right, and unfortunately we've started hitting it in GCC codebase now. There are various related PRs, 4.2.[0-3] are most broken in this regard, value initialization of non-

Re: [PATCH] Fix bootstrap with GCC 3.4 (and likely anything < 4.4 except 4.2.[0-3]) (PR bootstrap/84405)

2018-02-16 Thread Martin Sebor
On 02/16/2018 11:05 AM, Jakub Jelinek wrote: On Fri, Feb 16, 2018 at 10:36:27AM -0700, Martin Sebor wrote: The deeper problem is that vec wants to be a POD but GCC instantiates the template on non-POD types. For example genrecog.c instantiates it on struct parameter that has a default ctor. A

Re: [PATCH] Fix bootstrap with GCC 3.4 (and likely anything < 4.4 except 4.2.[0-3]) (PR bootstrap/84405)

2018-02-16 Thread Martin Sebor
On 02/16/2018 01:44 PM, Jakub Jelinek wrote: On Fri, Feb 16, 2018 at 09:25:30PM +0100, Richard Biener wrote: But the broken compilers will overwrite the memset data with possibly uninitialized fields of a TARGET_EXPR. Perhaps for hash-table.h we could use: #ifndef BROKEN_VALUE_INITIALIZATION

Re: [PATCH] replace ICE with error for failed template deduction (PR 84355)

2018-02-16 Thread Martin Sebor
On 02/16/2018 07:04 AM, Jason Merrill wrote: On Thu, Feb 15, 2018 at 6:36 PM, Martin Sebor wrote: A failed template deduction in template member of a template triggers an ICE with -std=c++17 due to what seems like a missing handling of invalid input. Replacing the gcc_unreachable() call that

[PATCH] consider successor blocks when avoiding -Wstringop-truncation (PR 84468)

2018-02-19 Thread Martin Sebor
PR 84468 points out a false positive in -Wstringop-truncation in code like this: struct A { char a[4]; }; void f (struct A *p, const struct A *q) { if (p->a) strncpy (p->a, q->a, sizeof p->a - 1); // warning here p->a[3] = '\0'; } The warning is due to the code checking

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478)

2018-02-20 Thread Martin Sebor
On 02/20/2018 10:17 AM, Jakub Jelinek wrote: Hi! The following testcase distilled from pdftex is miscompiled on i?86, because gimple_fold_builtin_strlen sets incorrect value range on strlen call on SSA_NAME with def_stmt of PHI <"mu", something> where we can't determine anything about string len

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478)

2018-02-20 Thread Martin Sebor
On 02/20/2018 12:03 PM, Martin Sebor wrote: On 02/20/2018 10:17 AM, Jakub Jelinek wrote: Hi! The following testcase distilled from pdftex is miscompiled on i?86, because gimple_fold_builtin_strlen sets incorrect value range on strlen call on SSA_NAME with def_stmt of PHI <"mu&quo

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478, take 2 and 3)

2018-02-20 Thread Martin Sebor
On 02/20/2018 02:34 PM, Jakub Jelinek wrote: On Tue, Feb 20, 2018 at 01:13:13PM -0700, Martin Sebor wrote: A safer and even more conservative alternative that should be equivalent to your approach while avoiding the sprintf regressions is to add another mode to the function and have it clear

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478)

2018-02-20 Thread Martin Sebor
It would help if you explained why you think it is a good idea ignoring the other phi arguments if you have one (or more) where you can determine length. It's a heuristic that was meant just for the -Wformat-overflow warning. When making decisions that affect code generation it's obviously not

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-20 Thread Martin Sebor
On 02/20/2018 05:48 AM, Nick Clifton wrote: Hi Martin, Since the class manages a resource it should ideally make sure it doesn't try to release the same resource multiple times. I.e., its copy constructor and assignment operators should either "do the right thing" (whatever you think that is)

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478)

2018-02-20 Thread Martin Sebor
On 02/20/2018 05:14 PM, Jakub Jelinek wrote: On Tue, Feb 20, 2018 at 04:59:12PM -0700, Martin Sebor wrote: It would help if you explained why you think it is a good idea ignoring the other phi arguments if you have one (or more) where you can determine length. It's a heuristic that was

Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478)

2018-02-21 Thread Martin Sebor
On 02/20/2018 08:25 PM, Jeff Law wrote: On 02/20/2018 04:59 PM, Martin Sebor wrote: It would help if you explained why you think it is a good idea ignoring the other phi arguments if you have one (or more) where you can determine length. It's a heuristic that was meant just for the -Wf

[PATCH] avoid bogus -Wstringop-truncation when inlining (PR 84480)

2018-02-21 Thread Martin Sebor
The attached patch eliminates -Wstringop-truncation false positives reported in bug 84480 - bogus -Wstringop-truncation despite assignment with an inlined string literal. It does that by delegating early strncpy checks during folding to the same machinery in tree-ssa-strlen that looks for a NUL a

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-21 Thread Martin Sebor
On 02/13/2018 11:33 AM, Jason Merrill wrote: On Tue, Feb 13, 2018 at 1:00 PM, Martin Sebor wrote: On 02/13/2018 07:47 AM, Jason Merrill wrote: On Mon, Feb 12, 2018 at 6:39 PM, Martin Sebor wrote: I really don't think it's helpful to try to force noreturn to match between the p

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-22 Thread Martin Sebor
x27;t have to worry about it. On 02/14/2018 11:02 AM, Martin Sebor wrote: On 02/13/2018 02:05 PM, Joseph Myers wrote: On Mon, 12 Feb 2018, Martin Sebor wrote: Bug 84207 - Hard coded plural in gimple-fold.c points out one of a number of warning_at() calls where warning_n() should have been used.

Re: [PATCH] avoid bogus -Wstringop-truncation when inlining (PR 84480)

2018-02-22 Thread Martin Sebor
On 02/21/2018 07:53 PM, Jeff Law wrote: On 02/21/2018 02:19 PM, Martin Sebor wrote: The attached patch eliminates -Wstringop-truncation false positives reported in bug 84480 - bogus -Wstringop-truncation despite assignment with an inlined string literal. It does that by delegating early

Re: [PATCH] correct -Wrestrict handling of arrays of arrays (PR 84095)

2018-02-23 Thread Martin Sebor
On 02/22/2018 08:17 PM, Siddhesh Poyarekar wrote: On Friday 02 February 2018 05:15 AM, Martin Sebor wrote: PR middle-end/84095 - false-positive -Wrestrict warnings for memcpy within array gcc/ChangeLog: PR middle-end/84095 * gimple-ssa-warn-restrict.c (builtin_memref

[PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-23 Thread Martin Sebor
r257860 introduced an unsafe assumption under some conditions that the base object referenced by a memcpy strcpy necessarily has a pointer or array type. The attached patch removes this assumption. In addition, as discussed in the bug and in IRC, the patch also removes a test for the result of g

Re: [PATCH] Fix bogus function cast warning for functions with common arg subset

2018-02-23 Thread Martin Sebor
On 02/23/2018 11:52 AM, Siddhesh Poyarekar wrote: On Saturday 24 February 2018 12:01 AM, Richard Biener wrote: I don't see how the function cast is valid. I've argued for void (*) () to/from void (*) (int), etc. In the past and that was shot down similarly. This looks like exactly the same thi

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-23 Thread Martin Sebor
On 02/23/2018 01:13 PM, Jakub Jelinek wrote: On Fri, Feb 23, 2018 at 12:57:14PM -0700, Martin Sebor wrote: + /* get_inner_reference is not expected to return null. */ + gcc_assert (base != NULL); + poly_int64 bytepos = exact_div (bitpos, BITS_PER_UNIT); - HOST_WIDE_INT const_off; - if

Re: [PATCH] Fix bogus function cast warning for functions with common arg subset

2018-02-23 Thread Martin Sebor
On 02/23/2018 01:32 PM, Siddhesh Poyarekar wrote: On Saturday 24 February 2018 01:32 AM, Martin Sebor wrote: Casting the address of a function that takes one or more arguments to one that takes fewer is unsafe because when the pointer is used to call the function the extra arguments have

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-23 Thread Martin Sebor
On 02/23/2018 02:54 PM, Jakub Jelinek wrote: On Fri, Feb 23, 2018 at 02:46:28PM -0700, Martin Sebor wrote: This doesn't address any of my concerns that it is completely random what {dst,src}ref->base is, apples and oranges; sometimes it is a pointer (e.g. the argument of the

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-24 Thread Martin Sebor
On 02/24/2018 02:32 AM, Richard Sandiford wrote: Martin Sebor writes: On 02/23/2018 01:13 PM, Jakub Jelinek wrote: On Fri, Feb 23, 2018 at 12:57:14PM -0700, Martin Sebor wrote: + /* get_inner_reference is not expected to return null. */ + gcc_assert (base != NULL); + poly_int64 bytepos

[PING] [PATCH] consider successor blocks when avoiding -Wstringop-truncation (PR 84468)

2018-02-24 Thread Martin Sebor
Attached is an updated patch with a fix for a bad assumption exposed by building the linux kernel. On 02/19/2018 07:50 PM, Martin Sebor wrote: PR 84468 points out a false positive in -Wstringop-truncation in code like this: struct A { char a[4]; }; void f (struct A *p, const struct A *q

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-26 Thread Martin Sebor
effective please post a test case (or open a new bug). I will look into it when I get a chance. Until then, I'd like to get the ICE fix committed. Please confirm that the attached patch is good to go in. Martin On 02/23/2018 02:46 PM, Martin Sebor wrote: On 02/23/2018 01:13 PM, Jakub Jel

[PATCH] expand description of poly_int conversions

2018-02-26 Thread Martin Sebor
Richard, If you agree, I'd like to update the conversion section of the poly_int manual to make the conversion to make it clearer that the to_constant() function can be used even with class types like offset_int besides scalars. Also, when testing this I also tried converting poly64_int into wid

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-02-26 Thread Martin Sebor
On 02/26/2018 10:39 AM, Jakub Jelinek wrote: On Mon, Feb 26, 2018 at 10:32:27AM -0700, Martin Sebor wrote: That attached revision updates the pass to directly convert the poly64_int into offset_int using the API suggested by Richard (thanks again). As discussed below, I've made no

Re: [PATCH] expand description of poly_int conversions

2018-02-26 Thread Martin Sebor
On 02/26/2018 12:45 PM, Richard Sandiford wrote: Martin Sebor writes: Richard, If you agree, I'd like to update the conversion section of the poly_int manual to make the conversion to make it clearer that the to_constant() function can be used even with class types like offset_int be

[PATCH/testsuite] avoid test failures with -fpic

2018-02-26 Thread Martin Sebor
Compiling a number of tests with -fpic results in failures because the tests make use of non-inline, extern helper functions defined within, and these helpers must be assumed to have been superimposed elsewhere. For example: https://gcc.gnu.org/ml/gcc-testresults/2018-02/msg01762.html I took a q

Re: [PING] [PATCH] consider successor blocks when avoiding -Wstringop-truncation (PR 84468)

2018-02-26 Thread Martin Sebor
On 02/26/2018 12:13 PM, Jeff Law wrote: On 02/24/2018 05:11 PM, Martin Sebor wrote: Attached is an updated patch with a fix for a bad assumption exposed by building the linux kernel. On 02/19/2018 07:50 PM, Martin Sebor wrote: PR 84468 points out a false positive in -Wstringop-truncation in

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-26 Thread Martin Sebor
While reviewing other related bugs I noticed 83502. This patch doesn't fix the first test case in the bug (attribute noinline vs always_inline). Somehow those are still copied from the primary to the specialization and can cause conflicts. Hmm, that's odd. Why is that? Because duplicate_dec

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-27 Thread Martin Sebor
On 02/22/2018 02:15 PM, Joseph Myers wrote: On Thu, 22 Feb 2018, Martin Sebor wrote: Ping: https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00858.html This is just a tweak to fix a translation bug introduced by one of my warnings (calling warning() where warning_n() is more appropriate), and to

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-27 Thread Martin Sebor
On 02/27/2018 04:21 PM, David Edelsohn wrote: Martin, This patch broke bootstrap. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 42fd872..9c2e5e6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see all methods must be provided in h

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-27 Thread Martin Sebor
On 02/27/2018 04:44 PM, Jakub Jelinek wrote: On Mon, Feb 26, 2018 at 09:19:56PM -0700, Martin Sebor wrote: + /* Put together a list of the black listed attributes that the primary + template is declared with that the specialization is not, in case + it's not apparent from the

Re: [RFC PATCH] avoid applying attributes to explicit specializations (PR 83871)

2018-02-28 Thread Martin Sebor
On 02/28/2018 02:51 AM, Jakub Jelinek wrote: On Mon, Feb 26, 2018 at 09:19:56PM -0700, Martin Sebor wrote: PR c++/83871 PR c++/83503 * g++.dg/ext/attr-const.C: New test. * g++.dg/ext/attr-pure.C: New test. I've tried to fix these 2 tests with following

[PATCH] handle fallout from attributes patch (PR 84617)

2018-02-28 Thread Martin Sebor
The attached patch fixes the regressions in merging attributes on ordinary functions introduced by yesterday's commit to fix bug 83871. I've also added a new test to exercise the malloc bit even better (this is test #3 for a single bit). I have xfailed for now the remaining failures that expose

[PATCH] merge attributes from function template redeclarations (PR 84294)

2018-02-28 Thread Martin Sebor
Attached is a patch for the failure to merge a subset of attributes specified on redeclarations of a function template with those of the first declaration (const, malloc, pure, noinline, noreturn, and nothrow). This was uncovered this morning while debugging failures in tests I added just yesterd

Re: [PING] [PATCH] consider successor blocks when avoiding -Wstringop-truncation (PR 84468)

2018-03-01 Thread Martin Sebor
On 02/27/2018 06:50 PM, Jeff Law wrote: On 02/26/2018 05:47 PM, Martin Sebor wrote: On 02/26/2018 12:13 PM, Jeff Law wrote: On 02/24/2018 05:11 PM, Martin Sebor wrote: Attached is an updated patch with a fix for a bad assumption exposed by building the linux kernel. On 02/19/2018 07:50 PM

[PATCH] deprecate -finline-limit and make it an optimization option (PR 84603)

2018-03-01 Thread Martin Sebor
While testing my recent changes to the handling of attributes on C++ templates I noticed that the -finline-limit=N option is not recognized in attribute or pragma optimize. In response to the bug I raised, Richard you said the option is deprecated, so I went ahead and documented the deprecation i

Re: [PATCH] merge attributes from function template redeclarations (PR 84294)

2018-03-01 Thread Martin Sebor
On 03/01/2018 12:28 PM, Jason Merrill wrote: On Wed, Feb 28, 2018 at 5:47 PM, Martin Sebor wrote: Attached is a patch for the failure to merge a subset of attributes specified on redeclarations of a function template with those of the first declaration (const, malloc, pure, noinline, noreturn

Re: [PATCH] i18n fixes in gimple-ssa-sprintf.c

2018-03-01 Thread Martin Sebor
On 03/01/2018 04:25 PM, Jakub Jelinek wrote: Hi! This patch fixes a couple of i18n bugs in gimple-ssa-sprintf.c. One issue was incorrect format attribute for format_warning_at_substring, which has ... and thus shouldn't use 0 for the last argument, but the first non-named argument position. An

Re: [PATCH] deprecate -finline-limit and make it an optimization option (PR 84603)

2018-03-03 Thread Martin Sebor
On 03/02/2018 01:05 AM, Richard Biener wrote: On Thu, 1 Mar 2018, Martin Sebor wrote: While testing my recent changes to the handling of attributes on C++ templates I noticed that the -finline-limit=N option is not recognized in attribute or pragma optimize. In response to the bug I raised

Re: [PATCH] deprecate -finline-limit and make it an optimization option (PR 84603)

2018-03-03 Thread Martin Sebor
On 03/02/2018 01:05 AM, Richard Biener wrote: On Thu, 1 Mar 2018, Martin Sebor wrote: While testing my recent changes to the handling of attributes on C++ templates I noticed that the -finline-limit=N option is not recognized in attribute or pragma optimize. In response to the bug I raised

[PATCH] accept attribute nonstring on all narrow characters (PR 84725)

2018-03-05 Thread Martin Sebor
Attribute nonstring is currently only allowed on arrays and pointers to plain char, but -Wstringop-truncation triggers even for strncpy calls whose arguments are arrays of signed or unsigned char (with or without a cast to char*). To help deal with -Wstringop-truncation in the Linux kernel it was

Re: [PATCH] replace ICE with error for failed template deduction (PR 84355)

2018-03-05 Thread Martin Sebor
On 02/23/2018 07:32 PM, Jason Merrill wrote: On Sun, Feb 18, 2018 at 11:39 PM, Jason Merrill wrote: On Fri, Feb 16, 2018 at 4:33 PM, Martin Sebor wrote: On 02/16/2018 07:04 AM, Jason Merrill wrote: On Thu, Feb 15, 2018 at 6:36 PM, Martin Sebor wrote: A failed template deduction in

[PATCH] use attribute exclusion to reject naked vs target_clones conflicts (PR 84723)

2018-03-06 Thread Martin Sebor
PR 84723 is about an ICE caused by GCC accepting the mutually exclusive attributes target_clones and naked during parsing, only to then later crash while assuming such conflicts don't happen. The attached patch adds an exclusion for the two attributes to detect when they're both specified on decl

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-03-07 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-02/msg01441.html Jeff, I know this is in your queue. I ping it because a bug with the same root cause was reported in RHBZ #1552639. On 02/26/2018 11:13 AM, Martin Sebor wrote: On 02/26/2018 10:39 AM, Jakub Jelinek wrote: On Mon, Feb 26, 2018 at

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-03-07 Thread Martin Sebor
On 03/07/2018 12:37 PM, Jeff Law wrote: On 02/26/2018 10:32 AM, Martin Sebor wrote: PR tree-optimization/84526 - ICE in generic_overlap at gcc/gimple-ssa-warn-restrict.c:927 since r257860 gcc/ChangeLog: PR tree-optimization/84526 * gimple-ssa-warn-restrict.c (builtin_memref

[PATCH] avoid warning for memcpy to self (PR 83456)

2018-03-07 Thread Martin Sebor
I have become convinced that issuing -Wrestrict in gimple-fold for calls to memcpy() where the source pointer is the same as the destination causes more trouble than it's worth, especially when inlining is involved, as in: inline void bar (void *d, void *s, unsigned N) { if (s != d)

Re: [PATCH] fix ICE in generic_overlap (PR 84526)

2018-03-07 Thread Martin Sebor
On 03/07/2018 04:04 PM, Richard Sandiford wrote: Martin Sebor writes: @@ -409,23 +412,33 @@ builtin_memref::set_base_and_offset (tree expr) base = get_inner_reference (expr, &bitsize, &bitpos, &var_off, &mode, &sign, &reverse, &vol)

Re: [PATCH] avoid warning for memcpy to self (PR 83456)

2018-03-08 Thread Martin Sebor
On 03/08/2018 01:59 AM, Richard Biener wrote: On Thu, Mar 8, 2018 at 12:01 AM, Martin Sebor wrote: I have become convinced that issuing -Wrestrict in gimple-fold for calls to memcpy() where the source pointer is the same as the destination causes more trouble than it's worth, especially

Re: [PATCH] use attribute exclusion to reject naked vs target_clones conflicts (PR 84723)

2018-03-12 Thread Martin Sebor
Martin On 03/06/2018 10:19 PM, Martin Sebor wrote: PR 84723 is about an ICE caused by GCC accepting the mutually exclusive attributes target_clones and naked during parsing, only to then later crash while assuming such conflicts don't happen. The attached patch adds an exclusion for th

Re: [PATCH] accept attribute nonstring on all narrow characters (PR 84725)

2018-03-13 Thread Martin Sebor
On 03/12/2018 05:13 PM, Jeff Law wrote: On 03/05/2018 01:54 PM, Martin Sebor wrote: Attribute nonstring is currently only allowed on arrays and pointers to plain char, but -Wstringop-truncation triggers even for strncpy calls whose arguments are arrays of signed or unsigned char (with or

[PATCH] relax -Wclass-memaccess for class members (PR 84850)

2018-03-19 Thread Martin Sebor
The -Wclass-memaccess warning makes an exception for ctors and dtors of non-trivial classes with no bases to avoid triggering for uses of raw memory functions with this as the destination. All other members as well as non-members trigger the warning. In bug 84850 the reporter shows that some code

[committed] xfail assertion in c-c++-common/Warray-bounds-3.c (PR 83462)

2018-03-27 Thread Martin Sebor
An assertion in the test fails on a number of targets due to a missing strlen optimization. I plan to add the optimization for GCC 9 but it's too late to add it now. To prevent the failure r258896 disables and xfails the assertion for targets other than x86. Attached is the change for reference

[documentation patch] add detail to const and pure attributes

2018-03-27 Thread Martin Sebor
From some feedback I received on some of the attribute warnings new in GCC 8 it seems that the manual could stand to be clarified to explain why it makes no sense for a function declared with attribute const (and pure) to return void. The attached patch adds a bit more text to make it clear. In

Re: [documentation patch] add detail to const and pure attributes

2018-03-27 Thread Martin Sebor
On 03/27/2018 01:38 PM, Pedro Alves wrote: On 03/27/2018 07:18 PM, Martin Sebor wrote: +Because a @code{pure} function can have no side-effects it does not FWIW, I'd suggest rephrasing as: Because a @code{pure} function cannot have side effects because "can have no side-effec

[PATCH] use warning_n instead of _at (PR 84818)

2018-03-29 Thread Martin Sebor
The attached patch replaces a couple of uses of warning_at in builtins.c with the more appropriate warning_n calls as suggested in the bug. The change passes regression testing on x86_64-linux. I'll go ahead and commit it as obvious in the next day or so unless there are objections. Thanks Mart

[doc patch] remove hyphen from side-effect

2018-04-02 Thread Martin Sebor
Attached is a patch to remove the hyphen from uses of side-effect in the manual as per the comment in: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00021.html Although both forms are common, "side effect" (without the hyphen) is more prevalent in current English and I think it's better to be

Re: [documentation patch] add detail to const and pure attributes

2018-04-02 Thread Martin Sebor
On 04/02/2018 12:09 AM, Sandra Loosemore wrote: On 03/27/2018 03:21 PM, Pedro Alves wrote: On 03/27/2018 09:19 PM, Martin Sebor wrote: On 03/27/2018 01:38 PM, Pedro Alves wrote: On 03/27/2018 07:18 PM, Martin Sebor wrote: +Because a @code{pure} function can have no side-effects it does not

[committed] fix a couple of typos in manual

2018-04-02 Thread Martin Sebor
/ChangeLog === --- gcc/ChangeLog (revision 259019) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2018-04-02 Martin Sebor + + * doc/invoke.texi (-Wrestrict): Fix typos. + 2018-04-02 Jim Wilson * config/riscv/riscv.h (SHIFT_COUNT

Re: [documentation patch] add detail to const and pure attributes

2018-04-03 Thread Martin Sebor
On 04/03/2018 03:27 AM, Pedro Alves wrote: On 04/02/2018 11:34 PM, Martin Sebor wrote: On 04/02/2018 12:09 AM, Sandra Loosemore wrote: On 03/27/2018 03:21 PM, Pedro Alves wrote: On 03/27/2018 09:19 PM, Martin Sebor wrote: On 03/27/2018 01:38 PM, Pedro Alves wrote: On 03/27/2018 07:18 PM

Re: [wwwdocs] gcc-8/changes.html

2018-04-03 Thread Martin Sebor
On 04/03/2018 05:16 AM, Martin Liška wrote: Hello. I would like to document features I prepared in time frame of GCC 8. Martin Just a few minor nits: @@ -113,6 +113,93 @@ possible for the user to have a finer-grained control over the loop unrolling optimization. + +GCOV

Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function

2018-04-03 Thread Martin Sebor
On 04/03/2018 10:26 AM, dave.pa...@oracle.com wrote: This patch fixes handlng of -Werror=return-type. Currently, even with the flag specified, return type errors remain warnings. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976 Function c_finish_return (), when calling pedwarn, should specifi

[wwwdocs] document new options in gcc-8/changes.html

2018-04-03 Thread Martin Sebor
The attached changes add documentation of some of the options I worked on for GCC 8. The links to the GCC 8 manual don't work because there is no gcc-8 documentation directory. I have checked them by hand by substituting the GCC 7 directory. (I wonder: would it be possible to populate the GCC 8

Re: [wwwdocs] gcc-8/changes.html additions

2018-04-04 Thread Martin Sebor
On 04/04/2018 01:43 AM, Jakub Jelinek wrote: Hi! Following patch documents store merging improvements, -fsanitize=builtin, -fsanitize=pointer-overflow and C++2A progress. Ok for wwwdocs? --- changes.html3 Apr 2018 06:52:04 - 1.51 +++ changes.html4 Apr 2018 07:41:06 -0

Re: [PATCH 1/3] improve detection of attribute conflicts (PR 81544)

2018-04-04 Thread Martin Sebor
On 04/04/2018 10:51 AM, Andreas Krebbel wrote: On 04/04/2018 06:16 PM, Andreas Krebbel wrote: On 10/03/2017 12:23 AM, Jeff Law wrote: On 09/20/2017 12:04 PM, Martin Sebor wrote: On 09/19/2017 03:00 PM, Joseph Myers wrote: On Tue, 19 Sep 2017, Martin Sebor wrote: In general, the data

Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function

2018-04-04 Thread Martin Sebor
On 04/04/2018 11:15 AM, Jakub Jelinek wrote: On Tue, Apr 03, 2018 at 01:36:13PM -0600, Martin Sebor wrote: On 04/03/2018 10:26 AM, dave.pa...@oracle.com wrote: This patch fixes handlng of -Werror=return-type. Currently, even with the flag specified, return type errors remain warnings. https

Re: C++ PATCH for c++/84221, bogus -Wunused with unused attribute on template

2018-04-04 Thread Martin Sebor
On 04/04/2018 01:04 PM, Jason Merrill wrote: For bugs 54372 and 60063, we changed attributes used and unused to be applied immediately in a template even if what they apply to is dependent, to avoid bogus warnings from maybe_warn_unused_local_typedefs. But that's only an issue for TYPE_DECL, so

Re: C++ PATCH for c++/84221, bogus -Wunused with unused attribute on template

2018-04-04 Thread Martin Sebor
On 04/04/2018 01:58 PM, Jason Merrill wrote: On Wed, Apr 4, 2018 at 3:52 PM, Martin Sebor wrote: On 04/04/2018 01:04 PM, Jason Merrill wrote: For bugs 54372 and 60063, we changed attributes used and unused to be applied immediately in a template even if what they apply to is dependent, to

Re: [wwwdocs] gcc-8/changes.html additions

2018-04-04 Thread Martin Sebor
On 04/04/2018 12:24 PM, Bernd Edlinger wrote: Hi, this adds a few gcc command line options to gcc-8/changes.html which I added for gcc-8. Just a couple of suggestions: 1) Use to render sizeof in monospace: + -Wsizeof-pointer-div warns for suspicious divisions + of two sizeof exp

Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-04 Thread Martin Sebor
Attached is an updated diff rebased on top of the latest revision of the file. This new version fixes the typos Paolo pointed out (thanks) and adds a few more options: -Wmissing-attributes, -Wif-not-aligned, and -Wpacked-not-aligned. I used a spell-checker this time to (hopefully) minimize the

Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function

2018-04-04 Thread Martin Sebor
On 04/04/2018 05:50 PM, dave.pa...@oracle.com wrote: On 04/04/2018 10:58 AM, Martin Sebor wrote: On 04/04/2018 11:15 AM, Jakub Jelinek wrote: On Tue, Apr 03, 2018 at 01:36:13PM -0600, Martin Sebor wrote: On 04/03/2018 10:26 AM, dave.pa...@oracle.com wrote: This patch fixes handlng of -Werror

[doc PATCH] fix up C++ option references (PR 71283)

2018-04-05 Thread Martin Sebor
Attached is the final version of the patch to adjust the lists of options (C++ Language Options and -Wall) to include missing C++ options, reference the forms of options that aren't the default, and use TexInfo tables for the lists of options in -Wall and -Wextra to address Nathan's comment. The

[PATCH/doc] - mention all optimization options that enable inlining options

2018-04-08 Thread Martin Sebor
at is, in fact, what we want then we might want to script this. Martin 2018-04-08 Martin Sebor * invoke.texi (-finline-small-functions): Mention other optimization options. (-findirect-inlining, -fpartial-inlining): Same. (-finline-functions-called-once): Same. (-freorder-blocks-and-part

Re: [committed] fix a couple of typos in manual

2018-04-08 Thread Martin Sebor
On 04/07/2018 05:43 PM, Gerald Pfeifer wrote: On Mon, 2 Apr 2018, Martin Sebor wrote: I committed r259020 to fix a couple of typos in the documentation of the -Wrestrict option. The diff is below for reference. -The @option{-Wrestrict} is included in @option{-Wall}. +The @option{-Wrestrict

Re: [doc patch] remove hyphen from side-effect

2018-04-09 Thread Martin Sebor
Ping: I will go ahead and commit this patch sometime this week unless I hear objections: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00036.html Martin On 04/02/2018 03:55 PM, Martin Sebor wrote: Attached is a patch to remove the hyphen from uses of side-effect in the manual as per the

Re: [PATCH/doc] - mention all optimization options that enable inlining options

2018-04-09 Thread Martin Sebor
On 04/09/2018 01:36 AM, Richard Biener wrote: On Sun, 8 Apr 2018, Martin Sebor wrote: While updating the -Wrestrict option to mention that it works best not just with -O2 but also at higher optimization levels I looked around for other options that might benefit from a similar clarification

Re: [doc patch] remove hyphen from side-effect

2018-04-10 Thread Martin Sebor
On 04/09/2018 06:37 PM, Sandra Loosemore wrote: On 04/09/2018 05:58 PM, Martin Sebor wrote: Ping: I will go ahead and commit this patch sometime this week unless I hear objections: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00036.html This patch is mostly OK, except for these hunks

Re: [doc PATCH] fix up C++ option references (PR 71283)

2018-04-11 Thread Martin Sebor
On 04/11/2018 09:44 AM, Jason Merrill wrote: On 04/05/2018 07:28 PM, Martin Sebor wrote: Attached is the final version of the patch to adjust the lists of options (C++ Language Options and -Wall) to include missing C++ options, reference the forms of options that aren't the default, an

Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-11 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00219.html There's one outstanding typo that Paolo noticed since I posted the update. I'll fix that before committing. On 04/04/2018 04:28 PM, Martin Sebor wrote: Attached is an updated diff rebased on top of the latest revision o

Re: [PATCH] Invoke maybe_warn_nonstring_arg for strcpy/stpcpy builtins.

2018-04-11 Thread Martin Sebor
On 04/11/2018 06:47 AM, Andreas Krebbel wrote: On 04/11/2018 10:02 AM, Jakub Jelinek wrote: On Wed, Apr 11, 2018 at 09:48:05AM +0200, Andreas Krebbel wrote: c-c++-common/attr-nonstring-3.c fails on IBM Z. The reason appears to be that we provide builtin implementations for strcpy and stpcpy. T

<    5   6   7   8   9   10   11   12   13   14   >