Re: [PATCH] [Middle-end] Enhance final_value_replacement_loop to handle bitwise induction.

2022-05-17 Thread Richard Biener via Gcc-patches
On Wed, May 18, 2022 at 4:45 AM Hongtao Liu wrote: > > On Fri, May 13, 2022 at 7:16 PM Richard Biener > wrote: > > > > On Fri, May 13, 2022 at 5:37 AM Hongtao Liu wrote: > > > > > > On Wed, May 11, 2022 at 4:45 PM Richard Biener via Gcc-patches > > > wrote: > > > > > > > > On Mon, May 9, 2022 a

Re: [PATCH] PR tree-optimization/31178 - Add rshift side effect.

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 8:41 PM Andrew MacLeod via Gcc-patches wrote: > > This patch implements side effects of the second operand of a shift > operation. > > given A >> B or A << B, the range of B is restricted to [0, PRECISION_A). > > Fortran is currently more permissive than this, allowing the

Re: [PATCH] Add divide by zero side effect.

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 8:40 PM Andrew MacLeod via Gcc-patches wrote: > > I haven't checked this patch in yet. This implements a side effect that > the divisor cannot be 0 after a divide executes. This allows us to fold > the divide away: > > a = b / c; > if (c == 0) >dead(); > > This bootstr

Re: [PATCH] middle-end/105604 - snprintf dianostics and non-constant sizes/offsets

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, 17 May 2022, Martin Sebor wrote: > On 5/16/22 03:16, Richard Biener wrote: > > The following tries to correct get_origin_and_offset_r not handling > > non-constant sizes of array elements in ARRAY_REFs and non-constant > > offsets of COMPONENT_REFs. It isn't exactly clear how such failure

Re: [PATCH] Simplify logic in tree-scalar-evolution's expensive_expression_p.

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 7:51 PM Roger Sayle wrote: > > > This patch simplifies tree-scalar-evolution's expensive_expression_p, but > produces identical results; the replacement implementation is just smaller > (uses less memory), faster and easier to understand. > > The current idiom (introduced t

Re: [PATCH] PR tree-optimization/105458 - Check for equivalence after merging relations.

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 5:46 PM Andrew MacLeod via Gcc-patches wrote: > > Sorry, missed this one earlier. > > When we register a relation, such as LE_EXPR, we first check if there > is an existing relation that applies, and if so they are combined. We > were checking if the relation being registe

Re: [PATCH] Optimize multiply/add of DImode extended to TImode, PR target/103109.

2022-05-17 Thread Michael Meissner via Gcc-patches
On Fri, May 13, 2022 at 01:20:30PM -0500, will schmidt wrote: > On Fri, 2022-05-13 at 12:17 -0400, Michael Meissner wrote: > > Optimize multiply/add of DImode extended to TImode, PR target/103109. > > > > On power9 and power10 systems, we have instructions that support doing > > 64-bit integers co

Re: [PATCH] [i386] recognize bzhi pattern when there's zero_extendsidi.

2022-05-17 Thread Hongtao Liu via Gcc-patches
On Tue, May 17, 2022 at 6:07 PM Uros Bizjak via Gcc-patches wrote: > > On Tue, May 17, 2022 at 5:06 AM liuhongt wrote: > > > > backend has > > > > 16550(define_insn "*bmi2_bzhi_3_2" > > 16551 [(set (match_operand:SWI48 0 "register_operand" "=r") > > 16552(and:SWI48 > > 16553 (pl

Re: [PATCH] Expand __builtin_memcmp_eq with ptest for OImode.

2022-05-17 Thread Hongtao Liu via Gcc-patches
On Tue, May 17, 2022 at 6:03 PM Uros Bizjak wrote: > > On Tue, May 17, 2022 at 3:33 AM Hongtao Liu wrote: > > > > On Mon, May 16, 2022 at 5:21 PM Uros Bizjak via Gcc-patches > > wrote: > > > > > > On Sat, May 7, 2022 at 7:05 AM liuhongt wrote: > > > > > > > > This is adjusted patch only for OIm

Re: [PATCH] [Middle-end] Enhance final_value_replacement_loop to handle bitwise induction.

2022-05-17 Thread Hongtao Liu via Gcc-patches
On Fri, May 13, 2022 at 7:16 PM Richard Biener wrote: > > On Fri, May 13, 2022 at 5:37 AM Hongtao Liu wrote: > > > > On Wed, May 11, 2022 at 4:45 PM Richard Biener via Gcc-patches > > wrote: > > > > > > On Mon, May 9, 2022 at 7:19 AM liuhongt wrote: > > > > > > > > This patch will enable below

Re: [PATCH v2] rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556]

2022-05-17 Thread Peter Bergner via Gcc-patches
On 5/17/22 6:41 PM, Segher Boessenkool wrote: > On Mon, May 16, 2022 at 05:31:31PM -0500, Peter Bergner wrote: >> (define_insn "mma_" >> - [(set (match_operand:XO 0 "fpr_reg_operand" "=&d") >> -(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa") >> -(match_operand:

[PATCH] c++: fix SIGFPE with -Wclass-memaccess [PR105634]

2022-05-17 Thread Marek Polacek via Gcc-patches
Here we crash because we attempt to % by 0. Thus fixed. While at it, I've moved the -Wclass-memaccess tests into warn/. I've checked that the # of expected passes is the same before/after the move. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? PR c++/105634 gcc/cp/ChangeL

[PATCH] c: Implement new -Wenum-int-mismatch warning [PR105131]

2022-05-17 Thread Marek Polacek via Gcc-patches
In C, an enumerated type is compatible with char, a signed integer type, or an unsigned integer type (6.7.2.2/5). Therefore this code compiles: enum E { l = -1, z = 0, g = 1 }; int foo(void); enum E foo(void) { return z; } if the underlying type of 'enum E' is 'int' (if not, we emit an err

[PATCH v3] c, c++: -Wswitch warning on [[maybe_unused]] enumerator [PR105497]

2022-05-17 Thread Marek Polacek via Gcc-patches
On Tue, May 10, 2022 at 09:54:12AM -0400, Marek Polacek wrote: > On Tue, May 10, 2022 at 08:58:46AM -0400, Jason Merrill wrote: > > On 5/7/22 18:26, Marek Polacek wrote: > > > Corrected version that avoids an uninitialized warning: > > > > > > This PR complains that we emit the "enumeration value

Re: [PATCH v2] rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556]

2022-05-17 Thread Segher Boessenkool
On Mon, May 16, 2022 at 05:31:31PM -0500, Peter Bergner wrote: > On 5/10/22 5:35 PM, Segher Boessenkool wrote: > > Out of interest, did you try using v,?wa (so just two alternatives, not > > four)? Or did you think it wouldresult in measurably worse code? Or > > did you decide it is not such bad

Go patch committed: load LHS subexpressions of op= only once

2022-05-17 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend loads LHS subexpressions of op= assignment only once. This avoids inconsistencies if the variables are changed by evaluating the RHS. This fixes https://go.dev/issue/52811. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. There is a

[pushed] c++: constexpr ref to array of array [PR102307]

2022-05-17 Thread Jason Merrill via Gcc-patches
The problem here is that first check_initializer calls build_aggr_init_full_exprs, which does overload resolution, but then in the case of failed constexpr throws away the result and does it again in build_functional_cast. But in the first overload resolution, reshape_init_array_1 decided to reuse

Re: [PATCH] middle-end/105604 - snprintf dianostics and non-constant sizes/offsets

2022-05-17 Thread Martin Sebor via Gcc-patches
On 5/16/22 03:16, Richard Biener wrote: The following tries to correct get_origin_and_offset_r not handling non-constant sizes of array elements in ARRAY_REFs and non-constant offsets of COMPONENT_REFs. It isn't exactly clear how such failures should be treated in this API and existing handling

Re: [PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Marek Polacek via Gcc-patches
On Tue, May 17, 2022 at 02:59:00PM -0700, Ian Lance Taylor wrote: > On Tue, May 17, 2022 at 2:46 PM Marek Polacek wrote: > > > > On Tue, May 17, 2022 at 09:35:14PM +, Joseph Myers wrote: > > > On Tue, 17 May 2022, Marek Polacek via Gcc-patches wrote: > > > > > > > The C and C++ FEs differ in T

Re: [PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Ian Lance Taylor via Gcc-patches
On Tue, May 17, 2022 at 2:46 PM Marek Polacek wrote: > > On Tue, May 17, 2022 at 09:35:14PM +, Joseph Myers wrote: > > On Tue, 17 May 2022, Marek Polacek via Gcc-patches wrote: > > > > > The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in > > > the list in the C++ FE has a CO

Re: [PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Marek Polacek via Gcc-patches
On Tue, May 17, 2022 at 09:35:14PM +, Joseph Myers wrote: > On Tue, 17 May 2022, Marek Polacek via Gcc-patches wrote: > > > The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in > > the list in the C++ FE has a CONST_DECL in the TREE_VALUE, but the C FE > > has only the numeric

Re: [PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Joseph Myers
On Tue, 17 May 2022, Marek Polacek via Gcc-patches wrote: > The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in > the list in the C++ FE has a CONST_DECL in the TREE_VALUE, but the C FE > has only the numerical value of the CONST_DECL there. This has caused > me some trouble in

[PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Marek Polacek via Gcc-patches
The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in the list in the C++ FE has a CONST_DECL in the TREE_VALUE, but the C FE has only the numerical value of the CONST_DECL there. This has caused me some trouble in my PR105497 patch. Using a CONST_DECL is preferable because a CONS

[committed] libstdc++: Relax memory ordering for default memory resource object

2022-05-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Currently pmr::set_default_resource and pmr::get_default_resource both use sequentially consistent memory ordering. This is overkill. The standard only requires that a call to set_default_resource synchronizes with subsequent calls to set_defaul

[committed] libstdc++: Add attributes to functions in

2022-05-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Add attributes to the accessors for the global memory resource objects, to allow the compiler to eliminate redundant calls to them. For example, multiple calls to std::pmr::new_delete_resource() will always return the same object, and so the com

[committed] libstdc++: Add attributes to and related

2022-05-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Add the const attribute to std::future_category() and std::iostream_category(), to match the existing attributes on std::generic_category() and std::system_category(). Also add [[nodiscard]] to those functions and to the comparison operators fo

[committed] Revert 'Use more ARRAY_SIZE.' for mkoffload (was: [PATCH] Use more ARRAY_SIZE.)

2022-05-17 Thread Tobias Burnus
Hi Martin, On 16.05.22 10:39, Martin Liška wrote: All right, CCing the following maintainers for other parts: - David for JIT and Analyzer - Tobias for Fortran part - Jason for C-family part Sorry for having missed that review request – and thanks to Mikael for doing the review! And thanks f

[PATCH] PR tree-optimization/31178 - Add rshift side effect.

2022-05-17 Thread Andrew MacLeod via Gcc-patches
This patch implements side effects of the second operand of a shift operation. given A >> B or A << B, the range of B is restricted to [0, PRECISION_A). Fortran is currently more permissive than this, allowing the range to be [0, PRECISION_A], so this si the value we currently default to in th

[PATCH] Add divide by zero side effect.

2022-05-17 Thread Andrew MacLeod via Gcc-patches
I haven't checked this patch in yet.  This implements a side effect that the divisor cannot be 0 after a divide executes. This allows us to fold the divide away: a = b / c; if (c == 0)   dead(); This bootstraps on x86_64-pc-linux-gnu with no regressions, but I first wanted to check to see if

[COMMITTED] Add ranger side effect infrastructure.

2022-05-17 Thread Andrew MacLeod via Gcc-patches
This patch replaces the old non-null processing mechanism in ranger with generic side-effect processing. The way it use to work: - The first time a query for non-nullness was made on an ssa-name, a quick pass over the immediate use lists was made. - This checked each use for triggering the non-

Re: [Patch] OpenMP: Skip target-nesting warning for reverse offload

2022-05-17 Thread Jakub Jelinek via Gcc-patches
On Mon, May 16, 2022 at 05:14:12PM +0200, Tobias Burnus wrote: > --- a/gcc/omp-low.cc > +++ b/gcc/omp-low.cc > @@ -3883,6 +3883,16 @@ check_omp_nesting_restrictions (gimple *stmt, > omp_context *ctx) > } > else > { > + if ((gimple_omp_target_ki

demangler: Structured Bindings

2022-05-17 Thread Nathan Sidwell
C++ Structured bindings have a mangling that has yet to be formally documented. However, it's been around for a while and shows up for module support. This adds it to the demangler. nathan -- Nathan SidwellFrom 451894cadcf1210883ceefb2d69a0ed2d6a8cd8b Mon Sep 17 00:00:00 2001 From: Nathan Sidw

Re: [PATCH] OpenMP, libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async

2022-05-17 Thread Jakub Jelinek via Gcc-patches
On Tue, May 17, 2022 at 11:57:02AM +0200, Marcel Vollweiler wrote: > > More importantly, I have no idea how this can work when you pass arg_size 0 > > and arg_align 0. The s variable is in the current function frame, with > > arg_size 0 nothing is really copied to the generated task. > > arg_size

[PATCH] Simplify logic in tree-scalar-evolution's expensive_expression_p.

2022-05-17 Thread Roger Sayle
This patch simplifies tree-scalar-evolution's expensive_expression_p, but produces identical results; the replacement implementation is just smaller (uses less memory), faster and easier to understand. The current idiom (introduced to fix PR90726) looks like: hash_map cache; uint64_t exp

RE: [PATCH 1/3]middle-end: Add the ability to let the target decide the method of argument promotions.

2022-05-17 Thread Tamar Christina via Gcc-patches
[…] > >> > We generate for e.g.: > >> > > >> > #include > >> > > >> > uint16_t f8 (uint8_t xr, uint8_t xc){ > >> > return (uint8_t)(xr * xc); > >> > } > >> > > >> > (insn 9 6 10 2 (set (reg:HI 101) > >> (zero_extend:HI (reg/v:QI 96 [ xr ]))) "prom.c":4:16 -1 > >> (nil)) > >> (insn 10 9 11 2 (

Re: [AArch64] Improve SVE dup intrinsics codegen

2022-05-17 Thread Richard Sandiford via Gcc-patches
"Andre Vieira (lists)" writes: > Hi, > > This patch teaches the aarch64 backend to improve codegen when using dup > with NEON vectors with repeating patterns. It will attempt to use a > smaller NEON vector (or element) to limit the number of instructions > needed to construct the input vector.

Re: [PATCH v2] PR105169 Fix references to discarded sections

2022-05-17 Thread Richard Biener via Gcc-patches
> Am 17.05.2022 um 19:37 schrieb Giuliano Belinassi via Gcc-patches > : > > On Mon, 2022-05-09 at 13:39 +0200, Richard Biener wrote: >>> On Sat, 7 May 2022, Giuliano Belinassi wrote: >>> >>> When -fpatchable-function-entry= is enabled, certain C++ codes >>> fails to >>> link because of gener

Re: [PATCH v2] PR105169 Fix references to discarded sections

2022-05-17 Thread Giuliano Belinassi via Gcc-patches
On Mon, 2022-05-09 at 13:39 +0200, Richard Biener wrote: > On Sat, 7 May 2022, Giuliano Belinassi wrote: > > > When -fpatchable-function-entry= is enabled, certain C++ codes > > fails to > > link because of generated references to discarded sections in > > __patchable_function_entry section. This

Re: [PATCH, rs6000] Remove the (no longer used) RS6000_BTC defines.

2022-05-17 Thread Segher Boessenkool
Hi! On Tue, May 17, 2022 at 11:54:10AM -0500, will schmidt wrote: > These defines are no longer used once the rs6000 built-in > reworks were completed. Would be good to remove them. :-) > There was a reference to RS6000_BTC_SPECIAL in a TODO comment > in rs6000-builtins.def. That comment rema

[PATCH, rs6000] Remove the (no longer used) RS6000_BTC defines.

2022-05-17 Thread will schmidt via Gcc-patches
[PATCH, rs6000] Remove the (no longer used) RS6000_BTC defines. Hi, These defines are no longer used once the rs6000 built-in reworks were completed. Would be good to remove them. There was a reference to RS6000_BTC_SPECIAL in a TODO comment in rs6000-builtins.def. That comment remains, but

[x86 PATCH] Correct ix86_rtx_cost for multi-word multiplication.

2022-05-17 Thread Roger Sayle
This is the i386 backend specific piece of my revised patch for PR middle-end/98865, where Richard Biener has suggested that I perform the desired transformation during RTL expansion where the backend can control whether it is profitable to convert a multiplication into a bit-wise AND and a negati

Re: [PATCH] c++: constexpr init of union sub-aggr w/ base [PR105491]

2022-05-17 Thread Patrick Palka via Gcc-patches
On Sat, May 7, 2022 at 5:18 PM Jason Merrill wrote: > > On 5/6/22 16:46, Patrick Palka wrote: > > On Fri, 6 May 2022, Jason Merrill wrote: > > > >> On 5/6/22 16:10, Patrick Palka wrote: > >>> On Fri, 6 May 2022, Patrick Palka wrote: > >>> > On Fri, 6 May 2022, Jason Merrill wrote: > > >>

Re: [PATCH] gdc 9, 10 and 11 bug fix

2022-05-17 Thread Marc Aurèle La France
On Tue, 17 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La France's message of Mai 17, 2022 5:31 pm: On Tue, 17 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La France's message of Mai 16, 2022 11:34 pm: On Sun, 15 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La F

Re: [PATCH] gdc 9, 10 and 11 bug fix

2022-05-17 Thread Iain Buclaw via Gcc-patches
Excerpts from Marc Aurèle La France's message of Mai 17, 2022 5:31 pm: > On Tue, 17 May 2022, Iain Buclaw wrote: >> Excerpts from Marc Aurèle La France's message of Mai 16, 2022 11:34 pm: >>> On Sun, 15 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La France's message of Mai 12, 2022

[x86 PATCH take 2] Avoid andn and generate shorter not;and with -Oz.

2022-05-17 Thread Roger Sayle
This is a revised version of my i386 backend patch to avoid andn with -Oz, when an explicit not;and (or not;test) would be (one byte) shorter. https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593168.html This revision incorporates Michael Matz's feedback/suggestions with explicit checks for LE

[PATCH] PR tree-optimization/105458 - Check for equivalence after merging relations.

2022-05-17 Thread Andrew MacLeod via Gcc-patches
Sorry, missed this one earlier. When we register a relation, such as LE_EXPR,  we first check if there is an existing relation that applies, and if so they are combined. We were checking if the relation being registered was an EQ_EXPR, and if so, invoked the equivalence oracle.  I was doing

Re: [PATCH] i386: Remove constraints when used with constant integer predicates.

2022-05-17 Thread Uros Bizjak via Gcc-patches
I have reverted the patch to fix PR105624. Uros. On Sun, May 15, 2022 at 10:10 PM Uros Bizjak wrote: > > const_int_operand and other const*_operand predicates do not need > constraints when the constraint is inherited from the range of > constant integer predicate. Remove the constraint in case

Re: [PATCH] gdc 9, 10 and 11 bug fix

2022-05-17 Thread Marc Aurèle La France
On Tue, 17 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La France's message of Mai 16, 2022 11:34 pm: On Sun, 15 May 2022, Iain Buclaw wrote: Excerpts from Marc Aurèle La France's message of Mai 12, 2022 10:29 pm: No compiler has any business rejecting files for the sole crime of b

[PATCH] Do not clear bb->aux in duplicate_loop_body_to_header_edge

2022-05-17 Thread Richard Biener via Gcc-patches
duplicate_loop_body_to_header_edge clears bb->aux which is not wanted by a new use in loop unswitching. The clearing was introduced with r0-69110-g6580ee7781f903 and it seems accidentially so. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. 2022-05-17 Richard Biener *

[committed] libgomp: Clarify that omp_display_env is fully implemented

2022-05-17 Thread Jakub Jelinek via Gcc-patches
Hi! OpenMP 5.2 added "When called from within a target region the effect is unspecified." restriction to omp_display_env, so it is ok not to support it in target regions (worst case we could add an empty implementation or one with __builtin_trap in there). Committed to trunk and 12.2. 2022-05-17

Re: [PATCH] Mitigate -Wmaybe-uninitialized in expmed.cc.

2022-05-17 Thread Martin Liška
On 5/16/22 12:32, Richard Biener wrote: > It only seems to happen with your host compiler though? The set of Yes, happens with just released 12.1 as host compiler: g++ -fcf-protection -fno-PIE -c -g -O2 -DIN_GCC -fPIC-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno

[PATCH v2 4/5] xtensa: Add setmemsi insn pattern

2022-05-17 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch introduces setmemsi insn pattern of two kinds, unrolled loop and small loop, for fixed small length and constant initialization value. gcc/ChangeLog: * gcc/config/xtensa/xtensa-protos.h (xtensa_expand_block_set_unrolled_loop, xtensa_expand_block_set_small_loop)

Re: [PING] Advise to call 'internal_error' instead of 'abort' or 'fancy_abort'

2022-05-17 Thread Richard Biener via Gcc-patches
On Tue, May 17, 2022 at 12:15 PM Thomas Schwinge wrote: > > Hi! > > Ping. OK. > > Grüße > Thomas > > > On 2022-05-10T16:03:12+0200, I wrote: > > Hi! > > > > On 2022-05-03T15:46:43+0200, Richard Biener > > wrote: > >> On Tue, May 3, 2022 at 2:29 PM Thomas Schwinge > >> wrote: > >>> On 2022-0

[committed] openmp: Add support for inoutset depend-kind

2022-05-17 Thread Jakub Jelinek via Gcc-patches
Hi! This patch adds support for inoutset depend-kind in depend clauses. It is very similar to the in depend-kind in that a task with a dependency with that depend-kind is dependent on all previously created sibling tasks with matching address unless they have the same depend-kind. In the in depen

Re: [PATCH] lto-plugin: add support for feature detection

2022-05-17 Thread Martin Liška
On 5/16/22 17:16, Alexander Monakov wrote: > On Mon, 16 May 2022, Martin Liška wrote: > >> I've implemented first version of the patch, please take a look. > > I'll comment on the patch, feel free to inform me when I should back off > with forcing my opinion in this thread :) I do really welcome

[AArch64] Improve SVE dup intrinsics codegen

2022-05-17 Thread Andre Vieira (lists) via Gcc-patches
Hi, This patch teaches the aarch64 backend to improve codegen when using dup with NEON vectors with repeating patterns. It will attempt to use a smaller NEON vector (or element) to limit the number of instructions needed to construct the input vector. Bootstrapped and regression tested  aarc

Re: [Patch] gcn/t-omp-device: Add 'amdgcn' as 'arch' [PR105602]

2022-05-17 Thread Jakub Jelinek via Gcc-patches
On Tue, May 17, 2022 at 02:45:09PM +0200, Tobias Burnus wrote: > Hi Jakub, hi Andrew, > > On 17.05.22 10:01, Jakub Jelinek wrote: > > But the above patch only implements it partially. > > What is in omp-device-properties-* is for the sake of the host compiler, > > [...] > > You need to also change

Re: [Patch] gcn/t-omp-device: Add 'amdgcn' as 'arch' [PR105602]

2022-05-17 Thread Tobias Burnus
Hi Jakub, hi Andrew, On 17.05.22 10:01, Jakub Jelinek wrote: But the above patch only implements it partially. What is in omp-device-properties-* is for the sake of the host compiler, [...] You need to also change gcc/config/gcn/gcn.cc (gcn_omp_device_kind_arch_isa) case omp_device_arch: handlin

Re: [PATCH] gdc 9, 10 and 11 bug fix

2022-05-17 Thread Iain Buclaw via Gcc-patches
Excerpts from Marc Aurèle La France's message of Mai 16, 2022 11:34 pm: > On Sun, 15 May 2022, Iain Buclaw wrote: >> Excerpts from Marc Aurèle La France's message of Mai 12, 2022 10:29 pm: > >>> No compiler has any business rejecting files for the sole crime of >>> being symlinked to. The followi

[committed] libstdc++: Skip tests that fail for the versioned namespace

2022-05-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Most tests for the contents of header synopses need to be supressed for the versioned namespace build, because redeclaring the entities in std fails when they were originally declared in std::__8. I added these tests recently without the suppression

[committed] libstdc++: Stop defining C++0x compat symbols for versioned namespace

2022-05-17 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, --enable-symvers=gnu and --enable-symvers=gnu-versioned-namespace. Pushed to trunk. -- >8 -- The src/c++11/compatibility*-c++0x.cc files define symbols that need to be exported for ancient versions of libstdc++.so.6 due to changes between C++0x and the final C++11 standard.

[PING] Advise to call 'internal_error' instead of 'abort' or 'fancy_abort'

2022-05-17 Thread Thomas Schwinge
Hi! Ping. Grüße Thomas On 2022-05-10T16:03:12+0200, I wrote: > Hi! > > On 2022-05-03T15:46:43+0200, Richard Biener > wrote: >> On Tue, May 3, 2022 at 2:29 PM Thomas Schwinge >> wrote: >>> On 2022-05-03T12:53:50+0200, Richard Biener >>> wrote: >>> > On Tue, May 3, 2022 at 10:16 AM Thomas

Re: [PATCH] [i386] recognize bzhi pattern when there's zero_extendsidi.

2022-05-17 Thread Uros Bizjak via Gcc-patches
On Tue, May 17, 2022 at 5:06 AM liuhongt wrote: > > backend has > > 16550(define_insn "*bmi2_bzhi_3_2" > 16551 [(set (match_operand:SWI48 0 "register_operand" "=r") > 16552(and:SWI48 > 16553 (plus:SWI48 > 16554(ashift:SWI48 (const_int 1) > 16555

Re: [PATCH] i386: Fix up V2DI and V1TI inequality comparisons [PR105613]

2022-05-17 Thread Uros Bizjak via Gcc-patches
On Tue, May 17, 2022 at 9:00 AM Jakub Jelinek wrote: > > Hi! > > The recent r13-458 change to introduce vec_cmpeqv1tiv1ti and > add TARGET_SSE2 support to vec_cmpeqv2div2di works nicely for > equality comparisons, but as the testcase shows doesn't work > for inequality comparisons. > For EQ if we

Re: [PATCH] Expand __builtin_memcmp_eq with ptest for OImode.

2022-05-17 Thread Uros Bizjak via Gcc-patches
On Tue, May 17, 2022 at 3:33 AM Hongtao Liu wrote: > > On Mon, May 16, 2022 at 5:21 PM Uros Bizjak via Gcc-patches > wrote: > > > > On Sat, May 7, 2022 at 7:05 AM liuhongt wrote: > > > > > > This is adjusted patch only for OImode. > > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m3

Re: [wwwdocs][Patch] Add OpenMP by-GCC-version implementation status

2022-05-17 Thread Jakub Jelinek via Gcc-patches
On Tue, May 17, 2022 at 11:50:15AM +0200, Tobias Burnus wrote: > On 17.05.22 11:00, Jakub Jelinek wrote: > > BTW, it would be really nice to use colors like > > https://gcc.gnu.org/projects/cxx-status.html uses, use just GCC versions > > instead of GCC version and No instead of N and use hyperlinks

Re: [PATCH] OpenMP, libgomp: Add new runtime routines omp_target_memcpy_async and omp_target_memcpy_rect_async

2022-05-17 Thread Marcel Vollweiler
Hi Jakub, --- a/libgomp/libgomp.map +++ b/libgomp/libgomp.map @@ -224,6 +224,8 @@ OMP_5.1 { omp_set_teams_thread_limit_8_; omp_get_teams_thread_limit; omp_get_teams_thread_limit_; +omp_target_memcpy_async; +omp_target_memcpy_rect_async; } OMP_5.0.2; These should be add

Re: [wwwdocs][Patch] Add OpenMP by-GCC-version implementation status

2022-05-17 Thread Tobias Burnus
On 17.05.22 11:00, Jakub Jelinek wrote: BTW, it would be really nice to use colors like https://gcc.gnu.org/projects/cxx-status.html uses, use just GCC versions instead of GCC version and No instead of N and use hyperlinks to changes.html OpenMP ids (or just changes.html if we don't have an id).

Re: [PATCH] [x86_64]: Zhaoxin lujiazui enablement

2022-05-17 Thread Mayshao-oc
> On Tue, May 17, 2022 at 5:15 AM mayshao wrote: >> Hi Uros: >> This patch fix Zhaoxin CPU vendor ID detection problem and add >> zhaoxin "lujiazui" processor support. >> Currently gcc can't recognize Zhaoxin CPU(vendor ID "CentaurHauls" >> and "Shanghai") if user use -march=nati

Re: [PATCH 1/3]middle-end: Add the ability to let the target decide the method of argument promotions.

2022-05-17 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: […] >> E.g. does the patch avoid the AND in: >> >> #include >> uint8_t foo(uint8_t x, int y) { >> if (y) { >> printf("Foo %d\n", x ? 1 : 2); >> __builtin_abort (); >> } >> return x + 1; >> } >> >> ? > > Morning, > > It does actually, it genera

Re: [wwwdocs][Patch] Add OpenMP by-GCC-version implementation status

2022-05-17 Thread Jakub Jelinek via Gcc-patches
On Tue, May 17, 2022 at 10:49:42AM +0200, Tobias Burnus wrote: > Thoughts on this part? Either place is fine. > > > +Map-order clarificationsGCC? > > This entry I gave up on, it isn't exactly clear to me what that > > bullet is about and once we figure that out, we need to do some archeology > >

Re: [wwwdocs][Patch] Add OpenMP by-GCC-version implementation status

2022-05-17 Thread Tobias Burnus
Hi Jakub & Gerald, first, thanks for all the suggestions! I have now followed Gerald's suggestion to place the table into the main GOMP page. I then also decided to make it more GCC-user orientated than GCC-developer orientated by re-writing the intro (but keeping the old one as background), al

[PATCH] tree-optimization/105618 - restore load sinking

2022-05-17 Thread Richard Biener via Gcc-patches
The PR97330 fix caused some missed sinking of loads out of loops the following patch re-instantiates. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-05-17 Richard Biener PR tree-optimization/105618 * tree-ssa-sink.cc (statement_sink_location): For virtual

[Ada] Subprogram renaming fails to hide homograph

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler failed to detect an error where the first prefix of an expanded name given as the renamed subprogram in a subprogram renaming declaration denotes a unit with the same name as the name given for the subprogram renaming. Such a unit must be hidden by the renaming itself. An error check i

[Ada] Restore defensive guard in checks for volatile actuals

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
When flagging names of volatile objects occurring in actual parameters it is safer to guard against identifiers without entity. This is redundant (because earlier in the resolution of actual parameters we already guard against actuals with Any_Type), but perhaps such identifiers will become allowed

[Ada] CUDA: remove code performing kernel registration

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
A previous commit implemented a new kernel registration scheme, using the binder to generate registration code rather than inserting registration code in packages. Now that this new approach has had time to be thoroughly tested, it is time to remove the old approach. Tested on x86_64-pc-linux-gnu

[Ada] Enhance the warning on C enum with size clause for size /= 32

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Improve the warning message and silence warning when size > 32, this is likely intentional and does not warrant a warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * freeze.adb (Freeze_Enumeration_Type): Fix comment, enhance message and silence warning for size

[Ada] Allow inlining for proof inside generics

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
For local subprograms without contracts inside generics, allow their inlining for proof in GNATprove mode. This requires forbidding the inlining of subprograms which contain references to object renamings, which would be replaced in the SPARK expansion and violate assumptions of the inlining code.

[Ada] Provide allocation subtype for allocators of a Designated_Storage_Model type

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
When an allocator is for an access type that has a Designated_Storage_Model aspect, and the designated type is an unconstrained record type with discriminants, and the subtype associated with the allocator is constrained, a dereference of the new access value can be passed to the designated type's

[Ada] Cleanups related to front-end SJLJ

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
This patch cleans up some code that is left over from the front-end SJLJ exception handling mechanism, which has been removed. This is in preparation for fixing a finalization-related bug. Most importantly: The documentation is changed: a Handled_Sequence_Of_Statements node CAN contain bo

[Ada] GNAT.Binary_Search is not internal

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Put package GNAT.Binary_Search to predefined units list. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * impunit.adb: Add "g-binsea" to Non_Imp_File_Names_95 list.diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -2

[Ada] Fix insertion of declaration inside quantified expression

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
When the evaluation of the subtype_indication for the iterator_specification of a quantified_expression leads to the insertion of a type declaration, this should be done with Insert_Action instead of Insert_Before. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb

[Ada] Fix Forced sign flag in formatted string

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Fix the Forced sign flag that is incorrectly ignored for scientific notation and shortest representation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-forstr.adb (Is_Number): Add scientific notation and shortest representation.diff --git a/gcc/ada/libgna

[Ada] Fix small glitch in Expand_N_Full_Type_Declaration

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
The original node is not guaranteed to also be an N_Full_Type_Declaration, so the code needs to look into the node itself. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Expand_N_Full_Type_Declaration): Look into N.diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp

[Ada] Requires_Cleanup_Actions and N_Protected_Body

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
This patch disallows N_Protected_Body from being passed to Requires_Cleanup_Actions. Protected bodies never need cleanup, and are never passed to Requires_Cleanup_Actions, which is a good thing, because it would blow up on Handled_Statement_Sequence, which doesn't exist for N_Protected_Body. Teste

[Ada] Output.w always writes to stderr

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
There are several debugging procedures called Output.w, and some output-redirection features. This patch modifies Output.w so their output is not redirected; it always goes to standard error. Otherwise, debugging output can get mixed in with some "real" output (perhaps to a file), which causes conf

[Ada] Generic binary search implementation

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Allows binary search in sorted anonymous array (or array-like container). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-binsea.ads, libgnat/g-binsea.adb (GNAT.Binary_Search): New package. * Makefile.rtl (GNATRTL_NONTASKING_OBJS): New item in list.

[Ada] Fix bogus visibility error with partially parameterized formal package

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
The problem comes from the special instantiation (abbreviated instantiation in GNAT parlance) done to check conformance between a formal package and its corresponding actual in a generic instantiation: the compiler instantiates the formal package, in the context of the generic instantiation, so tha

[Ada] Take full view of private type

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
This allows to resolve the following: type Rec (<>) is private; type Arr (<>) is private; private type Arr is array (Positive range <>) of Natural; type Rec (L : Natural) is record F1 : Integer; F2 : Arr (1 .. L); end record; Tested on x86_64-pc-

[Ada] Allow 'Reduce with -gnat2022

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
After a period of experimentation, allow 'Reduce in Ada 2022 mode. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Analyze_Attribute [Attribute_Reduce]): Allow 'Reduce for Ada 2022 and above. * sem_attr.ads (Attribute_Impl_Def): 'Reduce is no lo

[Ada] Don't create calls to Abort_Undefer when not Abort_Allowed

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Prevent creation of references to Abort_Undefer when aborts aren't allowed. Another solution could have been an early return at Expand_N_Asynchronous_Select's beginning, but this would break backends that currently expect trees that do not contain any N_Asynchronous_Selects in their AST (e.g. CodeP

[Ada] Typo fix in finalization comment

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Add missing 's' and reformat the comment block. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb: Fix typo.diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -157,14 +157,14 @@ package body Exp_Ch7 is

[Ada] Initialize Compiler_State to avoid Constraint_Error

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
When building gnat1 with `-gnatVa` as we do locally, rules like: `gcc -c -gnatyM79 ` will throw a constraint error as `lib.compiler_state` is initialized by par.adb, ie after scanning. Therefore any error_msg thrown during scanning will perform this uninitialized read (which raises a Constraint_Err

[Ada] Deal with derived record types in Has_Compatible_Representation

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
More precisely, untagged record types, as tagged record types are already handled by the predicate. If the derived type has not been given its own representation clause, then the representations are the same. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Has

[Ada] Streamline implementation of Has_Compatible_Representation

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
The predicate is only concerned with the internal representation of types and this representation is shared by the subtypes of a given type, so the implementation can directly look into the (implementation) base types. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/

[Ada] Remove superfluous call to Original_Node

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
The function Same_Object starts by taking the Original_Node of its arguments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Remove superfluous call to Original_Node.diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb --- a/gcc/a

[Ada] Crash freezing declaration that will raise constraint error

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
When the compiler is built with assertions enabled and processes the following declarations: type Vector_Boolean_Array is array (1 .. 10) of Boolean; O2 : constant Vector_Boolean_Array := [for J in 2 => True]; The expression is rewritten by the frontend with an N_Raise_CE node, which leads

[Ada] Use Actions field of freeze nodes for subprograms

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
This has a couple of advantages: 1) the actions are analyzed with checks disabled and 2) they are considered elaboration code by Sem_Elab. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch13.adb (Expand_N_Freeze_Entity): Delete freeze nodes for subprograms only

[Ada] Implement calls to abstract subprograms in class-wide pre/post-conditions

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
In some special cases involving class-wide pre/post conditions, Ada allows a non-dispatching call to an abstract function (which is usually illegal). Fix a bug in the implementation of Ada's rules about the run-time behavior of such a call. Thanks to Javier Miranda for producing this patch. Teste

[Ada] Fix documentation of using attribute Loop_Entry in pragmas

2022-05-17 Thread Pierre-Marie de Rodat via Gcc-patches
Attribute Loop_Entry was initially only allowed to appear in pragmas Loop_Variant and Loop_Invariant. Then it was also allowed to appear in pragmas Assert, Assert_And_Cut and Assume, but this change was not reflected in the GNAT RM. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

  1   2   >