[PATCH] testsuite/63175 - fix powerpc64 test failure

2015-03-23 Thread Martin Sebor
/ChangeLog b/gcc/testsuite/ChangeLog index 884fb62..d781c02 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-03-23 Martin Sebor + + PR testsuite/63175 + * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a-pr63175.c: Scan + assembly for lvx in

Re: [PATCH] pr 63354 - gcc -pg -mprofile-kernel creates unused stack frames on leaf functions on ppc64le

2015-03-23 Thread Martin Sebor
On 03/21/2015 01:48 PM, Iain Sandoe wrote: Hi Martin, I've applied your latest patch to top of trunk and looked at the code gen on powerpc-darwin9 (and a cross from x86-64-darwin12 => powerpc64-linux-gnu). Thanks for the review! 2015-03-13 Anton Blanchard PR target/63354

Re: [PATCH] pr 63354 - gcc -pg -mprofile-kernel creates unused stack frames on leaf functions on ppc64le

2015-03-24 Thread Martin Sebor
* config/rs6000/rs6000.c (rs6000_keep_leaf_when_profiled): New function. 2015-03-24 Martin Sebor PR target/63354 * gcc.target/powerpc/pr63354.c: New test. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 31b46ea..f1508b9 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs

[PATCH] testsuite checks for arm vectorization support on non-arm targets

2015-03-25 Thread Martin Sebor
The attached patch adds tests to lib/target-supports.exp to avoid unnecessarily invoking the compiler on non-ARM targets to check for the support for a number of ARM vectorization features. Okay to commit to trunk? Martin 2015-03-23 Martin Sebor * lib/target-supports.exp

[PATCH] gfortran.dg/pr32627.f03 prints nul byte

2015-04-09 Thread Martin Sebor
f non-nul characters. Tested on powerpc64. Martin 2015-04-09 Martin Sebor * gfortran.dg/pr32627.f03 (strptr): Change size to match the number of non-nul characters. diff --git a/gcc/testsuite/gfortran.dg/pr32627.f03 b/gcc/testsuite/gfortran.dg/pr32627.f03 index f8695e0..d9e2b13 100644 ---

Re: [PATCH] gfortran.dg/pr32627.f03 prints nul byte

2015-04-09 Thread Martin Sebor
tools designed to post-process log files (e.g., grep) that are intended to work with text files (i.e., files not containing nuls). Control characters can cause the tools to fail in non-C locales (such as UTF-8). On 04/09/2015 12:54 PM, Martin Sebor wrote: We've been debugging a problem where nul

Re: [v3 PATCH] Implement N4387 and LWG 2367

2015-06-08 Thread Martin Sebor
* include/std/tuple In the hunk below, should the sizes_match template parameter be privatized (since it isn't part of the public interface)? Or perhaps even removed if it's not used? Martin @ -457,6 +457,73 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; + + // Concept utility fun

Re: [patch] libstdc++/66030 fix codecvt exports for mingw32

2015-06-08 Thread Martin Sebor
On 06/08/2015 09:12 AM, Jonathan Wakely wrote: The linker script assumes that std::mbstate_t has the name __mbstate_t for linkage purposes, but that's not necessarily true. For mingw32 it's just a typedef for int, so the patterns don't match. This adds a new mingw32-specific pattern for codecvt_

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-11 Thread Martin Sebor
function (since every function has main as its direct or indirect caller). Tested on powerpc64le and x86_64 Linux. Martin The ChangeLog entries for gcc and testsuite: 2015-06-11 Martin Sebor * c-family/c.opt (-Wbuiltin-address): New warning option. * doc/invoke.texi

Re: [PATCH] 65479 - sanitizer stack trace missing frames past #0 on powerpc64

2015-06-11 Thread Martin Sebor
OK. You can go ahead and commit the libbacktrace fix. Committed in r224402. Let's hold off on the testsuite fixes until we've got the sanitizer & libbacktrace fixes installed. Okay. Martin

[PING] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-18 Thread Martin Sebor
Are there any concerns with or suggestions for changes to the following patch? https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00886.html Thanks Martin

[PATCH] c/66516 - missing diagnostic on taking the address of a builtin function

2015-06-21 Thread Martin Sebor
)(int) = __builtin_ffs; int main () { return r (0); } /build/tmp/u.cpp:1:34: error: invalid initialization of a reference with a builtin function static constexpr int (&r)(int) = __builtin_ffs; ^ 2015-06-21 Martin Sebor PR c/66516 * c/c-typeck.c (default

Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function

2015-06-22 Thread Martin Sebor
It seems like this patch regresess pr59630.c testcase; I don't see the testcase being addressed in this patch. Thanks for the review and for pointing out this regression! I missed it among all the C test suite failures (I see 157 of them in 24 distinct tests on x86_64.) pr59630 is marked ice-on

Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function

2015-06-23 Thread Martin Sebor
On 06/23/2015 04:29 AM, Jakub Jelinek wrote: On Tue, Jun 23, 2015 at 12:18:30PM +0200, Marek Polacek wrote: Is it intended that programs be able to take the address of the builtins that correspond to libc functions and make calls to the underlying libc functions via such pointers? (If so, the pa

Re: [PING 2] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-26 Thread Martin Sebor
Is this patch okay for trunk? On 06/18/2015 11:15 AM, Martin Sebor wrote: Are there any concerns with or suggestions for changes to the following patch? https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00886.html Thanks Martin

Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function

2015-06-28 Thread Martin Sebor
. Bootstrapped and tested on x86_64-unknown-linux-gnu. Martin 2015-06-28 Martin Sebor pr c/66516 * tree.h (DECL_IS_GCC_BUILTIN): New macro. * doc/extend.texi (Other Builtins): Document when the address of a builtin function can be taken. 2015-06-28 Martin Sebor pr c/66516 * c-tree.h

Re: [PATCH] Allow embedded timestamps by C/C++ macros to be set externally

2015-06-30 Thread Martin Sebor
In the debian reproducible builds project we have considered several options to address this issue. We considered redefining the __DATE__ and __TIME__ defines by command line flags passed to gcc, but as you say, that triggers warnings, which could become errors when building with -Werror and thus

Re: [PATCH] c/66516 - missing diagnostic on taking the address of a builtin function

2015-07-04 Thread Martin Sebor
hed is an updated patch with these changes. Martin gcc/ChangeLog 2015-07-04 Martin Sebor pr c/66516 * tree.h (DECL_IS_GCC_BUILTIN): New macro. * doc/extend.texi (Other Builtins): Document when the address of a built-in function can be taken. gcc/c/ChangeLog 2015-07-04 Martin Sebor

[PING 3] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-06 Thread Martin Sebor
This is a small change to diagnose unsafe calls to __builtin_{frame,return}_address (with an argument > 2) than tend to return bogus values or lead to crashes at runtime. A review would be appreciated. Thanks Martin On 06/26/2015 05:49 PM, Martin Sebor wrote: Is this patch okay for trunk?

[PATCH] PR63175 - [4.9/5 regression] FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1

2015-02-21 Thread Martin Sebor
+1,9 @@ +2015-02-21 Martin Sebor + + PR testsuite/63175 + * gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c: Correct + expected string. + 2015-02-18 Jakub Jelinek PR gcov-profile/64634 Index: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c

[PATCH] Fix PR 65109 - [5 Regression] r220674 causes FAIL: gcc.target/powerpc/ppc64-abi-1.c execution test

2015-02-21 Thread Martin Sebor
+ ABI_CHECK (fcldi, (s, 1, 1.0, -2)); + ABI_CHECK (fcldu, (s, 1, 1.0, 2)); + ABI_CHECK (fceld, (s, 1, 1.0)); + ABI_CHECK (fciiedl, (s, 1, 2, 1.0, 3)); + ABI_CHECK (fididisdsid, (1, 1.0, 2, 2.0, -1, + (sparm){3, 3.0}, 4.0, (sparm){5, 5.0}, + 6, 7.0)); + return 0; } Ind

[PATCH] fix more -Wformat-diag issues

2019-05-22 Thread Martin Sebor
Incorporating the feedback I got on the -Wformat-diag checker provided an opportunity to tighten up existing and implement a small number of few additional rules based on GCC Coding Conventions (https://gcc.gnu.org/codingconventions.html). The checker now also warns for incorrect uses of the follo

[PATCH] implement -Wformat-diag, v2

2019-05-22 Thread Martin Sebor
Attached is a revised implementation of the -Wformat-diag checker incorporating the feedback I got on the first revision. Martin gcc/c-family/ChangeLog: * c-format.c (function_format_info::format_type): Adjust type. (function_format_info::is_raw): New member. (decode_format_type): Adjust sign

[PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-22 Thread Martin Sebor
-Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary automatic variables[1]. The attached patch extends the implementation of the warning to detect t

Re: [PATCH] PR c/86407 - Add option to ignore fndecl attributes on function pointers

2019-05-24 Thread Martin Sebor
On 5/23/19 9:57 PM, Alex Henrie wrote: --- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86407#c6 --- gcc/c-family/c.opt | 4 gcc/c/c-decl.c | 4 +++- gcc/config/i386/i386-options.c | 12 ++-- gcc/testsuite/c-c++-common/pr8640

Re: Simplify more EXACT_DIV_EXPR comparisons

2019-05-28 Thread Martin Sebor
On 5/21/19 3:53 AM, Richard Biener wrote: On Tue, May 21, 2019 at 4:13 AM Martin Sebor wrote: On 5/20/19 3:16 AM, Richard Biener wrote: On Mon, May 20, 2019 at 10:16 AM Marc Glisse wrote: On Mon, 20 May 2019, Richard Biener wrote: On Sun, May 19, 2019 at 6:16 PM Marc Glisse wrote

Re: [PATCH] Fix few build warnings with LLVM toolchain

2019-05-28 Thread Martin Sebor
On 5/28/19 4:24 AM, Martin Liška wrote: On 5/28/19 11:31 AM, David CARLIER wrote: Hi, Here a tiny patch to fix few build warnings. Kind regards. Hi. Well, I see a lot of these struct/class discrepancies when building GCC with LLVM. Question is whether it worth changing? I think it's nic

Re: [PATCH] PR c/86407 - Add option to ignore fndecl attributes on function pointers

2019-05-28 Thread Martin Sebor
On 5/24/19 9:49 AM, Alex Henrie wrote: On Fri, May 24, 2019 at 2:01 AM Richard Biener wrote: I'm not sure we really need a new warning for this. On Fri, May 24, 2019 at 9:23 AM Martin Sebor wrote: I don't think GCC makes a formal distinction between function attributes that a

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/29/19 11:45 AM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary auto

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/30/19 9:13 AM, Jeff Law wrote: On 5/30/19 8:52 AM, Martin Sebor wrote: On 5/29/19 11:45 AM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't t

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-05-30 Thread Martin Sebor
On 5/30/19 10:15 AM, Jeff Law wrote: On 5/30/19 9:34 AM, Martin Sebor wrote: If the alias oracle can be used to give the same results without excessive false positives then I think it would be fine to make use of it.  Is that something you consider a prerequisite for this change or should I

Re: [PATCH] PR71482: Add -Wglobal-constructors

2019-05-30 Thread Martin Sebor
On 5/28/19 3:30 PM, Sean Gillespie wrote: This adds a new warning, -Wglobal-constructors, that warns whenever a decl requires a global constructor or destructor. This new warning fires whenever a thread_local or global variable is declared whose type has a non-trivial constructor or destructor. W

Re: value_range_base::{non_zero_p, set_zero, set_non_zero}

2019-05-30 Thread Martin Sebor
On 5/30/19 12:58 AM, Aldy Hernandez wrote: Hi. We have zero_p in the API, but we don't have non_zero_p.  Instead we use a non-API function range_is_nonnull.  I've fixed this. I have also gotten rid of the duplicity of using the non-API range_is_null in favor of value_range_base::zero_p().

Re: [PATCH] fix more -Wformat-diag issues

2019-05-31 Thread Martin Sebor
On 5/30/19 5:49 PM, Jeff Law wrote: On 5/22/19 10:34 AM, Martin Sebor wrote: Incorporating the feedback I got on the -Wformat-diag checker provided an opportunity to tighten up existing and implement a small number of few additional rules based on GCC Coding Conventions (https://gcc.gnu.org

Re: [PATCH] PR71482: Add -Wglobal-constructors

2019-05-31 Thread Martin Sebor
On 5/31/19 10:12 AM, Sean Gillespie wrote: On Thu, May 30, 2019 at 4:28 PM Martin Sebor wrote: On 5/28/19 3:30 PM, Sean Gillespie wrote: This adds a new warning, -Wglobal-constructors, that warns whenever a decl requires a global constructor or destructor. This new warning fires whenever a

[PATCH] correct the representation of ADDR_EXPR involving pointer to array [PR 90694]

2019-05-31 Thread Martin Sebor
Given a poiner to array p, tree dumps for expressions like &(*p)[2] actually show &*p[2]. That's not right -- the parentheses are important to differentiate indexing into the array the pointer points to from indexing into the pointer. The attached patch adjusts the tree pretty printer to add the

[PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-01 Thread Martin Sebor
I spent a bunch of time the other day trying to understand why the second of the two assignments below to a char array was apparently not being done by trunk a[0] = 1; a[1] = 0; The optimized GIMPLE dump simply shows: MEM[(char *)&a] = 1; when in the past it showed: MEM[(char[2] *)&a2

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-01 Thread Martin Sebor
A patch with a ChangeLog this time is attached. On 6/1/19 9:53 AM, Martin Sebor wrote: I spent a bunch of time the other day trying to understand why the second of the two assignments below to a char array was apparently not being done by trunk   a[0] = 1;   a[1] = 0; The optimized GIMPLE

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-03 Thread Martin Sebor
On 6/3/19 4:34 AM, Richard Biener wrote: On Mon, Jun 3, 2019 at 10:57 AM Jakub Jelinek wrote: On Mon, Jun 03, 2019 at 10:36:42AM +0200, Richard Biener wrote: To avoid this confusion the attached patch adds to the dump a cast to the MEM_REF type for accesses whose size is not equal to the size

Re: [PATCH] detect references to statics in inline function signatures (PR 88718)

2019-06-03 Thread Martin Sebor
I posted the patch right on the cusp of stage 4, thinking it was still stage 3. I thought I could finish it quickly but after the last round of comments I decided to move on to stage 4 stuff. I've contemplating coming back to it at some point. That being said, the patch fixes the reported bug wi

[PATCH] preserve integer value of local addresses returned from functions (PR 90737)

2019-06-03 Thread Martin Sebor
While testing a different -Wreturn-local-addr bug fix/enhancement I noticed that in functions that return integers as opposed to pointers such as: intptr_t f (int i) { return (intptr_t)&i; } the converted address is folded to zero. This can be detected by strictly conforming programs so it's

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-03 Thread Martin Sebor
On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or some non-trivial cases of ordinary auto

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-04 Thread Martin Sebor
On 6/3/19 5:24 PM, Martin Sebor wrote: On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a function but the warning doesn't try to handle alloca or VLAs, or som

Re: [PATCH] Improve PTA flow-sensitivity (for the return stmt)

2019-06-05 Thread Martin Sebor
On 6/5/19 6:51 AM, Richard Biener wrote: The following was inspired by Marins work on escapes of locals and the discussion there. It teaches points-to analysis that the point of function return is special and thus escapes through that a) do not influence other points-to solutions, b) can be pru

Re: [PATCH] fix more -Wformat-diag issues

2019-06-05 Thread Martin Sebor
On 5/31/19 12:20 PM, Jeff Law wrote: On 5/31/19 9:56 AM, Martin Sebor wrote: On 5/30/19 5:49 PM, Jeff Law wrote: So in several places there's a comment which indicates that debugging dumps and the like do not follow conventions.  Presumably you've tried to keep a narrow scope on the

[PATCH] handle vla plus offset in strlen (PR 90662)

2019-06-05 Thread Martin Sebor
One of my new tests for the strlen/sprintf integration tripped over an incomplete handling of VLAs by the strlen pass. Where it can determine the length of a substring at some offset with other kinds of arrays, the pass fails with VLAs because they are represented as pointers to arrays. The atta

Re: [PATCH] fix more -Wformat-diag issues

2019-06-06 Thread Martin Sebor
On 6/6/19 3:39 AM, Jakub Jelinek wrote: On Wed, May 22, 2019 at 10:34:00AM -0600, Martin Sebor wrote: gcc/ChangeLog: * config/i386/i386-features.c (ix86_get_function_versions_dispatcher): Adjust quoting and hyphenation. * convert.c (convert_to_real_1): Same

Re: [PATCH] Add warn_unused_result for malloc-like functions (PR tree-optimization/78902).

2019-06-06 Thread Martin Sebor
On 6/6/19 2:01 AM, Martin Liška wrote: Hi. The patch is about addition of warn_unused_attribute for malloc-like function. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. I like this change (as you know :) Just one question: should all allocation functions be also annot

Re: [PATCH] fix more -Wformat-diag issues

2019-06-06 Thread Martin Sebor
On 6/6/19 9:42 AM, Jakub Jelinek wrote: On Thu, Jun 06, 2019 at 08:45:56AM -0600, Martin Sebor wrote: Changes for the same change shouldn't be separated by empty newlines in the ChangeLog. Furthermore, you've managed to commit only the first part (until varasm.c) and not the rest.

[PATCH] remove trailing spaces from tree-ssa-strlen.c

2019-06-06 Thread Martin Sebor
To avoid trailing whitespace in my commits I have my editor set to highlight them. While integrating the strlen/sprintf passes and making more extensive changes than usual, I keep getting distracted by the highlighting pointing out trailing spaces that predate my changes. Rather than "fixing" th

[PATCH] update get_range_strlen description

2019-06-06 Thread Martin Sebor
Hi Jeff, It looks like the updated comment for get_range_strlen didn't make it into the strlen fixup commits last December and the function still has the old description. (Not surprising given there are at least two overloads of the same function and things moving between them.) I'm going to ch

Re: [PATCH] fix more -Wformat-diag issues

2019-06-07 Thread Martin Sebor
On 6/7/19 6:57 AM, Christophe Lyon wrote: On Wed, 5 Jun 2019 at 20:33, Martin Sebor wrote: On 5/31/19 12:20 PM, Jeff Law wrote: On 5/31/19 9:56 AM, Martin Sebor wrote: On 5/30/19 5:49 PM, Jeff Law wrote: So in several places there's a comment which indicates that debugging dumps an

Re: [PATCH][RFC] Sanitize equals and hash functions in hash-tables.

2019-06-07 Thread Martin Sebor
On 6/7/19 6:13 AM, Martin Liška wrote: On 6/7/19 2:09 PM, Richard Biener wrote: On Fri, Jun 7, 2019 at 2:03 PM Martin Liška wrote: On 6/7/19 10:57 AM, Richard Biener wrote: On Mon, Jun 3, 2019 at 3:35 PM Martin Liška wrote: On 6/1/19 12:06 AM, Jeff Law wrote: On 5/22/19 3:13 AM, Martin L

Re: [PATCH] Add warn_unused_result for malloc-like functions (PR tree-optimization/78902).

2019-06-07 Thread Martin Sebor
On 6/6/19 11:27 PM, Martin Liška wrote: On 6/6/19 5:17 PM, Martin Sebor wrote: On 6/6/19 2:01 AM, Martin Liška wrote: Hi. The patch is about addition of warn_unused_attribute for malloc-like function. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. I like this change

Re: [PATCH] handle vla plus offset in strlen (PR 90662)

2019-06-07 Thread Martin Sebor
On 6/6/19 3:53 PM, Jeff Law wrote: On 6/5/19 4:51 PM, Martin Sebor wrote: One of my new tests for the strlen/sprintf integration tripped over an incomplete handling of VLAs by the strlen pass.  Where it can determine the length of a substring at some offset with other kinds of arrays, the pass

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-10 Thread Martin Sebor
On 6/7/19 2:10 PM, Matthew Beliveau wrote: This patch adds a new warning option: Winaccessible-base, so that users are able to selectively control the warning. The warning is enabled by default; however, for the virtual bases' warning, it only triggers with -Wextra flag. With few exceptions the

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-10 Thread Martin Sebor
The attached update adds the MEM_REF type in pointy braces like in the -gimple format, but without the access size: MEM [(char *)&a] = 1; Martin On 6/4/19 4:57 AM, Richard Biener wrote: On Mon, Jun 3, 2019 at 5:13 PM Martin Sebor wrote: On 6/3/19 4:34 AM, Richard Biener wrote: On

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-10 Thread Martin Sebor
On 6/10/19 1:29 PM, Jakub Jelinek wrote: On Mon, Jun 10, 2019 at 01:23:28PM -0600, Martin Sebor wrote: + else if (integer_zerop (TREE_OPERAND (node, 1)) + /* Dump the types of INTEGER_CSTs explicitly, for we can't + infer them and MEM_ATTR caching will share MEM

Re: [C++ PATCH] PR c++/90449 - add -Winaccessible-base option.

2019-06-11 Thread Martin Sebor
On 6/11/19 7:59 AM, Matthew Beliveau wrote: Hello, Correct me if I'm wrong, but before the function checks for virtual bases, an if-statement checks for extra_warnings on line 6049(when my patch is applied). The check was there before I made my changes, and my test fails without -Wextra. Below

Re: Add value_range_base::contains_p

2019-06-11 Thread Martin Sebor
On 6/11/19 9:05 AM, Aldy Hernandez wrote: On 6/11/19 9:45 AM, Richard Biener wrote: On Tue, Jun 11, 2019 at 12:40 PM Aldy Hernandez wrote: This patch cleans up the various contains, may_contain, and value_inside_range variants we have throughout, in favor of one-- contains_p.  There should

Re: Add value_range_base::contains_p

2019-06-11 Thread Martin Sebor
On 6/11/19 10:26 AM, Aldy Hernandez wrote: On 6/11/19 12:17 PM, Martin Sebor wrote: On 6/11/19 9:05 AM, Aldy Hernandez wrote: On 6/11/19 9:45 AM, Richard Biener wrote: On Tue, Jun 11, 2019 at 12:40 PM Aldy Hernandez wrote: This patch cleans up the various contains, may_contain, and

[PATCH] integrate sprintf pass into strlen (PR 83431)

2019-06-11 Thread Martin Sebor
The sprintf and strlen passes both work with strings but run independently of one another and don't share state. As a result, lengths of strings dynamically created by functions that are available to the strlen pass are not available to sprintf. Conversely, lengths of strings formatted by the sp

Re: Add value_range_base::contains_p

2019-06-11 Thread Martin Sebor
On 6/11/19 3:02 PM, Aldy Hernandez wrote: On 6/11/19 12:52 PM, Martin Sebor wrote: On 6/11/19 10:26 AM, Aldy Hernandez wrote: On 6/11/19 12:17 PM, Martin Sebor wrote: On 6/11/19 9:05 AM, Aldy Hernandez wrote: On 6/11/19 9:45 AM, Richard Biener wrote: On Tue, Jun 11, 2019 at 12:40 PM

PING: [PATCH] implement -Wformat-diag, v2

2019-06-11 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01513.html On 5/22/19 10:42 AM, Martin Sebor wrote: Attached is a revised implementation of the -Wformat-diag checker incorporating the feedback I got on the first revision. Martin

Re: [PATCH] Do not warn with warn_unused_result for alloca(0).

2019-06-12 Thread Martin Sebor
On 6/12/19 5:37 AM, Jakub Jelinek wrote: On Wed, Jun 12, 2019 at 01:30:14PM +0200, Martin Liška wrote: @@ -9447,10 +9448,19 @@ do_warn_unused_result (gimple_seq seq) location_t loc = gimple_location (g); if (fdecl) - warning_at (loc, OPT_Wunused_result, -

Re: [PATCH] Do not warn with warn_unused_result for alloca(0).

2019-06-12 Thread Martin Sebor
On 6/12/19 9:25 AM, Michael Matz wrote: Hi, On Wed, 12 Jun 2019, Martin Sebor wrote: Otherwise LGTM as the patch, but I'd like to hear from others whether it is kosher to add such a special case to the warn_unused_result attribute warning. And if the agreement is yes, I think it shou

Re: [PATCH] Do not warn with warn_unused_result for alloca(0).

2019-06-12 Thread Martin Sebor
On 6/12/19 10:40 AM, Jakub Jelinek wrote: On Wed, Jun 12, 2019 at 10:13:57AM -0600, Martin Sebor wrote: But GCC doesn't support such an implementation, does it? Why would that be relevant? Obviously because it makes no sense to cater to all conceivable extensions provided by all sor

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-12 Thread Martin Sebor
On 6/12/19 3:33 PM, Rainer Orth wrote: Richard Biener writes: On Mon, Jun 10, 2019 at 10:37 PM Martin Sebor wrote: On 6/10/19 1:29 PM, Jakub Jelinek wrote: On Mon, Jun 10, 2019 at 01:23:28PM -0600, Martin Sebor wrote: + else if (integer_zerop (TREE_OPERAND (node, 1)) + /* Dump the

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-13 Thread Martin Sebor
On 6/13/19 4:44 AM, Jakub Jelinek wrote: On Thu, Jun 13, 2019 at 10:53:55AM +0200, Rainer Orth wrote: Even with that fixed, I see many failures: +FAIL: g++.dg/tree-ssa/pr31146.C -std=gnu++14 scan-tree-dump forwprop1 "MEM[.*&i][j.*] =.* 1;" +FAIL: g++.dg/tree-ssa/pr31146.C -s

Re: [PATCH] include MEM_REF type in tree dumps (PR 90676)

2019-06-13 Thread Martin Sebor
On 6/13/19 9:34 AM, Jakub Jelinek wrote: On Thu, Jun 13, 2019 at 09:30:37AM -0600, Martin Sebor wrote: The size of the access above doesn't look right. The test is: It is correct. You have MEM [(int *)&i], which is the same thing as i itself, and on this you apply an ARRAY_REF,

[PATCH] avoid ice due to inconsistent argument types to fold_build (PR 90662)

2019-06-13 Thread Martin Sebor
Attached is a fix for the fold_build call with inconsistent argument types introduced in a recent commit of mine. Tested on x86_64-linux. Martin PR tree-optimization/90662 - strlen of a string in a vla plus offset not folded gcc/ChangeLog: PR tree-optimization/90662 * tree-ssa-strlen.c (get_

Re: [PATCH] Do not warn with warn_unused_result for alloca(0).

2019-06-13 Thread Martin Sebor
On 6/13/19 10:46 AM, Tom Tromey wrote: "Jeff" == Jeff Law writes: Jeff> I'd like to move C-alloca support to the ash heap of history. But I'm Jeff> not sure we can realistically do that. Are there still platforms or compilers in use where it's needed? For gdb I was planning to just remove t

[PATCH] improve strcmp folding of unequal strings (PR 90626)

2019-06-13 Thread Martin Sebor
While integrating the strlen and sprintf passes and investigating optimization opportunities that it opens up I noticed a few related to a strcmp optimization implemented in GCC 9. One is to take advantage of the fact that a nul-terminated string of a known length cannot be equal to a string whos

Re: C++ PATCH for c++/60364 - noreturn after first decl not diagnosed (v2)

2019-06-17 Thread Martin Sebor
On 6/16/19 10:10 AM, Marek Polacek wrote: On Sat, Jun 15, 2019 at 10:39:13AM -0400, Marek Polacek wrote: On Sat, Jun 15, 2019 at 04:33:26PM +0200, Jakub Jelinek wrote: On Sat, Jun 15, 2019 at 10:29:17AM -0400, Marek Polacek wrote: [dcl.attr.noreturn] says "The first declaration of a function s

Re: C++ PATCH for c++/83820 - excessive attribute arguments not detected

2019-06-17 Thread Martin Sebor
On 6/16/19 1:10 PM, Marek Polacek wrote: While messing with [[noreturn]] I also found out that we don't detect the case when an attribute specifier that takes no arguments contains an attribute-argument-clause. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2019-06-16 Marek Polacek

Re: [PATCH] avoid ice due to inconsistent argument types to fold_build (PR 90662)

2019-06-18 Thread Martin Sebor
On 6/18/19 2:38 AM, Christophe Lyon wrote: On Fri, 14 Jun 2019 at 03:35, Jeff Law wrote: On 6/13/19 1:10 PM, Martin Sebor wrote: Attached is a fix for the fold_build call with inconsistent argument types introduced in a recent commit of mine. Tested on x86_64-linux. Martin gcc-90662.diff

PING 2: [PATCH] implement -Wformat-diag, v2

2019-06-18 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01513.html On 6/11/19 7:31 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01513.html On 5/22/19 10:42 AM, Martin Sebor wrote: Attached is a revised implementation of the -Wformat-diag checker incorporating the

Re: [PATCH] implement -Wformat-diag, v2

2019-06-18 Thread Martin Sebor
On 6/18/19 12:59 PM, Jeff Law wrote: On 5/22/19 10:42 AM, Martin Sebor wrote: Attached is a revised implementation of the -Wformat-diag checker incorporating the feedback I got on the first revision. Martin gcc-wformat-diag-checker.diff gcc/c-family/ChangeLog: * c-format.c

[PATCH] let hash-based containers work with non-trivial types (PR 90923)

2019-06-18 Thread Martin Sebor
Let me try that again to the right list. On 6/18/19 9:14 PM, Martin Sebor wrote: Bug 90923 shows that even though GCC hash-table based containers like hash_map can be instantiated on types with user-defined ctors and dtors they invoke the dtors of such types without invoking the corresponding

Re: [PATCH] warn on returning alloca and VLA (PR 71924, 90549)

2019-06-18 Thread Martin Sebor
On 6/14/19 2:59 PM, Jeff Law wrote: On 6/4/19 1:40 PM, Martin Sebor wrote: On 6/3/19 5:24 PM, Martin Sebor wrote: On 5/31/19 2:46 PM, Jeff Law wrote: On 5/22/19 3:34 PM, Martin Sebor wrote: -Wreturn-local-addr detects a subset of instances of returning the address of a local object from a

Re: [RFC, PATCH] Display inlining context for uninitialized warnings

2019-06-19 Thread Martin Sebor
On 6/19/19 5:11 AM, Vladislav Ivanishin wrote: Hi, This patch (partially) adds displaying inlining context for -W{maybe,}uninitialized warnings. This is not as trivial to enable as simply supplying the "%G" format specifier, so I have some questions below. I need this hunk void percent_K_

Re: [PATCH] implement -Wformat-diag, v2

2019-06-19 Thread Martin Sebor
On 6/19/19 10:46 AM, Jeff Law wrote: On 6/18/19 1:21 PM, Martin Sebor wrote: On 6/18/19 12:59 PM, Jeff Law wrote: On 5/22/19 10:42 AM, Martin Sebor wrote: Attached is a revised implementation of the -Wformat-diag checker incorporating the feedback I got on the first revision. Martin gcc

Re: [PATCH] improve strcmp folding of unequal strings (PR 90626)

2019-06-19 Thread Martin Sebor
On 6/14/19 2:03 PM, Jeff Law wrote: On 6/13/19 5:50 PM, Martin Sebor wrote: While integrating the strlen and sprintf passes and investigating optimization opportunities that it opens up I noticed a few related to a strcmp optimization implemented in GCC 9.  One is to take advantage of the fact

Re: [RFA] [PR tree-optimization/90949] Don't propagate context sensitive non-nullness when copy-propagating pointers

2019-06-20 Thread Martin Sebor
On 6/20/19 4:23 PM, Jeff Law wrote: As outlined in the BZ, our alias analysis code is context insensitive. So when we copy-propagate pointers, we can can and do copy PTA information from members to the representative pointer in the copy-of chain (we do this when the representative pointer has no

Re: [PATCH] implement -Wformat-diag, v2

2019-06-21 Thread Martin Sebor
On 6/21/19 4:16 PM, Ian Lance Taylor wrote: On Wed, Jun 19, 2019 at 12:49 PM Martin Sebor wrote: gcc-wformat-diag-checker.diff gcc/c-family/ChangeLog: * c-format.c (function_format_info::format_type): Adjust type. (function_format_info::is_raw): New member

[PATCH] don't trim empty string initializers for pointers (PR 90947)

2019-06-21 Thread Martin Sebor
The solution we implemented in GCC 9 to get the mangling of non-type template arguments of class types containing array members consistent regardless of the form of their initialization introduced a couple of bugs. One of these is the subject of this patch. The bug results in stripping trailing

Re: [PATCH] don't trim empty string initializers for pointers (PR 90947)

2019-06-23 Thread Martin Sebor
On 6/22/19 9:37 PM, Jason Merrill wrote: On 6/21/19 8:05 PM, Martin Sebor wrote: The solution we implemented in GCC 9 to get the mangling of non-type template arguments of class types containing array members consistent regardless of the form of their initialization introduced a couple of bugs

[PATCH] some more -Wformat-diag cleanup

2019-06-23 Thread Martin Sebor
The attached patch cleans up a number of outstanding -Wformat-diag instances. I plan to commit it tomorrow. With it applied, an x86_64-linux bootstrap shows just 79 unique instances of the warning originating in 17 files. 49 of those are in the Go front-end that Ian is already dealing with. I

Re: [doc,committed] clarify docs for function attribute "const"

2018-12-03 Thread Martin Sebor
On 11/26/18 8:45 PM, Sandra Loosemore wrote: On 11/26/18 8:32 PM, Martin Sebor wrote: On 11/26/18 11:13 AM, Sandra Loosemore wrote: On 11/26/18 10:17 AM, Martin Sebor wrote: On 11/25/18 6:40 PM, Sandra Loosemore wrote: I've checked in the attached patch for PR79738. I think we have

[doc PATCH] update attribute docs for C++

2018-12-03 Thread Martin Sebor
In a recent discussion a user asked us to clarify the effects of attributes const and pure on member functoons of trivial structs vs. non-trivial classes, and functions with pointer vs. reference arguments. I think this is worth explaining in some general statement rather than for individual attr

[doc PATCH] document when GCC ignores attribute aligned

2018-12-03 Thread Martin Sebor
Last week we agreed to clarify that attribute aligned on a function can decrease its alignment if it hasn't been previously declared with one. Attached is this change. Besides the above, I also mention that the attribute specifies the alignment of the first instruction of the function (in case t

Re: [doc PATCH] update attribute docs for C++

2018-12-04 Thread Martin Sebor
On 12/4/18 12:09 AM, Sandra Loosemore wrote: On 12/3/18 4:23 PM, Martin Sebor wrote: gcc/ChangeLog: * doc/extend.texi (attribute const, pure): Clarify. Index: gcc/doc/extend.texi === --- gcc/doc/extend.texi    (revision

Re: [doc PATCH] document when GCC ignores attribute aligned

2018-12-04 Thread Martin Sebor
On 12/4/18 12:20 AM, Sandra Loosemore wrote: On 12/3/18 8:23 PM, Martin Sebor wrote: Last week we agreed to clarify that attribute aligned on a function can decrease its alignment if it hasn't been previously declared with one.  Attached is this change. Besides the above, I also mention

Re: [doc PATCH] update attribute docs for C++

2018-12-04 Thread Martin Sebor
On 12/4/18 2:04 PM, Sandra Loosemore wrote: On 12/4/18 9:26 AM, Martin Sebor wrote: Thanks for the comments.  Attached is an updated patch with the typos fixed.  I've left the rest as is. Well, I still think a number of points I commented on before need to be clarified in the text.  I

Re: [PATCH] be more permissive about function alignments (PR 88208)

2018-12-05 Thread Martin Sebor
On 12/5/18 6:09 AM, Rainer Orth wrote: Hi Martin, The tests for the new __builtin_has_attribute function have been failing on a number of targets because of a couple of assumptions that only hold on some. First, they expect that it's safe to apply attribute aligned with a smaller alignment tha

Re: [doc PATCH] update attribute docs for C++

2018-12-05 Thread Martin Sebor
On 12/4/18 8:49 PM, Sandra Loosemore wrote: On 12/4/18 8:13 PM, Martin Sebor wrote: On 12/4/18 2:04 PM, Sandra Loosemore wrote: On 12/4/18 9:26 AM, Martin Sebor wrote: [snip] +The keyword @code{__attribute__} allows you to specify various special +properties of types.  Some type attributes

Re: [PATCH/coding style] clarify pointers and operators

2018-12-05 Thread Martin Sebor
On 12/5/18 3:04 AM, Richard Sandiford wrote: Thanks for doing this, Martin Sebor writes: Martin suggested we update the Coding Conventions to describe the expected style for function declarations with a pointer return types, and for overloaded operators. Below is the patch. As an aside

Re: [committed] Handle targets with 2 byte wchar_t better in strlenopt-58.c

2018-12-05 Thread Martin Sebor
On 12/5/18 12:13 PM, Jeff Law wrote: On 12/5/18 11:59 AM, David Edelsohn wrote: Jeff, Thanks for the patch. I continue to see a failure on AIX 32 bit mode (2 byte wchar). FAIL: gcc.dg/strlenopt-58.c scan-tree-dump-times optimized "call_in_true_branch_not_eliminated" 0 I'm not certain if this

[PATCH] handle expressions in __builtin_has_attribute (PR 88383)

2018-12-05 Thread Martin Sebor
The __builtin_has_attribute function fails with an ICE when its first argument is an expression such as INDIRECT_REF, or many others. The code simply assumes it's either a type or a decl. The attached patch corrects this oversight. While testing the fix I also noticed the C++ front end expects

[PATCH] handle function pointers in __builtin_object_size (PR 88372)

2018-12-06 Thread Martin Sebor
Bug 88372 - alloc_size attribute is ignored on function pointers points out that even though the alloc_size attribute is accepted on function pointers it doesn't have any effect on Object Size Checking. The reporter, who is implementing the feature in Clang, wants to know if by exposing it under

<    7   8   9   10   11   12   13   14   15   16   >