[PATCH] Improve sequence logic in cxx_init_decl_processing

2022-01-06 Thread Olivier Hainque via Gcc-patches
Hello, commit aa2c978400f3b3ca6e9f2d18598a379589e77ba0, introduced per https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545552.html makes references to __cxa_pure_virtual weak and this is causing issues on some VxWorks configurations, where weak symbols are only supported for one of the two

[PATCH] expr: Workaround profiledbootstrap uninit false positive [PR103899]

2022-01-06 Thread Jakub Jelinek via Gcc-patches
Hi! The threader changes resulted in a false positive warning during profiledbootstrap: In file included from ../../gcc/expr.c:26: ../../gcc/tree.h: In function ‘rtx_def* expand_expr_real_1(tree, rtx, machine_mode, expand_modifier, rtx_def**, bool)’: ../../gcc/tree.h:244:56: error: ‘context’ may

[PATCH] c++: Ensure some more that immediate functions aren't gimplified [PR103912]

2022-01-06 Thread Jakub Jelinek via Gcc-patches
Hi! Immediate functions should never be emitted into assembly, the FE doesn't genericize them and does various things to ensure they aren't gimplified. But the following testcase ICEs anyway due to that, because the consteval function returns a lambda, and operator() of the lambda has decl_functio

[PATCH] [i386] Optimize V16HF vector insert to element 0 for AVX2.

2022-01-06 Thread liuhongt via Gcc-patches
Also remove mode attribute blendsuf, use ssemodesuf instead. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready to push to trunk. gcc/ChangeLog: PR target/103753 * config/i386/i386-expand.c (ix86_expand_vector_set): Not use gen_avx2_pblendph_pblendd when elt =

[PATCH] c++: Reject in constant evaluation address comparisons of start of one var and end of another [PR89074]

2022-01-06 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase used to be incorrectly accepted. The match.pd optimization that uses address_compare punts on folding comparison of start of one object and end of another one only when those addresses are cast to integral types, when the comparison is done on pointer types it assumes u

Re: [PATCH] libgomp, OpenMP, nvptx: Low-latency memory allocator

2022-01-06 Thread Tom de Vries via Gcc-patches
On 1/5/22 15:36, Andrew Stubbs wrote: On 05/01/2022 13:04, Tom de Vries wrote: On 1/5/22 12:08, Tom de Vries wrote: The allocators-1.c test-case doesn't compile because: ... FAIL: libgomp.c/allocators-1.c (test for excess errors) Excess errors: /home/vries/oacc/trunk/source-gcc/libgomp/testsuit

Re: [PATCH] match.pd: Simplify 1 / X for integer X [PR95424]

2022-01-06 Thread Zhao Wei Liew via Gcc-patches
On Wed, 5 Jan 2022 at 17:55, Richard Biener wrote: > On Wed, Jan 5, 2022 at 10:42 AM Jakub Jelinek wrote: > > > > On Wed, Jan 05, 2022 at 10:38:53AM +0100, Richard Biener via Gcc-patches > wrote: > > > On Wed, Jan 5, 2022 at 10:18 AM Zhao Wei Liew > wrote: > > > > > > > > > X >= -1 && X <= 1 is

Re: [committed] libstdc++: Reduce template instantiations in

2022-01-06 Thread Stephan Bergmann via Gcc-patches
On 05/01/2022 14:47, Jonathan Wakely via Libstdc++ wrote: Tested powerpc64le-linux, pushed to trunk. This moves the last two template parameters of __regex_algo_impl to be runtime function parameters instead, so that we don't need four different instantiations for the possible ways to call it.

Re: [PATCH] match.pd: Simplify 1 / X for integer X [PR95424]

2022-01-06 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 06, 2022 at 05:52:03PM +0800, Zhao Wei Liew wrote: > On Wed, 5 Jan 2022 at 17:55, Richard Biener > wrote: > > > On Wed, Jan 5, 2022 at 10:42 AM Jakub Jelinek wrote: > > > > > > On Wed, Jan 05, 2022 at 10:38:53AM +0100, Richard Biener via Gcc-patches > > wrote: > > > > On Wed, Jan 5,

Re: [committed] libstdc++: Reduce template instantiations in

2022-01-06 Thread Jonathan Wakely via Gcc-patches
On Thu, 6 Jan 2022 at 10:00, Stephan Bergmann wrote: > On 05/01/2022 14:47, Jonathan Wakely via Libstdc++ wrote: > > Tested powerpc64le-linux, pushed to trunk. > > > > > > This moves the last two template parameters of __regex_algo_impl to be > > runtime function parameters instead, so that we do

[PATCH v2] match.pd: Simplify 1 / X for integer X [PR95424]

2022-01-06 Thread Zhao Wei Liew via Gcc-patches
This patch implements an optimization for the following C++ code: int f(int x) { return 1 / x; } int f(unsigned int x) { return 1 / x; } Before this patch, x86-64 gcc -std=c++20 -O3 produces the following assembly: f(int): xor edx, edx mov eax, 1 idiv edi ret f(unsigned

Re: [committed] libstdc++: Reduce template instantiations in

2022-01-06 Thread Jonathan Wakely via Gcc-patches
On Thu, 6 Jan 2022 at 10:33, Jonathan Wakely wrote: > > > On Thu, 6 Jan 2022 at 10:00, Stephan Bergmann wrote: > >> On 05/01/2022 14:47, Jonathan Wakely via Libstdc++ wrote: >> > Tested powerpc64le-linux, pushed to trunk. >> > >> > >> > This moves the last two template parameters of __regex_algo

Re: [PATCH] expr: Workaround profiledbootstrap uninit false positive [PR103899]

2022-01-06 Thread Richard Biener via Gcc-patches
On January 6, 2022 9:38:40 AM GMT+01:00, Jakub Jelinek via Gcc-patches wrote: >Hi! > >The threader changes resulted in a false positive warning during >profiledbootstrap: >In file included from ../../gcc/expr.c:26: >../../gcc/tree.h: In function ‘rtx_def* expand_expr_real_1(tree, rtx, >machine_m

Re: [PATCH] [RTL/fwprop] Allow propagations from inner loop to outer loop.

2022-01-06 Thread Richard Biener via Gcc-patches
On January 6, 2022 7:51:48 AM GMT+01:00, liuhongt wrote: >> that's flow_loop_nested_p (loop *outer, loop *inner) which >> is implemented in O(1). Note behavior for outer == inner >> might be different (didn't check your implementation too hard) >> >Thanks, it seems flow_loop_nested_p assume outer

Re: [PATCH] LTO plugin: modernize a bit.

2022-01-06 Thread Martin Liška
On 1/5/22 18:43, Jeff Law wrote: But the timing isn't great.  We're in stage3 and presumably moving into stage4 shortly. Shouldn't this wait until stage1 re-opens? Agree, I'm going to prepare the changes for GCC 13, same as LTO plugin support for ld.mold. Cheers, Martin

[PATCH] [i386] Support commutative alternative for AVX512 vpcmpeq{b, w, d, q}

2022-01-06 Thread liuhongt via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready to push to trunk. gcc/ChangeLog: * config/i386/sse.md (*_eq3_1): Extend to UNSPEC_PCMP_UNSIGNED. gcc/testsuite/ChangeLog: * gcc.target/i386/pr103774.c: New test. * gcc.target/i386/avx512bw-vp

Re: [PATCH] Libquadmath: add nansq() function

2022-01-06 Thread FX via Gcc-patches
Hi Joseph, > All targets with _Float128 should have __builtin_nansf128, since we have > DEF_GCC_FLOATN_NX_BUILTINS (BUILT_IN_NANS, "nans", NAN_TYPE, > ATTR_CONST_NOTHROW_NONNULL) > in builtins.def. Hum, I see, I didn’t know that version existed. To be honest, I find the “other built-ins” doc pa

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-06 Thread David Malcolm via Gcc-patches
On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: > This patch fixes a memory leak in the pass manager. In the existing > code, > the m_name_to_pass_map is allocated in > pass_manager::register_pass_name, but > never deallocated.  This is fixed by adding a deletion in > pass_manager:

Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854]

2022-01-06 Thread David Malcolm via Gcc-patches
On Thu, 2022-01-06 at 08:53 -0500, David Malcolm wrote: > On Sun, 2021-12-19 at 22:30 +0100, Marc Nieper-Wißkirchen wrote: > > This patch fixes a memory leak in the pass manager. In the existing > > code, > > the m_name_to_pass_map is allocated in > > pass_manager::register_pass_name, but > > never

PING (C/C++): Re: [PATCH 6/6] Add __attribute__ ((tainted))

2022-01-06 Thread David Malcolm via Gcc-patches
On Sat, 2021-11-13 at 15:37 -0500, David Malcolm wrote: > This patch adds a new __attribute__ ((tainted)) to the C/C++ > frontends. Ping for GCC C/C++ mantainers for review of the C/C++ FE parts of this patch (attribute registration, documentation, the name of the attribute, etc). (I believe it's

[PATCH 0/6] ira: Fix performance regression in exchange2 [PR98782]

2022-01-06 Thread Richard Sandiford via Gcc-patches
This series of patches recovers the exchange2 performance lost in the GCC 11 timeframe (at least on aarch64 and Power9 -- thanks Pat for testing the latter). There are 6 patches, split into two groups of 3. The first 3 are just preparatory patches, although patch 2 does contain a minor bug fix. T

[PATCH 1/6] ira: Add a ira_loop_border_costs class

2022-01-06 Thread Richard Sandiford via Gcc-patches
The final index into (ira_)memory_move_cost is 1 for loads and 0 for stores. Thus the combination: entry_freq * memory_cost[1] + exit_freq * memory_cost[0] is the cost of loading a register on entry to a loop and storing it back on exit from the loop. This is the cost to use if the register i

[PATCH 2/6] ira: Add comments and fix move_spill_restore calculation

2022-01-06 Thread Richard Sandiford via Gcc-patches
This patch adds comments to describe each use of ira_loop_border_costs. I think this highlights that move_spill_restore was using the wrong cost in one case, which came from tranposing [0] and [1] in the original (pre-ira_loop_border_costs) ira_memory_move_cost expressions. The difference would on

[PATCH 3/6] ira: Add ira_subloop_allocnos_can_differ_p

2022-01-06 Thread Richard Sandiford via Gcc-patches
color_pass has two instances of the same code for propagating non-cap assignments from parent loops to subloops. This patch adds a helper function for testing when such propagations are required for correctness and uses it to remove the duplicated code. A later patch will use this in ira-build.c

[PATCH 4/6] ira: Try to avoid propagating conflicts

2022-01-06 Thread Richard Sandiford via Gcc-patches
Suppose that: - an inner loop L contains an allocno A - L clobbers hard register R while A is live - A's parent allocno is AP Previously, propagate_allocno_info would propagate conflict sets up the loop tree, so that the conflict between A and R would become a conflict between AP and R (and so on

[PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-06 Thread Richard Sandiford via Gcc-patches
If an allocno A in an inner loop L spans a call, a parent allocno AP can choose to handle a call-clobbered/caller-saved hard register R in one of two ways: (1) save R before each call in L and restore R after each call (2) spill R to memory throughout L (2) can be cheaper than (1) in some cases,

[PATCH 6/6] ira: Handle "soft" conflicts between cap and non-cap allocnos

2022-01-06 Thread Richard Sandiford via Gcc-patches
This patch looks for allocno conflicts of the following form: - One allocno (X) is a cap allocno for some non-cap allocno X2. - X2 belongs to some loop L2. - The other allocno (Y) is a non-cap allocno. - Y is an ancestor of some allocno Y2 in L2. - Y2 is not referenced in L2 (that is, ALLOCNO_NREF

[committed] libstdc++: Do not use std::isdigit in [PR103911]

2022-01-06 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This avoids a potential race condition if std::setlocale is used concurrently with std::from_chars. libstdc++-v3/ChangeLog: PR libstdc++/103911 * include/std/charconv (__from_chars_alpha_to_num): Return char instead of unsigned

[committed] libstdc++: Increase timeout for pthread7-rope.cc test

2022-01-06 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This test spawns thousands of threads and so times out if the tests are run with a low timeout value and the machine is busy. libstdc++-v3/ChangeLog: * testsuite/ext/rope/pthread7-rope.cc: Add dg-timeout-factor. --- libstdc++-v3/testsuite/ext/

Re: [committed] libstdc++: Reduce template instantiations in

2022-01-06 Thread Jonathan Wakely via Gcc-patches
On Thu, 6 Jan 2022 at 10:43, Jonathan Wakely wrote: > > > On Thu, 6 Jan 2022 at 10:33, Jonathan Wakely wrote: > >> >> >> On Thu, 6 Jan 2022 at 10:00, Stephan Bergmann >> wrote: >> >>> On 05/01/2022 14:47, Jonathan Wakely via Libstdc++ wrote: >>> > Tested powerpc64le-linux, pushed to trunk. >>>

[committed] libstdc++: Add self-merge check to std::forward_list::merge [PR103853]

2022-01-06 Thread Jonathan Wakely via Gcc-patches
From: "Pavel I. Kryukov" Tested powerpc64le-linux, pushed to trunk. This implements the proposed resolution of LWG 3088, so that x.merge(x) is a no-op, consistent with std::list::merge. Signed-off-by: Pavel I. Kryukov Co-authored-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libs

Re: [PATCH 1/6] ira: Add a ira_loop_border_costs class

2022-01-06 Thread Jan Hubicka via Gcc-patches
> The final index into (ira_)memory_move_cost is 1 for loads and > 0 for stores. Thus the combination: > > entry_freq * memory_cost[1] + exit_freq * memory_cost[0] > > is the cost of loading a register on entry to a loop and > storing it back on exit from the loop. This is the cost to > use i

Re: [PATCH 1b/6] Add __attribute__((untrusted))

2022-01-06 Thread David Malcolm via Gcc-patches
On Thu, 2021-12-09 at 15:54 -0700, Martin Sebor wrote: > On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote: > > This patch adds a new: > > > >    __attribute__((untrusted)) > > > > for use by the C front-end, intended for use by the Linux kernel for > > use with "__user", but which could b

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Andrew MacLeod via Gcc-patches
On 1/5/22 07:34, Richard Biener wrote: On Thu, Dec 9, 2021 at 2:02 PM Martin Liška wrote: On 11/30/21 12:17, Richard Biener wrote: + unswitch_predicate *predicate + = new unswitch_predicate (expr, idx, edge_index); + ranger->gori ().outgoing_e

[committed] c++: Add testcase for recently fixed PR [PR69681]

2022-01-06 Thread Patrick Palka via Gcc-patches
Fixed ever since r12-6188. PR c++/69681 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-compare2.C: New test. --- gcc/testsuite/g++.dg/cpp0x/constexpr-compare2.C | 10 ++ 1 file changed, 10 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-compare2

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Martin Liška
On 1/6/22 16:11, Andrew MacLeod wrote: On 1/5/22 07:34, Richard Biener wrote: On Thu, Dec 9, 2021 at 2:02 PM Martin Liška wrote: On 11/30/21 12:17, Richard Biener wrote: + unswitch_predicate *predicate +   = new unswitch_predicate (expr, idx, edge_index); +   

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Andrew MacLeod via Gcc-patches
On 1/6/22 11:02, Martin Liška wrote: On 1/6/22 16:11, Andrew MacLeod wrote: On 1/5/22 07:34, Richard Biener wrote: On Thu, Dec 9, 2021 at 2:02 PM Martin Liška wrote: On 11/30/21 12:17, Richard Biener wrote: + unswitch_predicate *predicate +   = new unswitch_p

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Martin Liška
On 1/5/22 13:34, Richard Biener wrote: On Thu, Dec 9, 2021 at 2:02 PM Martin Liška wrote: On 11/30/21 12:17, Richard Biener wrote: I'd like to see the gswitch support - that's what was posted before stage3 close, this patch on its own doesn't seem worth pushing for. That said, I have some co

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Andrew MacLeod via Gcc-patches
On 1/6/22 11:02, Martin Liška wrote: On 1/6/22 16:11, Andrew MacLeod wrote: On 1/5/22 07:34, Richard Biener wrote: On Thu, Dec 9, 2021 at 2:02 PM Martin Liška wrote: On 11/30/21 12:17, Richard Biener wrote: + unswitch_predicate *predicate +   = new unswitch_p

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Martin Liška
On 1/6/22 17:20, Andrew MacLeod wrote: So if you get a FALSE back, you cannot use any results because GORI is claiming that it cant figure something out... or there is nothing to figure out.   Most of rangers routines are implemented so that if they return FALSE, the result is meaningless. A

[PATCH] nvptx: Add support for PTX's cnot instruction.

2022-01-06 Thread Roger Sayle
Happy New Year for 2022. This is a simple patch, now that the nvptx backend has transitioned to STORE_FLAG_VALUE=1, that adds support for NVidia's cnot instruction, that implements C/C++ style logical negation. Previously, the simple function: int foo(int x) { return !x; } on nvptx-none with -

Re: [PATCH] Loop unswitching: support gswitch statements.

2022-01-06 Thread Andrew MacLeod via Gcc-patches
On 1/6/22 11:35, Martin Liška wrote: On 1/6/22 17:20, Andrew MacLeod wrote: So if you get a FALSE back, you cannot use any results because GORI is claiming that it cant figure something out... or there is nothing to figure out.   Most of rangers routines are implemented so that if they return

Re: [PATCH 1/2] RISC-V: Allow extension name contain digit

2022-01-06 Thread Kito Cheng via Gcc-patches
Committed On Fri, Dec 3, 2021 at 11:51 PM Kito Cheng wrote: > > RISC-V spec only allow alphabetical name for extension before, however > vector extension add several extension named with digits, so we try to > extend the naming rule. > > Ref: > https://github.com/riscv/riscv-isa-manual/pull/718 >

Re: [PATCH 2/2] RISC-V: Minimal support of vector extensions

2022-01-06 Thread Kito Cheng via Gcc-patches
Committed with minor changelog fix On Fri, Dec 3, 2021 at 11:52 PM Kito Cheng wrote: > > gcc/ChangeLog: > > * common/config/riscv/riscv-common.c (riscv_implied_info): Add > vector extensions. > (riscv_ext_version_table): Add version info for vector extensions. > (r

[Ada] Proof of runtime units for binary modular exponentiation

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the generic unit System.Exponu instantiated for Unsigned, Long_Long_Unsigned and Long_Long_Long_Unsigned. The proof is simpler than the one for signed integers, as there are no possible overflows here. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-exp

[Ada] Proof of runtime unit for non-binary modular exponentiation

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This proof combines the difficulties of proving signed exponentiation, as we need to compare the result to the mathematical one using big integers, with pervasive use of modulo operation. This requires lemmas which should later be isolated in a shared library, for possible reuse in other runtime un

[Ada] Simplify GNAT AST printing with simple GNAT hash table

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
For pretty-printing of GNAT AST we had a custom hash table which stored visited nodes. Now this custom hash table is replaced with an instance of GNAT.Dynamic_Tables.Dynamic_Hash_Tables. Expansion and compression factors for this table are the same as for all other instances of Dynamic_Hash_Tables

[Ada] Simplify repeated calls in printing of GNAT AST

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * treepr.adb (Visit_Node): Simplify repeated call to Next_Entity.diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -2305,8 +23

[Ada] Crash in class-wide pre/postconditions

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler may crash processing a class-wide pre/postcondition that has dispatching calls using the Object.Operation notation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * contracts.adb (Restore_Original_Selected_Component): New subprogram that traverses a prean

[Ada] Justify false positive message from CodePeer analysis of GNAT

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Analysis of loop variant is known to lead to false alarms with CodePeer. Add pragma Annotate in such a case which can be justified. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-exponu.adb (Exponu): Add annotation.diff --git a/gcc/ada/libgnat/s-exponu.adb b/gcc/a

[Ada] Removal of technical debt

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This patch removes various technical debt in the form of "???" comments throughout the GNAT sources. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Add comments regarding special handling of components which depend on

[Ada] Suppress spurious CodePeer check on generic actual subprogram

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Procedure Destroy is intentionally doing nothing and needs an IN OUT parameter, because to match the profile of a generic formal subprogram. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * treepr.adb (Destroy): Prevent spurious check from CodePeer.diff --git a/gcc/ada/treepr

[Ada] Rename Any_Access into Universal_Access

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
The front-end defines an Any_Access entity which is only used as the type of the literal null. Now, since AI95-0230, the RM 4.2(8/2) clause reads: "An integer literal is of type universal_integer. A real literal is of type universal_real. The literal null is of type universal_access." and e.g. Fin

[Ada] Remove duplicates of empty strings

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
In package Stringt we already have a Null_String_Id, which represents a null string with length zero. There is no need to duplicate it in other packages. Cleanup originating from enabling expansion of dispatching wrappers for GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, comm

[Ada] New restriction No_Tagged_Type_Registration

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This patch implements the No_Tagged_Type_Registration restriction, analogous to No_Exception_Registration, but for tagged types. Fix several violations of the RTE_Available protocol, as documented in rtsfind.ads: -- If we call this and it returns True, we should generate a reference to --

[Ada] Spurious error when using current instance of type

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes an issue in the compiler whereby it fails to recognize the presence of a current instance of an incomplete type when the instance is used within a default expression for a record component. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Build_A

[Ada] Avoid building malformed component constraints

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Given a discriminated type T1 with discriminant D1 having a component C1 of another discriminated type T2 with discriminant D2 and a propagated discriminant constraint (that is, "C1 : T2 (D2 => D1);" and, for example, a parameter of type T1, the compiler will sometimes build an anonymous subtype to

[Ada] Avoid building malformed component constraints

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
The previous fix introduced a not-yet-understood regression in compiling CodePeer. For now, we attempt a quick workaround for the problem. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Build_Discriminant_Reference): In the unexpected case where we pre

[Ada] Fix spurious error on instantiation with Text_IO name

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This gets rid of a spurious error given by the compiler on the instantiation of a generic package, when the instance happens to be an homonym of one of the subpackages of Text_IO (Fixed_IO, Float_IO, etc) and when it is placed in a context where Text_IO itself is also visible. Tested on x86_64-pc-

[Ada] Fix style in calls to Compile_Time_Constraint_Error

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of -gnatwE (warnings-as-errors) in instances of generic units. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb (Null_Exclusion_Static_Checks, Selected_Range_Checks): Fix style.diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb

[Ada] Refactor repeated implicit conversion from Char_Code to Uint

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
When resolving a string literal we examine each character against low and high bounds of the expected type. We stored each character as an Int and implicitly converted it to Uint twice: for "<" and ">" operators. Now we store convert it to Uint explicitly and only once. Cleanup related to handling

[Ada] Simplify type conversions in source pointer arithmetic

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; semantics is unaffacted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_String_Literal): Simplify pointer arithmetic.diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -117

[Ada] Fix style in comments about warning messages

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of messages for compile-time known constraint errors. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.adb (Error_Msg_Internal): Reorder words. * erroutc.ads (Is_Warning_Msg): Add closing paren. * sem_util.adb (Compile_Time_C

[Ada] Remove unreferenced Warn_On_Instance

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of -gnatwE (warnings-as-errors) in instances of generic units. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * err_vars.ads (Warn_On_Instance): Remove; it was a relic from the previous handling of warning in instances that was removed

[Ada] Fix regression in freezing code for instantiations

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
When going to the outer level for the placement of a freeze node in the case where the current package has no body, the previous change would overlook instantiations whose body has not materialized yet. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Insert_Fre

[Ada] Remove unnecessary guards for non-empty lists

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
All node lists can be safely iterated with First/Present/Next. There is no need for explicit guard against empty lists. Code cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.adb (Remove_Warning_Messages): Remove unnecessary guard. * exp_util.adb (Kill_

[Ada] Move messages on division by zero to the right operand

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
All compile-time messages about division by zero are now located at the right operand. Previously some of them were located at the division operator, which was inconsistent. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_eval.adb (Eval_Arithmetic_Op): Add Loc parameter

[Ada] Remove a locally handled exception

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to handling of warnings-as-errors. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_Concatenate): There is no reason for using declaring, raising and catching an exception; a simple return state

[Ada] Simplify traversal for removing warnings from dead code

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of warnings-as-errors. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.adb (Remove_Warning_Messages): Use traversal procedure instead of traversal function, since we discard status of each step anywa

[Ada] Proof of System.Generic_Array_Operations at silver level

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Proof of the generic unit to array operations (vector/matrix), only at silver level, for runtime errors that come from the generic part of the unit. This does not prove e.g. absence of overflows in an instantiation related to arithmetic operations passed as formal generic subprogram parameters. Ju

[Ada] Remove unnecessary declare block

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to handling of warnings-as-errors. Semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.adb (Adjust_Name_Case): Remove unnecessary declare block.diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb --- a/gcc/ada/errout.

[Ada] Warn on subtype declaration of null range

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds a warning on a subtype declaration with a compile-time-known range constraint that is a null range. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_Range): Warn on null range, unless we are inside a generic unit or an instance the

Re: [PATCH] [i386] Optimize V16HF vector insert to element 0 for AVX2.

2022-01-06 Thread Uros Bizjak via Gcc-patches
On Thu, Jan 6, 2022 at 10:22 AM liuhongt via Gcc-patches wrote: > > Also remove mode attribute blendsuf, use ssemodesuf instead. > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ready to push to trunk. > > gcc/ChangeLog: > > PR target/103753 > * config/i386/i386-expand

Re: [PATCH] libgomp, OpenMP, nvptx: Low-latency memory allocator

2022-01-06 Thread Tom de Vries via Gcc-patches
On 1/6/22 10:29, Tom de Vries wrote: At first glance, the above behaviour doesn't look like a too short timeout. Using patch below, this passes for me, I'm currently doing a full build and test to confirm. Looks like it has to do with: ... For sm_6x and earlier architectures, atom operations

Re: [PATCH v4 04/12] LoongArch Port: Machine Decsription files.

2022-01-06 Thread Xi Ruoyao via Gcc-patches
On Fri, 2021-12-24 at 17:28 +0800, chenglulu wrote: > +(define_insn "*zero_extendsidi2_internal" > +  [(set (match_operand:DI 0 "register_operand" "=r,r,r") > +   (subreg:DI (match_operand:SI 1 "nonimmediate_operand" "r,ZC,W") 0))] > +  "TARGET_64BIT" > +  "@ > +   bstrpick.d\t%0,%1,31,0 > +  

[PATCH] x86_64: Improve (interunit) moves from TImode to V1TImode.

2022-01-06 Thread Roger Sayle
This patch improves the code generated when moving a 128-bit value in TImode, represented by two 64-bit registers, to V1TImode, which is a single SSE register. Currently, the simple move: typedef unsigned __int128 uv1ti __attribute__ ((__vector_size__ (16))); uv1ti foo(__int128 x) { retu

[PATCH] libgcc: Fix a broken call/return address prediction

2022-01-06 Thread Zhiyao Ma via Gcc-patches
This patch fixed a broken call/return address prediction in segmented stack implementation on x86_64 by leveraging the red-zone under the stack pointer. 2022-01-06 Zhiyao Ma libgcc/ChangeLog: * config/i386/morestack.S: Modified instructions. --- libgcc/config/i386/morestack.S

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-06 Thread Patrick Palka via Gcc-patches
On Mon, 3 Jan 2022, Patrick Palka wrote: > On Wed, 22 Dec 2021, Jason Merrill wrote: > > > On 12/21/21 14:08, Patrick Palka wrote: > > > On Tue, Dec 21, 2021 at 2:03 PM Patrick Palka wrote: > > > > > > > > On Wed, Jun 30, 2021 at 4:23 PM Jason Merrill wrote: > > > > > > > > > > On 6/30/21 4:1

[PATCH] x86: Rename -harden-sls=indirect-branch to -harden-sls=indirect-jmp

2022-01-06 Thread H.J. Lu via Gcc-patches
Indirect branch also includes indirect call instructions. Rename -harden-sls=indirect-branch to -harden-sls=indirect-jmp to match its intended behavior. PR target/102952 * config/i386/i386-opts.h (harden_sls): Replace harden_sls_indirect_branch with harden_sls_indirect_jmp

[PATCH] x86: Generate INT3 for __builtin_eh_return

2022-01-06 Thread H.J. Lu via Gcc-patches
Generate INT3 after indirect jmp in exception return for -fcf-protection with -mharden-sls=indirect-jmp. gcc/ PR target/103925 * config/i386/i386.c (ix86_output_indirect_function_return): Generate INT3 after indirect jmp for -mharden-sls=indirect-jmp. gcc/testsuite/

Re: [PATCH 1b/6] Add __attribute__((untrusted))

2022-01-06 Thread Martin Sebor via Gcc-patches
On 1/6/22 8:10 AM, David Malcolm wrote: On Thu, 2021-12-09 at 15:54 -0700, Martin Sebor wrote: On 11/13/21 1:37 PM, David Malcolm via Gcc-patches wrote: This patch adds a new:    __attribute__((untrusted)) for use by the C front-end, intended for use by the Linux kernel for use with "__user"

[PATCH] i386: Improve HImode interunit moves

2022-01-06 Thread Uros Bizjak via Gcc-patches
Currently, the compiler moves HImode values between GPR and XMM registers with: %vpinsrw\t{$0, %k1, %d0|%d0, %k1, 0} %vpextrw\t{$0, %1, %k0|%k0, %1, 0} but it could use slightly faster and shorter: %vmovd\t{%k1, %0|%0, %k1} %vmovd\t{%1, %k0|%k0, %1} 2022-01-06 Uroš Bizjak gc

Re: [PATCH] x86: Rename -harden-sls=indirect-branch to -harden-sls=indirect-jmp

2022-01-06 Thread Uros Bizjak via Gcc-patches
On Thu, Jan 6, 2022 at 7:57 PM H.J. Lu wrote: > > Indirect branch also includes indirect call instructions. Rename > -harden-sls=indirect-branch to -harden-sls=indirect-jmp to match its > intended behavior. > > PR target/102952 > * config/i386/i386-opts.h (harden_sls): Replace >

Re: [PATCH] x86: Generate INT3 for __builtin_eh_return

2022-01-06 Thread Uros Bizjak via Gcc-patches
On Thu, Jan 6, 2022 at 7:58 PM H.J. Lu wrote: > > Generate INT3 after indirect jmp in exception return for -fcf-protection > with -mharden-sls=indirect-jmp. > > gcc/ > > PR target/103925 > * config/i386/i386.c (ix86_output_indirect_function_return): > Generate INT3 after in

Go patch committed: Permit unnamed types when ignoring struct tags

2022-01-06 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend permits converting unnamed types when ignoring struct tags. I think the code was written this way because before conversion could ignore struct tags this case could only arise with named types. Now that conversions permit struct tags to change, this can occur with un

Re: [PATCH] Fortran: Fix ICE in argument_rank_mismatch [PR103287]

2022-01-06 Thread Harald Anlauf via Gcc-patches
Am 05.01.22 um 22:34 schrieb Sandra Loosemore: One of my previous TS29113-related patches from last fall introduced an ICE due to a bogus assertion.  This is the fix Steve suggested in the issue, bundled with the test cases, regression-tested, etc.  OK to check in? OK. -Sandra Thanks, Haral

Re: [PATCH] PR fortran/103777 - ICE in gfc_simplify_maskl, at fortran/simplify.c:4918

2022-01-06 Thread Harald Anlauf via Gcc-patches
Hi Mikael, Am 21.12.21 um 13:38 schrieb Mikael Morin: Le 20/12/2021 à 23:05, Harald Anlauf via Fortran a écrit : Dear all, we need to check the arguments of the elemental MASKL and MASKR intrinsics also before simplifying. Testcase by Gerhard.  The fix is almost obvious, but I'm happy to get

Re: [power-ieee128] RFH: LTO broken

2022-01-06 Thread Thomas Koenig via Gcc-patches
On 06.01.22 06:00, Michael Meissner via Fortran wrote: I pushed the patch to the branch. Test results are looking quite good right now. What is still missing is the conversion for unformatted I/O, both ways. I'll start doing some stuff on it. Just one question: What are functions that I can

Re: [power-ieee128] RFH: LTO broken

2022-01-06 Thread Jakub Jelinek via Gcc-patches
On Thu, Jan 06, 2022 at 09:01:54PM +0100, Thomas Koenig wrote: > On 06.01.22 06:00, Michael Meissner via Fortran wrote: > > I pushed the patch to the branch. > > Test results are looking quite good right now. > > What is still missing is the conversion for unformatted I/O, both > ways. I'll star

[PATCH] Fortran: Fix handling of optional argument to SIZE intrinsic [PR103898]

2022-01-06 Thread Sandra Loosemore
This patch fixes an ICE introduced with the recent-ish rewrite to inline the SIZE intrinsic, using a helper function to do the bulk of the work in producing the expansion. It turns out to be a simple think-o type mistake in the wrapper around the helper rather than anything deeply wrong with t

Re: [PATCH] Fortran: Fix handling of optional argument to SIZE intrinsic [PR103898]

2022-01-06 Thread Harald Anlauf via Gcc-patches
Hi Sandra, Am 06.01.22 um 21:11 schrieb Sandra Loosemore: This patch fixes an ICE introduced with the recent-ish rewrite to inline the SIZE intrinsic, using a helper function to do the bulk of the work in producing the expansion.  It turns out to be a simple think-o type mistake in the wrapper a

Re: [PATCH] PR fortran/103777 - ICE in gfc_simplify_maskl, at fortran/simplify.c:4918

2022-01-06 Thread Mikael Morin
Le 06/01/2022 à 20:50, Harald Anlauf a écrit : Did you find the time to try your version? Not yet. But I have not (yet) forgotten about this.

[wwwdocs] Update C++ DR table

2022-01-06 Thread Marek Polacek via Gcc-patches
A new batch of DRs. Pushed. commit ecbd709b2ecb1e3c35fa4ede09bcb7ceb443def6 Author: Marek Polacek Date: Thu Jan 6 17:06:24 2022 -0500 Update C++ DR table diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index e8002b27..cc2afc03 100644 --- a/htdocs/pro

[PATCH take #3] Recognize MULT_HIGHPART_EXPR in tree-ssa-math-opts pass.

2022-01-06 Thread Roger Sayle
This is the third iteration of a patch to perceive MULT_HIGHPART_EXPR in the middle-end. As they say "the third time's a charm". The first version implemented this in match.pd, which was considered too early. https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551316.html The second version at

[PATCH] rs6000: More factoring of overload processing

2022-01-06 Thread Bill Schmidt via Gcc-patches
Hi! This patch continues the refactoring started with r12-6014. I had previously noted that the resolve_vec* routines can be further simplified by processing the argument list earlier, so that all routines can use the arrays of arguments and types. I found that this was useful for some of the ro

[committed] analyzer: make use of may_be_aliased in alias detection [PR103546]

2022-01-06 Thread David Malcolm via Gcc-patches
Whilst debugging PR analyzer/103546 (false +ve in flex-generated lexers) I noticed that the analyzer was considering that writes through symbolic pointers could be treated as clobbering static globals such as: static YY_BUFFER_STATE * yy_buffer_stack = NULL; even for such variables that never

[PATCH 1/1] [PATCH] Fix canadian compile for mingw-w64 copies the wrong dlls for mingw-w64 multilibs [PR100427]

2022-01-06 Thread cqwrteur via Gcc-patches
When building GCC hosted on windows with Canadian/native compilation (host==target), the build scripts in GCC would override DLLs with each other. For example, for MinGW-w64, 32-bit DLLs would override 64 bits because build scripts copy them both to /bin. This patch fixes the issue by avoiding

[pushed 01/11] c++: don't preevaluate new-initializer

2022-01-06 Thread Jason Merrill via Gcc-patches
Here begins a series of EH cleanup bugfixes. The preevaluation code was causing trouble with my fix for PR94041, and now I see that it's actually wrong since P0145 was adopted for C++17, mandating order of evaluation for many expressions that were previously unspecified. I don't see a need to pres

[pushed 02/11] c++: loop over array elts w/o explicit init [PR92385]

2022-01-06 Thread Jason Merrill via Gcc-patches
The PR complains that initializing a large array with {} takes a long time to compile; this was because digest_init would turn {} into a long CONSTRUCTOR with an initializer for each element, instead of more sensibly generating a loop. The standard doesn't specify this implementation, but it does

[pushed 03/11] c++: temporary lifetime with aggregate init [PR94041]

2022-01-06 Thread Jason Merrill via Gcc-patches
In C++98 the lifetime of temporaries in aggregate initialization was unclear, but C++11 DR201 clarified that only temporaries created for default-initialization of an array element with no corresponding initializer-clause are destroyed immediately; all others persist until the end of the full-expre

  1   2   >