Re: [PATCH 02/10] [i386] Enable _Float16 type for TARGET_SSE2 and above.

2021-07-28 Thread Hongtao Liu via Gcc-patches
On Thu, Jul 29, 2021 at 12:53 PM Hongtao Liu wrote: > > On Thu, Jul 29, 2021 at 5:57 AM Joseph Myers wrote: > > > > On Wed, 21 Jul 2021, liuhongt via Gcc-patches wrote: > > > > > @@ -23254,13 +23337,15 @@ ix86_get_excess_precision (enum > > > excess_precision_type type) > > > provide

Re: [PATCH 02/10] [i386] Enable _Float16 type for TARGET_SSE2 and above.

2021-07-28 Thread Hongtao Liu via Gcc-patches
On Thu, Jul 29, 2021 at 5:57 AM Joseph Myers wrote: > > On Wed, 21 Jul 2021, liuhongt via Gcc-patches wrote: > > > @@ -23254,13 +23337,15 @@ ix86_get_excess_precision (enum > > excess_precision_type type) > > provide would be identical were it not for the unpredictable > >

[PATCH] Objective-C: don't require redundant -fno-objc-sjlj-exceptions for the NeXT v2 ABI

2021-07-28 Thread Matt Jacobson via Gcc-patches
As is, an invocation of GCC with -fnext-runtime -fobjc-abi-version=2 crashes, unless target-specific code adds an implicit -fno-objc-sjlj-exceptions (which Darwin does). This patch makes the general case not crash. I don't have commit access, so if this patch is suitable, I'd need someone else

Re: [PATCH] c++tools, configury: Configure with C++; test checking status [PR98821].

2021-07-28 Thread Jason Merrill via Gcc-patches
On 7/20/21 11:21 AM, Iain Sandoe wrote: Hi Folks, Following Jakub’s suggestions (on irc) here is a patch that works around misconfiguration of the c++tools directory present for at least Linux and Darwin (probably on any platform that does not have typedefs for the inet structs in its system

[PATCH] Adjust/Refine testcases.

2021-07-28 Thread liuhongt via Gcc-patches
Committed as obvious fix, and opened pr101668 to record the issue related to pr92658-{avx512bw-2,sse4-2,sse4}.c. gcc/testsuite/ChangeLog: PR target/99881 * gcc.target/i386/pr91446.c: Adjust testcase. * gcc.target/i386/pr92658-avx512bw-2.c: Ditto. *

Re: [PATCH] [i386] Add a separate function to calculate cost for WIDEN_MULT_EXPR.

2021-07-28 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 28, 2021 at 8:36 PM Richard Biener wrote: > > On Wed, Jul 28, 2021 at 10:35 AM liuhongt wrote: > > > > Hi: > > As described in PR 39821, WIDEN_MULT_EXPR should use a different cost > > model from MULT_EXPR, this patch add ix86_widen_mult_cost for that. > > Reference basis for the

Re: Repost: [PATCH] PR 100168: Fix call test on power10.

2021-07-28 Thread Segher Boessenkool
On Wed, Jul 07, 2021 at 04:08:39PM -0400, Michael Meissner wrote: > [PATCH] PR 100168: Fix call test on power10. > > Fix a test that was checking for 64-bit TOC calls, to also allow for > PC-relative calls. > --- a/gcc/testsuite/gcc.dg/pr56727-2.c > +++ b/gcc/testsuite/gcc.dg/pr56727-2.c > @@

Re: [Patch] gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] (was: [PATCH 3/3] [PR libfortran/101305] Fix ISO_Fortran_binding.h paths in gfortran testsuite)

2021-07-28 Thread Jakub Jelinek via Gcc-patches
On Wed, Jul 28, 2021 at 01:22:53PM +0200, Tobias Burnus wrote: > gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] > > gcc/testsuite/ > PR libfortran/101305 > * gfortran.dg/dg.exp: Add '-I /libgfortran' > compile flag. Wouldn't it be better to do that in

Re: [PATCH] correct uninitialized object offset and size computation [PR101494]

2021-07-28 Thread Martin Sebor via Gcc-patches
On 7/23/21 10:39 AM, Jeff Law wrote: On 7/22/2021 3:58 PM, Martin Sebor via Gcc-patches wrote: The code that computes the size of an access to an object in -Wuninitialized is limited to declared objects and so doesn't apply to allocated objects, and doesn't correctly account for an offset

Re: [PATCH v2 6/6] rs6000: Add tests for SSE4.1 "floor" intrinsics

2021-07-28 Thread Segher Boessenkool
On Fri, Jul 16, 2021 at 08:50:22AM -0500, Paul A. Clarke wrote: > gcc/testsuite > * gcc.target/powerpc/sse4_1-floorpd.c: New. > * gcc.target/powerpc/sse4_1-floorps.c: New. > * gcc.target/powerpc/sse4_1-floorsd.c: New. > * gcc.target/powerpc/sse4_1-floorss.c: New. > *

Re: [PATCH v2 5/6] rs6000: Add support for SSE4.1 "floor" intrinsics

2021-07-28 Thread Segher Boessenkool
On Fri, Jul 16, 2021 at 08:50:21AM -0500, Paul A. Clarke wrote: > * config/rs6000/smmintrin.h (_mm_floor_pd, _mm_floor_ps, > _mm_floor_sd, _mm_floor_ss): New. Okay for trunk. Thanks! Segher

Re: [PATCH v2 4/6] rs6000: Add tests for SSE4.1 "ceil" intrinsics

2021-07-28 Thread Segher Boessenkool
Hi! On Fri, Jul 16, 2021 at 08:50:20AM -0500, Paul A. Clarke wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-round.h > @@ -0,0 +1,27 @@ > +#include > +#include > +#include "sse4_1-check.h" > + > +#define DIM(a) (sizeof (a) / sizeof ((a)[0])) Pet peeve: sizeof is an

Re: [PATCH] add access warning pass

2021-07-28 Thread Martin Sebor via Gcc-patches
On 7/28/21 3:23 AM, Richard Biener wrote: On Fri, Jul 16, 2021 at 12:42 AM Martin Sebor via Gcc-patches wrote: A number of access warnings as well as their supporting infrastructure (compute_objsize et al.) are implemented in builtins.{c,h} where they (mostly) operate on trees and run just

Re: [PATCH v2 3/6] rs6000: Add support for SSE4.1 "ceil" intrinsics

2021-07-28 Thread Segher Boessenkool
Hi! On Fri, Jul 16, 2021 at 08:50:19AM -0500, Paul A. Clarke wrote: > * config/rs6000/smmintrin.h (_mm_ceil_pd, _mm_ceil_ps, > _mm_ceil_sd, _mm_ceil_ss): New. This is fine. Thanks! Segher

Re: [PATCH] c/101512 - fix missing address-taking in c_common_mark_addressable_vec

2021-07-28 Thread Joseph Myers
On Wed, 21 Jul 2021, Jakub Jelinek via Gcc-patches wrote: > I wonder if instead when trying to wrap > C_MAYBE_CONST_EXPR into a VIEW_CONVERT_EXPR we shouldn't be > removing that C_MAYBE_CONST_EXPR and perhaps adding it around the > VIEW_CONVERT_EXPR. E.g. various routines in c/c-typeck.c like >

Re: [PATCH 02/10] [i386] Enable _Float16 type for TARGET_SSE2 and above.

2021-07-28 Thread Joseph Myers
On Wed, 21 Jul 2021, liuhongt via Gcc-patches wrote: > @@ -23254,13 +23337,15 @@ ix86_get_excess_precision (enum > excess_precision_type type) > provide would be identical were it not for the unpredictable > cases. */ > if (!TARGET_80387) > - return

Re: [patch][version 6] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-28 Thread Qing Zhao via Gcc-patches
Hi, Kees, Thanks a lot for your testing and the small testing case. I just studied the root cause of this bug, and found that it’s because the call to “__builtin_clear_padding()” should NOT be inserted BEFORE the variable initialization. It should be inserted AFTER the variable initialization.

Re: [PATCH v2 2/6] rs6000: Add tests for SSE4.1 "blend" intrinsics

2021-07-28 Thread Segher Boessenkool
Hi! On Fri, Jul 16, 2021 at 08:50:18AM -0500, Paul A. Clarke wrote: > Copy the tests for _mm_blend_pd, _mm_blendv_pd, _mm_blend_ps, > _mm_blendv_ps from gcc/testsuite/gcc.target/i386. You get less messy series in cases like this if you just put the tests in the same patch as the code it tests

Re: [PATCH v2 1/6] rs6000: Add support for SSE4.1 "blend" intrinsics

2021-07-28 Thread Segher Boessenkool
Hi! On Fri, Jul 16, 2021 at 08:50:17AM -0500, Paul A. Clarke wrote: > _mm_blend_epi16 and _mm_blendv_epi8 were added earlier. > Add these four to complete the set. > > 2021-07-16 Paul A. Clarke > > gcc > * config/rs6000/smmintrin.h (_mm_blend_pd, _mm_blendv_pd, > _mm_blend_ps,

Re: [PATCH 42/55] rs6000: Handle gimple folding of target built-ins

2021-07-28 Thread will schmidt via Gcc-patches
On Thu, 2021-06-17 at 10:19 -0500, Bill Schmidt via Gcc-patches wrote: Hi, > This is another patch that looks bigger than it really is. Because we > have a new namespace for the builtins, allowing us to have both the old > and new builtin infrastructure supported at once, we need versions of

Re: [PATCH][gcc] Allow functions without C-style ellipsis to use format attribute

2021-07-28 Thread Joseph Myers
On Mon, 19 Jul 2021, Martin Sebor via Gcc-patches wrote: > You've answered my questions about the design (thank you) and I don't > have any objections to the idea, but I'm not in a position to approve > the patch. I would suggest to get Jason's input on extending > attribute format to variadic

Re: [PATCH 53/55] rs6000: Update altivec.h for automated interfaces

2021-07-28 Thread Bill Schmidt via Gcc-patches
Hi Will, On 7/27/21 4:07 PM, will schmidt wrote: On Thu, 2021-06-17 at 10:19 -0500, Bill Schmidt via Gcc-patches wrote: 2021-06-10 Bill Schmidt gcc/ * config/rs6000/altivec.h: Delete a number of #defines that are now superfluous; include rs6000-vecdefines.h; include some

Re: [PATCH] c++: Improve memory usage of subsumption [PR100828]

2021-07-28 Thread Jason Merrill via Gcc-patches
On 7/19/21 6:05 PM, Patrick Palka wrote: Constraint subsumption is implemented in two steps. The first step computes the disjunctive (or conjunctive) normal form of one of the constraints, and the second step verifies that each clause in the decomposed form implies the other constraint.

[r12-2549 Regression] FAIL: gcc.target/i386/pr92658-sse4.c scan-assembler-times pmovzxwq 2 on Linux/x86_64

2021-07-28 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 872da9a6f664a06d73c987aa0cb2e5b830158a10 is the first bad commit commit 872da9a6f664a06d73c987aa0cb2e5b830158a10 Author: liuhongt Date: Fri Mar 26 10:56:47 2021 +0800 Add the member integer_to_sse to processor_cost as a cost simulation for movd/pinsrd. It will be used to

[r12-2558 Regression] FAIL: gfortran.dg/guality/pr41558.f90 -Os line 7 s == 'foo' on Linux/x86_64

2021-07-28 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 0f95c6b2f7dae35ec8c9f211d63edc42baa1d2b7 is the first bad commit commit 0f95c6b2f7dae35ec8c9f211d63edc42baa1d2b7 Author: Bin Cheng Date: Wed Jul 28 17:44:35 2021 +0800 Don't skip prologue/epilogue when initializing alias. caused FAIL: gcc.dg/guality/drap.c -Os

Re: [PATCH 49/55] rs6000: Builtin expansion, part 6

2021-07-28 Thread Bill Schmidt via Gcc-patches
On 7/27/21 4:07 PM, will schmidt wrote: On Thu, 2021-06-17 at 10:19 -0500, Bill Schmidt via Gcc-patches wrote: 2021-03-24 Bill Schmidt gcc/ * config/rs6000/rs6000-call.c (new_htm_spr_num): New function. (new_htm_expand_builtin): Implement.

Re: [PATCH] c++: Accept C++11 attribute-definition [PR101582]

2021-07-28 Thread Jason Merrill via Gcc-patches
On 7/23/21 4:03 AM, Jakub Jelinek wrote: Hi! As the following testcase shows, we don't parse properly C++11 attribute-declaration: https://eel.is/c++draft/dcl.dcl#nt:attribute-declaration cp_parser_toplevel_declaration just handles empty-declaration parsing (with diagnostics for C++98) This

Re: [patch][version 6] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-28 Thread Kees Cook via Gcc-patches
On Tue, Jul 27, 2021 at 03:26:00AM +, Qing Zhao wrote: > This is the 6th version of the patch for the new security feature for GCC. > > I have tested it with bootstrap on both x86 and aarch64, regression testing > on both x86 and aarch64. > Also compile CPU2017 (running is ongoing), without

New Swedish PO file for 'gcc' (version 11.2.0)

2021-07-28 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Swedish team of translators. The file is available at: https://translationproject.org/latest/gcc/sv.po (This file, 'gcc-11.2.0.sv.po', has

[committed] analyzer: play better with -fsanitize=bounds

2021-07-28 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as 37eb3ef48c9840475646528751b5f8ffb7eb34ce. gcc/analyzer/ChangeLog: * region-model.cc (region_model::on_call_pre): Treat IFN_UBSAN_BOUNDS, BUILT_IN_STACK_SAVE, and BUILT_IN_STACK_RESTORE as

[committed] analyzer: remove redundant return value from various impl_call_*

2021-07-28 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as b5081130166a4f2e363f116e0e6b43d83422c947. gcc/analyzer/ChangeLog: * region-model-impl-calls.cc (region_model::impl_call_alloca): Drop redundant return value.

Re: [PATCH 0/13] v2 warning control by group and location (PR 74765)

2021-07-28 Thread Martin Sebor via Gcc-patches
On 7/28/21 5:14 AM, Andrew Burgess wrote: * Martin Sebor via Gcc-patches [2021-07-19 09:08:35 -0600]: On 7/17/21 2:36 PM, Jan-Benedict Glaw wrote: Hi Martin! On Fri, 2021-06-04 15:27:04 -0600, Martin Sebor wrote: This is a revised patch series to add warning control by group and

Re: [PATCH] IBM Z: Fix 5 tests in 31-bit mode

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/23/21 2:47 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/global-array-element-pic2.c: Add -mzarch, add > an expectation for 31-bit mode. > *

[PATCH] tree-optimization/101615 - SLP permute opt with CTOR roots

2021-07-28 Thread Richard Biener
CTOR roots are not explicitely represented so we have to make sure to materialize permutes on SLP graph entries to them. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-07-28 Richard Biener PR tree-optimization/101615 * tree-vect-slp.c (vect_optimize_slp):

[PATCH] aarch64: Add smov alternative to sign_extend pattern

2021-07-28 Thread Kyrylo Tkachov via Gcc-patches
Hi all, In the testcase here we were generating a umov + sxth to move a half-word value from SIMD to GP regs with sign-extension. We can use a single smov instruction for it instead but the sign-extend pattern was missing the right alternative. The *zero_extend2_aarch64 pattern for zero-extension

Re: [PATCH 2/2] Backwards jump threader rewrite with ranger.

2021-07-28 Thread Martin Sebor via Gcc-patches
On 7/28/21 8:51 AM, Aldy Hernandez via Gcc-patches wrote: On 7/28/21 4:32 PM, Jeff Law wrote: ... diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 863f1256811..0e205a41ac3 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -223,6 +223,11 @@ gimple-match.o-warn = -Wno-unused  

Re: Question about divide by 0 and what we can do with it

2021-07-28 Thread Aldy Hernandez via Gcc-patches
On 7/28/21 4:39 PM, Andrew MacLeod wrote: So Im seeing what appears to me to be inconsistent behaviour. in pr96094.c we see: int foo (int x) {   if (x >= 2U)     return 34;   return 34 / x; } x has a range of [0,1] and since / 0  in undefined, the expectation is that we fold this to

Re: [PATCH 1/2] Fix debug info for ignored decls at start of assembly

2021-07-28 Thread Bernd Edlinger
On 7/28/21 2:51 PM, Richard Biener wrote: > On Mon, 26 Jul 2021, Bernd Edlinger wrote: > >> Ignored functions decls that are compiled at the start of >> the assembly have bogus line numbers until the first .file >> directive, as reported in PR101575. >> >> The work around for this issue is to

[PATCH][gcc/doc] Improve nonnull attribute documentation

2021-07-28 Thread Tom de Vries
Hi, Improve nonnull attribute documentation in a number of ways: Reorganize discussion of effects into: - effects for calls to functions with nonnull-marked parameters, and - effects for function definitions with nonnull-marked parameters. This makes it clear that -fno-delete-null-pointer-checks

Re: [PATCH 2/2] Backwards jump threader rewrite with ranger.

2021-07-28 Thread Aldy Hernandez via Gcc-patches
On 7/28/21 4:32 PM, Jeff Law wrote: On 7/15/2021 8:57 AM, Aldy Hernandez wrote: As mentioned in my previous email, these are some minor changes to the previous revision. All I'm changing here is the call into the solver to use range_of_expr and range_of_stmt. Everything else remains the

Question about divide by 0 and what we can do with it

2021-07-28 Thread Andrew MacLeod via Gcc-patches
So Im seeing what appears to me to be inconsistent behaviour. in pr96094.c we see: int foo (int x) {   if (x >= 2U)     return 34;   return 34 / x; } x has a range of [0,1] and since / 0  in undefined, the expectation is that we fold this to "return 34" and vrp1 does this:   [local count:

Re: [PATCH 2/2] Backwards jump threader rewrite with ranger.

2021-07-28 Thread Jeff Law via Gcc-patches
On 7/15/2021 8:57 AM, Aldy Hernandez wrote: As mentioned in my previous email, these are some minor changes to the previous revision. All I'm changing here is the call into the solver to use range_of_expr and range_of_stmt. Everything else remains the same. Tested on x86-64 Linux. On Mon,

Re: [PATCH] correct formatting of function pointers in -Warray-bounds (PR 101601)

2021-07-28 Thread Jeff Law via Gcc-patches
On 7/27/2021 2:45 PM, Martin Sebor via Gcc-patches wrote: When mentioning the type of the accessed object -Warray-bounds treats singleton objects as arrays of one element for simplicity. But because the code doesn't distinguish between function and object pointers, a warning for an

Re: [PATCH] incorrect arguments designated in -Wnonnull for arrays

2021-07-28 Thread Jeff Law via Gcc-patches
On 7/28/2021 12:56 AM, Uecker, Martin wrote: Am Dienstag, den 27.07.2021, 10:55 -0600 schrieb Martin Sebor: On 7/26/21 12:22 PM, Jeff Law via Gcc-patches wrote: On 7/25/2021 10:23 AM, Uecker, Martin wrote: Two arguments are switched for -Wnonnull when warning about array parameters with

[PATCH] aarch64: Don't include vec_select high-half in SIMD multiply cost

2021-07-28 Thread Jonathan Wright via Gcc-patches
Hi, The Neon multiply/multiply-accumulate/multiply-subtract instructions can select the top or bottom half of the operand registers. This selection does not change the cost of the underlying instruction and this should be reflected by the RTL cost function. This patch adds RTL tree traversal in

Re: [PATCH V2] aarch64: Don't include vec_select in SIMD multiply cost

2021-07-28 Thread Jonathan Wright via Gcc-patches
Hi, V2 of the patch addresses the initial review comments, factors out common code (as we discussed off-list) and adds a set of unit tests to verify the code generation benefit. Regression tested and bootstrapped on aarch64-none-linux-gnu - no issues. Ok for master? Thanks, Jonathan ---

[PATCH] tree-optimization/101615 - SLP permute opt of existing vectors

2021-07-28 Thread Richard Biener
This fixes one issue discovered when analyzing PR101615, namely we happily push permutes to pre-existing vectors but end up not actually permuting them. In fact we don't want to, so force materialization on the external. It doesn't fix the original testcase though. Bootstrapped and tested on

[committed] amdgcn: Fix attributes for LLVM-12 [PR 100208]

2021-07-28 Thread Andrew Stubbs
This patch follows up my previous patch and supports more variants of LLVM 12. There are still other incompatibilities with LLVM 12, but this at least the ELF attributes should now automatically tune to any LLVM 9, 10, or 12 assembler (It would be nice if one set of options would just work

Re: [PATCH 1/2] Fix debug info for ignored decls at start of assembly

2021-07-28 Thread Richard Biener
On Mon, 26 Jul 2021, Bernd Edlinger wrote: > Ignored functions decls that are compiled at the start of > the assembly have bogus line numbers until the first .file > directive, as reported in PR101575. > > The work around for this issue is to emit a dummy .file > directive when the first

[COMMITTED] Return undefined range on edges which are not executed.

2021-07-28 Thread Andrew MacLeod via Gcc-patches
outgoing_edge_range_p() is the GORI work engine which starts with the TRUE/FALSE/switch range from an edge at the bottom of the block, and calculates the outgoing range of any other ssa-name which can be changed by that. When we rewrite a branch to always be true or false, we get slightly

[PATCH take 2] Fold (X<

2021-07-28 Thread Roger Sayle
Hi Marc, Thanks for the feedback. After some quality time in gdb, I now appreciate that match.pd behaves (subtly) differently between generic and gimple, and the trees actually being passed to tree_nonzero_bits were not quite what I had expected. Sorry for my confusion, the revised patch below

Re: [PATCH] [i386] Add a separate function to calculate cost for WIDEN_MULT_EXPR.

2021-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 10:35 AM liuhongt wrote: > > Hi: > As described in PR 39821, WIDEN_MULT_EXPR should use a different cost > model from MULT_EXPR, this patch add ix86_widen_mult_cost for that. > Reference basis for the cost model is https://godbolt.org/z/EMjaz4Knn. > > Bootstrapped and

Re: retain debug stmt order when moving to successors

2021-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 10:12 AM Alexandre Oliva wrote: > > > We iterate over debug stmts from the last one in new_bb, and we insert > them before the first post-label stmt in each dest block, without > moving the insertion iterator, so they end up reversed. Moving the > insertion iterator fixes

Re: don't access cfun in dump_function_to_file

2021-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 10:12 AM Alexandre Oliva wrote: > > > dump_function_to_file takes the function to dump as a parameter, and > parts of it use the local fun variable where cfun would be used > elsewhere. Others use cfun, presumably in error. Fixed to use fun > uniformly. Added a few more

Re: [PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 10:19 AM Andreas Krebbel wrote: > > On 7/28/21 9:43 AM, Richard Biener wrote: > > On Wed, Jul 28, 2021 at 8:44 AM Andreas Krebbel via Gcc-patches > > wrote: > >> > >> There are also memory operands passed for in0 and in1. > >> > >> Ok for mainline? > > > > They can also

Re: [PATCH] analyzer: Handle strdup builtins

2021-07-28 Thread David Malcolm via Gcc-patches
On Wed, 2021-07-28 at 15:49 +0530, Siddhesh Poyarekar wrote: > Consolidate allocator builtin handling and add support for > __builtin_strdup and __builtin_strndup. > > gcc/analyzer/ChangeLog: > * analyzer.cc (is_named_call_p, is_std_named_call_p): Make > first argument a

Re: [PATCH] analyzer: Recognize __builtin_free as a matching deallocator

2021-07-28 Thread David Malcolm via Gcc-patches
On Wed, 2021-07-28 at 10:34 +0530, Siddhesh Poyarekar wrote: > Recognize __builtin_free as being equivalent to free when passed into > __attribute__((malloc ())), similar to how it is treated when it is > encountered as a call.  This fixes spurious warnings in glibc where > xmalloc family of

[committed] d: Wrong evaluation order of binary expressions (PR101640)

2021-07-28 Thread Iain Buclaw via Gcc-patches
Hi, The use of fold_build2 can in some cases swap the order of its operands if that is the more optimal thing to do. However this breaks semantic guarantee of left-to-right evaluation in D. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32. Committed to mainline, and backported

[committed] d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490)

2021-07-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a modulo by zero bug, seen in both the front-end and code generator when testing if a conversion from a static array to dynamic array was valid. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32. Committed to mainline, and backported to the gcc-9, gcc-10, and

[committed] d: __FUNCTION__ doesn't work in core.stdc.stdio functions without cast (PR101441)

2021-07-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch backports a fix from upstream to allow __FUNCTION__ and __PRETTY_FUNCTION__ to be used as C string literals. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32. Committed to mainline, and backported to the gcc-9, gcc-10, and gcc-11 release branches. Regards, Iain.

[committed] d: Compile-time reflection for supported built-ins (PR101127)

2021-07-28 Thread Iain Buclaw via Gcc-patches
Hi, In order to allow user-code to determine whether a back-end builtin is available without error, LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE has been defined to delay putting back-end builtin functions until the ISA that defines them has been declared. However in D, there is no global namespace.

[committed] d: Change in DotTemplateExp type semantics leading to regression (PR101619)

2021-07-28 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes a regression introduced by PR100999. By giving dot templates a type, meant that properry resolving silently started passing for code that should never have passed. The simple fix is to provide implementations for checkType and checkValue that give an error about dot

[Patch] gfortran.dg/dg.exp: Add libgfortran as -I flag for ISO*.h [PR101305] (was: [PATCH 3/3] [PR libfortran/101305] Fix ISO_Fortran_binding.h paths in gfortran testsuite)

2021-07-28 Thread Tobias Burnus
Hi Sandra, hi all, On 28.07.21 06:36, Sandra Loosemore wrote: On 7/26/21 2:13 PM, Sandra Loosemore wrote: On 7/26/21 3:45 AM, Tobias Burnus wrote: PS: Still, it would be nice if the proper multi-lib ISO*.h could be found; (Example for x86-64-gnu-linux with 32bit and 64bit support) Namely,

Re: [PATCH 0/13] v2 warning control by group and location (PR 74765)

2021-07-28 Thread Andrew Burgess
* Martin Sebor via Gcc-patches [2021-07-19 09:08:35 -0600]: > On 7/17/21 2:36 PM, Jan-Benedict Glaw wrote: > > Hi Martin! > > > > On Fri, 2021-06-04 15:27:04 -0600, Martin Sebor wrote: > > > This is a revised patch series to add warning control by group and > > > location, updated based on

Re: [RFC] more no-wrap conditions for IV analyzing and scev

2021-07-28 Thread Richard Biener
On Fri, 23 Jul 2021, guojiufu wrote: > On 2021-06-21 20:36, Richard Biener wrote: > > On Mon, 21 Jun 2021, guojiufu wrote: > > > >> On 2021-06-21 14:19, guojiufu via Gcc-patches wrote: > >> > On 2021-06-09 19:18, guojiufu wrote: > >> >> On 2021-06-09 17:42, guojiufu via Gcc-patches wrote: > >>

Re: [PATCH] PR fortrsn/101564 - ICE in resolve_allocate_deallocate, at fortran/resolve.c:8169

2021-07-28 Thread Tobias Burnus
Hi Harald, On 27.07.21 23:42, Harald Anlauf wrote: This almost worked, needing only a restriction to %KIND and %LEN. Note that %RE and %IM are usually definable. Well spotted :-) Regtested on x86_64-pc-linux-gnu. OK? LGTM - except [...] feel free add them and commit without further review.

Re: [PATCH] ubsan: Fix ICEs with DECL_REGISTER tests [PR101624]

2021-07-28 Thread Richard Biener
On Wed, 28 Jul 2021, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs, because the base is a CONST_DECL for > the Fortran parameter, and ubsan/sanopt uses DECL_REGISTER macro on it. > /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */ > #define

[PATCH] analyzer: Handle strdup builtins

2021-07-28 Thread Siddhesh Poyarekar
Consolidate allocator builtin handling and add support for __builtin_strdup and __builtin_strndup. gcc/analyzer/ChangeLog: * analyzer.cc (is_named_call_p, is_std_named_call_p): Make first argument a const_tree. * analyzer.h (is_named_call_p, -s_std_named_call_p):

Re: [PATCH] match.pd: Fix up recent __builtin_bswap16 simplifications [PR101642]

2021-07-28 Thread Richard Biener
On Wed, 28 Jul 2021, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs. The problem is that for __builtin_bswap16 > (and only that, others are fine) the argument of the builtin is promoted > to int while the patterns assume it is not and is the same as that of > the return type. > For

Re: [PATCH] c/101512 - fix missing address-taking in c_common_mark_addressable_vec

2021-07-28 Thread Richard Biener
On Wed, 21 Jul 2021, Jakub Jelinek wrote: > On Wed, Jul 21, 2021 at 10:06:51AM +0200, Richard Biener wrote: > > c_common_mark_addressable_vec fails to look through C_MAYBE_CONST_EXPR > > in the case it isn't at the toplevel. > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > >

Re: [EXTERNAL] Re: [PATCH] tree-optimization: Optimize division followed by multiply [PR95176]

2021-07-28 Thread Richard Biener via Gcc-patches
On Tue, Jun 29, 2021 at 1:10 AM Victor Tong wrote: > > Thanks Richard and Marc. > > I wrote the following test case to compare the outputs of fn1() and > fn1NoOpt() below with my extra pattern being applied. I tested the two > functions with all of the integers from INT_MIN to INT_MAX. > > long

Re: [PATCH] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction

2021-07-28 Thread Richard Biener via Gcc-patches
On Sun, Jul 18, 2021 at 9:25 PM Di Zhao OS wrote: > > > I tried to improve the patch following your advices and to catch more > opportunities. Hope it'll be helpful. Sorry for the late reply. > On 6/24/21 8:29 AM, Richard Biener wrote: > > On Thu, Jun 24, 2021 at 11:55 AM Di Zhao via

Re: [PATCH] add access warning pass

2021-07-28 Thread Richard Biener via Gcc-patches
On Fri, Jul 16, 2021 at 12:42 AM Martin Sebor via Gcc-patches wrote: > > A number of access warnings as well as their supporting > infrastructure (compute_objsize et al.) are implemented in > builtins.{c,h} where they (mostly) operate on trees and run > just before RTL expansion. > > This setup

Re: [PATCH] wwwdocs: Clarify meaning of "not issued by" in bugs web page

2021-07-28 Thread Jonathan Wakely via Gcc-patches
On Tue, 27 Jul 2021 at 18:30, Martin Sebor wrote: > > On 7/27/21 9:16 AM, Jonathan Wakely via Gcc-patches wrote: > > Should we make this change? > > > > Firstly, these bullet points are full sentences and so should end with > > a period (or smiley, in some cases). > > I'd expect that to be

[PATCH] ubsan: Fix ICEs with DECL_REGISTER tests [PR101624]

2021-07-28 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because the base is a CONST_DECL for the Fortran parameter, and ubsan/sanopt uses DECL_REGISTER macro on it. /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */ #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)

[PATCH] match.pd: Fix up recent __builtin_bswap16 simplifications [PR101642]

2021-07-28 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs. The problem is that for __builtin_bswap16 (and only that, others are fine) the argument of the builtin is promoted to int while the patterns assume it is not and is the same as that of the return type. For the bswap simplifications before these new ones it just

[PATCH] i386: Improve extensions of __builtin_clz and constant - __builtin_clz for -mno-lzcnt [PR78103]

2021-07-28 Thread Jakub Jelinek via Gcc-patches
Hi! This patch improves emitted code for the non-TARGET_LZCNT case. As __builtin_clz* is UB on 0 argument and for !TARGET_LZCNT CLZ_VALUE_DEFINED_AT_ZERO is 0, it is UB even at RTL time and so we can take advantage of that and assume the result will be 0 to 31 or 0 to 63. Given that, sign or zero

[PATCH] [i386] Add a separate function to calculate cost for WIDEN_MULT_EXPR.

2021-07-28 Thread liuhongt via Gcc-patches
Hi: As described in PR 39821, WIDEN_MULT_EXPR should use a different cost model from MULT_EXPR, this patch add ix86_widen_mult_cost for that. Reference basis for the cost model is https://godbolt.org/z/EMjaz4Knn. Bootstrapped and regtested on x86_64-linux-gnu{-m32,}. gcc/ChangeLog:

Re: [PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/28/21 9:43 AM, Richard Biener wrote: > On Wed, Jul 28, 2021 at 8:44 AM Andreas Krebbel via Gcc-patches > wrote: >> >> There are also memory operands passed for in0 and in1. >> >> Ok for mainline? > > They can also be constant vectors, I'd just not specify the operand > kind - usually >

Re: [PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 28, 2021 at 8:44 AM Andreas Krebbel via Gcc-patches wrote: > > There are also memory operands passed for in0 and in1. > > Ok for mainline? They can also be constant vectors, I'd just not specify the operand kind - usually expanders are not limited as to what they feed down. >

GCC 11.2.1 Status Report (2021-07-28)

2021-07-28 Thread Richard Biener
Status == The GCC 11.2.0 tarballs have been generated and uploaded and the GCC 11 branch is again open for regression and documentation fixes. Quality Data Priority # Change from last report --- --- P1 P2

retain debug stmt order when moving to successors

2021-07-28 Thread Alexandre Oliva
We iterate over debug stmts from the last one in new_bb, and we insert them before the first post-label stmt in each dest block, without moving the insertion iterator, so they end up reversed. Moving the insertion iterator fixes this. Regstrapped on x86_64-linux-gnu. Ok to install? for

don't access cfun in dump_function_to_file

2021-07-28 Thread Alexandre Oliva
dump_function_to_file takes the function to dump as a parameter, and parts of it use the local fun variable where cfun would be used elsewhere. Others use cfun, presumably in error. Fixed to use fun uniformly. Added a few more tests for non-NULL fun before dereferencing it. Regstrapped on

Re: [PATCH] incorrect arguments designated in -Wnonnull for arrays

2021-07-28 Thread Uecker, Martin
Am Dienstag, den 27.07.2021, 10:55 -0600 schrieb Martin Sebor: > On 7/26/21 12:22 PM, Jeff Law via Gcc-patches wrote: > > > > On 7/25/2021 10:23 AM, Uecker, Martin wrote: > > > Two arguments are switched for -Wnonnull when > > > warning about array parameters with bounds > 0 > > > and which are

Re: [PATCH] IBM Z: Enable LSan and TSan

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/27/21 10:04 PM, Ilya Leoshkevich via Gcc-patches wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > libsanitizer/ChangeLog: > > * configure.tgt (s390*-*-linux*): Enable LSan and TSan for > s390x. Ok. Thanks! Andreas

[PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Andreas Krebbel via Gcc-patches
There are also memory operands passed for in0 and in1. Ok for mainline? gcc/ChangeLog: * target.def: Describe in0 and in1 as being either register or memory operands. * doc/tm.texi: Regenerate. --- gcc/doc/tm.texi | 7 --- gcc/target.def | 7 --- 2 files