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

2022-01-05 Thread liuhongt via Gcc-patches
> 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 and inner not to be NULL. So I add some conditions to check

Re: [power-ieee128] RFH: LTO broken

2022-01-05 Thread Michael Meissner via Gcc-patches
On Tue, Jan 04, 2022 at 12:07:49PM +0100, Jakub Jelinek wrote: > On Mon, Jan 03, 2022 at 11:43:57PM +0100, Thomas Koenig wrote: > > > clearly there is still work to fix (but seems e.g. most of the lto tests > > > are related to the gnu attributes stuff:( ). > > > > This is looking better than

Re: [power-ieee128] RFH: LTO broken

2022-01-05 Thread Michael Meissner via Gcc-patches
On Tue, Jan 04, 2022 at 12:07:49PM +0100, Jakub Jelinek wrote: > On Mon, Jan 03, 2022 at 11:43:57PM +0100, Thomas Koenig wrote: > > > clearly there is still work to fix (but seems e.g. most of the lto tests > > > are related to the gnu attributes stuff:( ). > > > > This is looking better than

Re: [PATCH] target: [PR102941] Fix inline-asm flags with non-REG_P output

2022-01-05 Thread Andrew Pinski via Gcc-patches
On Thu, Dec 2, 2021 at 2:16 PM Andrew Pinski wrote: > > On Tue, Oct 26, 2021 at 2:45 AM apinski--- via Gcc-patches > wrote: > > > > From: Andrew Pinski > > > > So the problem here is that arm_md_asm_adjust would > > just create a set directly to the output memory which is wrong. > > It needs to

Re: [power-ieee128] RFH: LTO broken

2022-01-05 Thread Michael Meissner via Gcc-patches
On Tue, Jan 04, 2022 at 12:07:49PM +0100, Jakub Jelinek wrote: > On Mon, Jan 03, 2022 at 11:43:57PM +0100, Thomas Koenig wrote: > > > clearly there is still work to fix (but seems e.g. most of the lto tests > > > are related to the gnu attributes stuff:( ). > > > > This is looking better than

Re: [PATCH] Avoid more -Wformat-diag warnings [PR103758]

2022-01-05 Thread Joseph Myers
On Wed, 5 Jan 2022, Marek Polacek via Gcc-patches wrote: > Let's use "%, %, or %" rather than "[x|y|z]" as in the rest of > our codebase. > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/11? OK. -- Joseph S. Myers jos...@codesourcery.com

[PATCH] Avoid more -Wformat-diag warnings [PR103758]

2022-01-05 Thread Marek Polacek via Gcc-patches
Let's use "%, %, or %" rather than "[x|y|z]" as in the rest of our codebase. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/11? PR c++/103758 gcc/c-family/ChangeLog: * c-pragma.c (handle_pragma_scalar_storage_order): Use %< %> in diagnostic messages.

[PATCH] Fix target/103910: missing GTY on x86_mfence causing PCH usage to ICE

2022-01-05 Thread apinski--- via Gcc-patches
From: Andrew Pinski With -O3 -march=opteron, a mfence builtin is added after the loop to say the nontemporal stores are no longer needed. This all good without precompiled headers as the function decl that is referneced by x86_mfence is referenced in another variable but with precompiled

Re: [power-ieee128] libquadmath: Use -mno-gnu-attribute in libquadmath

2022-01-05 Thread Michael Meissner via Gcc-patches
On Mon, Jan 03, 2022 at 04:24:50PM +0100, Jakub Jelinek wrote: > Hi! > > Testing found that we also need libquadmath to be built with > -mno-gnu-attribute, otherwise -mabi=ieeelongdouble programs don't link. > > Ok for power-ieee128? > > 2022-01-03 Jakub Jelinek > > * configure.ac:

[PATCH] i386: Introduce V2QImode minmax, abs and uavgv2hi3_ceil [PR103861]

2022-01-05 Thread Uros Bizjak via Gcc-patches
Add V2QImode minmax, abs and uavxv2qi3_ceil operations with SSE registers. 2022-01-05 Uroš Bizjak gcc/ChangeLog: PR target/103861 * config/i386/mmx.md (VI_16_32): New mode iterator. (VI1_16_32): Ditto. (mmxvecsize): Handle V2QI mode. (3): Rename from v4qi3. Use

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

2022-01-05 Thread 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? -Sandra commit beaae3933ef62e4d52ec22c14a308295c0794683 Author: Sandra

Re: [PATCH][hooks-bin] Port email_to.py to Python3.

2022-01-05 Thread Joseph Myers
On Wed, 5 Jan 2022, Martin Liška wrote: > Please install it, apparently I can't push commits there: Done. -- Joseph S. Myers jos...@codesourcery.com

Re: [PATCH] rs6000: Skip overload instances with uninitialized fntype (PR103622)

2022-01-05 Thread Segher Boessenkool
Happy new year Bill! On Mon, Dec 13, 2021 at 10:15:46AM -0600, Bill Schmidt wrote: > For some data types like IEEE-128, we determine whether the type is available > at built-in function initialization time. If it's not, then we don't provide > the function type for function instances that

Re: [PATCH] enable -Winvalid-memory-order for C++ [PR99612]

2022-01-05 Thread Martin Sebor via Gcc-patches
On 1/5/22 1:45 AM, Martin Liška wrote: On 12/8/21 17:49, Martin Sebor via Gcc-patches wrote: Even with -Wno-system-headers enabled, the -Winvalid-memory-order code tries to make sure calls to atomic functions with invalid memory orders are diagnosed even though the C atomic functions are

[PATCH] tree-optimization/103514 Missing XOR-EQ-AND Optimization

2022-01-05 Thread Navid Rahimi via Gcc-patches
Hi GCC community, This patch will add the missed pattern described in bug 103514 [1] to the match.pd. [1] includes proof of correctness for the patch too. PR tree-optimization/103514 * match.pd (a & b) ^ (a == b) -> !(a | b): New optimization. * match.pd (a & b) == (a ^ b) ->

Re: [PATCH] rs6000: Skip overload instances with uninitialized fntype (PR103622)

2022-01-05 Thread Bill Schmidt via Gcc-patches
Hi!  I'd like to ping this patch, now that I'm back from break. Thanks! Bill On 12/13/21 10:15 AM, Bill Schmidt wrote: > Hi! > > For some data types like IEEE-128, we determine whether the type is available > at built-in function initialization time. If it's not, then we don't provide > the

[PATCH] i386: Fix type of one_cmplv2qi2 alternatives 1,2 [PR103915]

2022-01-05 Thread Uros Bizjak via Gcc-patches
2022-01-05 Uroš Bizjak gcc/ChangeLog: PR target/103915 * config/i386/mmx.md (one_cmplv2qi2): Change alternatives 1,2 type from sselog to sselog1. gcc/testsuite/ChangeLog: PR target/103915 * gcc.target/i386/pr103915.c: New test. Bootstrapped and regression tested on

[PATCH] i386: Fix expand_vec_perm_pshufb for narrow modes [PR103905]

2022-01-05 Thread Uros Bizjak via Gcc-patches
2022-01-05 Uroš Bizjak gcc/ChangeLog: PR target/103905 * config/i386/i386-expand.c (expand_vec_perm_pshufb): Fix number of narrow mode remapped elements for !one_operand_p case. gcc/testsuite/ChangeLog: PR target/103905 * gcc.target/i386/pr103905.c: New test.

Re: [PATCH] Register --sysroot in the driver switches table

2022-01-05 Thread Olivier Hainque via Gcc-patches
> On 5 Jan 2022, at 10:26, Olivier Hainque wrote: > > The change should also set "validated" true > when requesting to save --sysroot. The attached adjustment fixes the failure I could reproduce, bootstraps and regtests fine on x86_64-linux, and passes a build + a couple of in-house

Re: [PATCH] middle-end/101530 - fix shufflevector lowering

2022-01-05 Thread Jeff Law via Gcc-patches
On 1/5/2022 7:17 AM, Richard Biener via Gcc-patches wrote: This makes __builtin_shufflevector lowering force the result of the BIT_FIELD_REF lowpart operation to a temporary as to fulfil the IL verifier constraint that BIT_FIELD_REFs should be always in outermost handled component position.

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

2022-01-05 Thread Jeff Law via Gcc-patches
On 1/5/2022 4:06 AM, Martin Liška wrote: The patch is about small refactoring of the plugin. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin include/ChangeLog: * plugin-api.h (enum ld_plugin_tag): Do not set implicit enum    

Re: [PATCH][Hashtable 6/6] PR 68303 small size optimization

2022-01-05 Thread Jonathan Wakely via Gcc-patches
On Sat, 25 Dec 2021 at 21:39, François Dumont wrote: > On 23/12/21 2:03 pm, Jonathan Wakely wrote: > > On 21/12/21 07:07 +0100, François Dumont wrote: > >> Hi > >> > >> ??? Is there a chance for this patch to be integrated for next gcc > >> release ? > > > > Yes, I think this can still make it

Re: [PATCH] libgomp, openmp: pinned memory

2022-01-05 Thread Andrew Stubbs
On 04/01/2022 18:47, Jakub Jelinek wrote: On Tue, Jan 04, 2022 at 07:28:29PM +0100, Jakub Jelinek via Gcc-patches wrote: Other issues in the patch are that it doesn't munlock on deallocation and that because of that deallocation we need to figure out what to do on page boundaries. As

Re: [Patch][V2]Enable -Wuninitialized + -ftrivial-auto-var-init for address taken variables

2022-01-05 Thread Qing Zhao via Gcc-patches
Hi, Richard, Thanks a lot for the review and questions. See my reply embedded below: > On Jan 5, 2022, at 4:33 AM, Richard Biener wrote: > > On Thu, Dec 16, 2021 at 5:00 PM Qing Zhao wrote: >> >> Hi, >> >> This is the 2nd version of the patch. >> The original patch is at: >> >>

[committed] libstdc++: Fix overconstrained std::string constructor [PR103919]

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. The C++17 basic_string(const T&, size_t, size_t) constructor is overconstrained, so it can't be used for a NTBS and a temporary string gets constructed (potentially allocating memory). There is no corresponding constructor taking an NTBS, so no need to

[committed] libstdc++: Implement P1328 "Making std::type_info::operator== constexpr"

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This feature is present in the C++23 draft. With Jakub's recent front-end changes we can implement constexpr equality by comparing the addresses of std::type_info objects. We do not need string comparisons, because for constant evaluation cases we know

[committed] libstdc++: Improvements to standard error category objects (part deux)

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. In r12-3860 the error categories in were made final and immortal, but I missed the categories for and . This makes the same changes to those. libstdc++-v3/ChangeLog: * src/c++11/cxx11-ios_failure.cc (io_error_category): Define class

[committed] libstdc++: Fix std::error_code pretty printer for versioned namespace

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Strip versioned namespace from the type name that is printed. --- libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +- 1 file changed, 1 insertion(+), 1

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

2022-01-05 Thread Andrew Stubbs
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/testsuite/libgomp.c/allocators-1.c:7:22:

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

2022-01-05 Thread Andrew Stubbs
On 05/01/2022 11:08, Tom de Vries wrote: The alloc-7.c execution test failure is a regression, AFAICT.  It fails here: ... 38    if uintptr_t) p) % __alignof (int)) != 0 || p[0] || p[1] || p[2]) 39  abort (); ... because: ... (gdb) p p[0] $2 = 772014104 (gdb) p p[1] $3 = 0

[PATCH] middle-end/101530 - fix shufflevector lowering

2022-01-05 Thread Richard Biener via Gcc-patches
This makes __builtin_shufflevector lowering force the result of the BIT_FIELD_REF lowpart operation to a temporary as to fulfil the IL verifier constraint that BIT_FIELD_REFs should be always in outermost handled component position. Trying to enforce this during gimplification isn't as

Re: [PATCH v4 00/12] Add LoongArch support.

2022-01-05 Thread Paul Hua via Gcc-patches
Hi all, Ping? By the way, the LoongArch machine is already connected to the Cfarm and will be announced soon. You can login through ssh. ssh -l your-cfarm-user-name -p 25469 114.242.206.180 On Fri, Dec 24, 2021 at 5:28 PM chenglulu wrote: > > The LoongArch architecture (LoongArch) is an

[committed] libstdc++: Add pretty printer for std::regex internals

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This helps visualize the NFA states in a std::regex. It probably isn't very useful for users, but helps when working on the implementation. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdRegexStatePrinter): New printer

[committed] libstdc++: Fix comments in std::forward_list tests

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. libstdc++-v3/ChangeLog: * testsuite/23_containers/forward_list/operations/1.cc: Fill in placeholders in comments. * testsuite/23_containers/forward_list/operations/2.cc: Likewise. *

[committed] libstdc++: Avoid -Wzero-as-null-pointer-constant warning [PR103848]

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. libstdc++-v3/ChangeLog: PR libstdc++/103848 * include/bits/stl_deque.h (operator-): Do not use 0 as null pointer constant. --- libstdc++-v3/include/bits/stl_deque.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[committed] libstdc++: Simplify std::allocator_traits>::construct

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. We don't need a preprocessor condition to decide whether to use placement new or std::construct_at, because std::_Construct already does that. libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocator_traits>): Use

[committed] libstdc++: Fix example preprocessor command in FAQ [PR103877]

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. libstdc++-v3/ChangeLog: PR libstdc++/103877 * doc/xml/faq.xml: Add '-x c++' to preprocessor command. * doc/html/faq.html: Regenerate. --- libstdc++-v3/doc/html/faq.html | 2 +- libstdc++-v3/doc/xml/faq.xml | 2 +- 2 files

[committed] libstdc++: Reduce template instantiations in

2022-01-05 Thread Jonathan Wakely via Gcc-patches
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. Most of the function (and what it instantiates) is the same

[committed] libstdc++: Compare match_results for failed regex_match

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. The regex_match_debug testsuite helper doesn't compare the std::match_results objects after a failed match, but it should do. The standard says that the effects of a failed match on the match-results are unspecified, except that [conditions testable by

[committed] libstdc++: Improve std::regex_error::what() strings

2022-01-05 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This replaces the vague "regex_error" for std::regex_error::what() with a string that corresponds to the error_type enum passed to the constructor. This allows us to remove many of the strings passed to __throw_regex_error, because the default string is

[PATCH 2/N] Enable migration to C++.

2022-01-05 Thread Martin Liška
Hi. The second patch brings us closer to C++. I used some libiberty macros and changed signed/unsigned integer types. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, MartinFrom 17de4d675005368d7e69615da22cd405542c4fe1 Mon Sep 17 00:00:00

[PATCH] middle-end/77608: object size estimate with variable offsets

2022-01-05 Thread Siddhesh Poyarekar
This partially fixes middle-end/77608 by making __builtin_object_size return the whole object size instead of bailing out in case the offset in the object is variable and the maximum estimate is requested. gcc/ChangeLog: PR middle-end/77608 * tree-object-size.c (size_for_offset):

Re: DCO entry

2022-01-05 Thread Martin Liška
On 1/5/22 13:07, Nathan Sidwell wrote: I have some patches that I cannot in good conscience keep secret. Welcome back Nathan! About the sorting, it seems all other names lists in the file are sorted by surname. Your patch changes that to sort by first name, do we really want the change?

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

2022-01-05 Thread Tom de Vries via Gcc-patches
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/testsuite/libgomp.c/allocators-1.c:7:22: sorry, unimplemented: '    ' clause on

Re: [PATCH] nvptx: bump default to PTX 4.1

2022-01-05 Thread Tom de Vries via Gcc-patches
On 1/5/22 11:33, Andrew Stubbs wrote: On 05/01/2022 10:24, Tom de Vries wrote: On 12/21/21 12:33, Andrew Stubbs wrote: On 20/12/2021 15:58, Andrew Stubbs wrote: In order to support the %dynamic_smem_size PTX feature is is necessary to bump the minimum supported PTX version from 3.1 (~2013)

Re: [PATCH] Fortran: Fix ICE caused by missing error for untyped symbol [PR103258]

2022-01-05 Thread Paul Richard Thomas via Gcc-patches
Hi Sandra, That's a good shout to query suppress_errors. The patch is OK by me. Thanks Paul On Wed, 5 Jan 2022 at 03:21, Sandra Loosemore wrote: > This patch fixes an ICE that appeared after I checked in my patch for > PR101337 back in November, which made the resolve phase try harder to >

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

2022-01-05 Thread Richard Biener via Gcc-patches
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 comments below (and the

Fix PR97966 regression

2022-01-05 Thread Nathan Sidwell
Marek's fix for PR97966 caused a regression with (non-template) member functions of template classes. We need to mark them used in the instantiated class's scope, rather than the scope we were in before instantiating, as the latter may itself be in template and change the behaviour of marking a

Fix diagnostic recursion ICE

2022-01-05 Thread Nathan Sidwell
The diagnostic machinery uses template instantiation when generating the [with T = ...] text. In this case that caused an alignment warning to be emitted with a subsequent recursion ICE. pushed to trunk nathan -- Nathan SidwellFrom f2da9e26f5c0f04d48872938eff130e2028e75d3 Mon Sep 17

DCO entry

2022-01-05 Thread Nathan Sidwell
I have some patches that I cannot in good conscience keep secret. nathan -- Nathan SidwellFrom 77e71619532c7cd27e907bb22af157b8e56dca58 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 4 Jan 2022 12:41:25 -0800 Subject: [PATCH 1/3] DCO Entry * MAINTAINERS: Add DCO entry. Sort that

Re: [PATCH] Support ld.mold linker.

2022-01-05 Thread Martin Liška
On 1/4/22 08:23, Richard Biener wrote: Since we have a fixed set of supported linkers and we know their implementation status with respect to linker plugin support we can maybe auto-add -fno-use-linker-plugin (via specs?) when -fuse-ld=lld or -fuse-ld=mold is used? Well, if I'm correct, we do

[Ada] Improve support for casing on types with controlled parts

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
INOX allows casing on composite values. In some cases of bindings for subcomponents, the compiler introduced copying which led to compiler failures associated with finalizing those copies. In such cases a bound object now provides a constant view of the appropriate subcomponent of the selector

[Ada] Simplify detection of alphabetic characters with membership test

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup originating from enabling expansion of dispatching wrappers for GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Adjust_External_Name_Case): Use membership test.diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb

[Ada] Expand controlling function wrapper into expression function

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
GNATprove prefers various internally generated functions to be expression functions, because then it will use the expression itself as an implicit postcondition. The same applies to wrappers for dispatching functions with controlling results. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Expand controlling functions wrappers in GNATprove mode

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Enable expansion of wrappers for dispatching functions with controlling results in GNATprove mode. Without those wrappers the AST for calls to dispatching functions on parent and child objects is exactly the same and the GNATprove backend can't determine what function is actually called. Tested

[Ada] Use Add_Char_To_Name_Buffer for 1-character strings

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Adding a single character to name buffer should be (marginally) more efficient with Add_Char_To_Name_Buffer and not Add_Str_To_Name_Buffer. Even if not more efficient, it should be still more readable. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_dbug.adb,

[Ada] Simplify calls to Name_Find with known string parameter

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gnatls.adb (Gnatls): Use Name_Find function. * targparm.adb (Get_Target_Parameters): Likewise.diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb --- a/gcc/ada/gnatls.adb +++

[Ada] Compiler crash with -gnatR2 and with of child

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes a bug where if a parent library package contains a with clause that mentions a child of that same parent package, then gnat can crash if the parent package is compiled with the -gnatR2 switch. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * repinfo.adb

[Ada] Remove obsolete s-sopco* and s-strops units

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
These units are not required anymore as oldest compiler version allowed for bootstrap does not need them. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-sopco3.ads, libgnat/s-sopco3.adb: Remove. * libgnat/s-sopco4.ads, libgnat/s-sopco4.adb: Remove.

[Ada] Remove extra whitespace in declarations and parameters lists

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Remove extra whitespace spotted while doing other cleanups related to expansion of dispatching routines for GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Build_Dcheck_Function): Remove extra whitespace. * libgnarl/s-taskin.adb

[Ada] Remove explicit "in" in internal parameter association

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to expansion of dispatching routines for GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb (Build_Array_VS_Func): Remove explicit "IN" in spec of the generated array validation function; it was redundant, just like

[Ada] Align arrows in parameter associations

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Whitespace cleanup; wrong layout found with grep. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Op_Ne): Fix whitespace. * sem_dim.adb (Expand_Put_Call_With_Symbol): Likewise. (Reduce): Likewise.diff --git a/gcc/ada/exp_ch4.adb

[Ada] Remove extra space in parameter associations

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Whitespace cleanup related to cleanup of creating copies of subprogram specifications, which was needed for expanding dispatching wrappers for GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Fix whitespace. *

[Ada] Fix layout of parameters in calls to Predef_Spec_Or_Body

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to expansion of dispatching routines for GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Make_Eq_Body, Make_Neq_Body, Make_Predefined_Primitive_Eq_Spec, Make_Predefined_Primitive_Specs): Fix whitespace.diff --git

[Ada] Fix condition to build subtype for discriminated types

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
We should build subtype for discriminated types in several situations where we know a priori that we never need to allocate the max possible size. To factorize these conditions between `Analyze_Component_Declaration` and `Analyze_Object_Declaration`, the function `Should_Build_Subtypes` is

[Ada] Add contracts for the proof of System.Arith_128

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Similar to the contracts added for the 32bits and 64bits versions, add corresponding contracts for the 128bits version. Proof is currently too difficult for this instance of generic System.Arith_Double, as even with a huge prover timeout of 15 minutes, 2 checks remain unproved. Tested on

[Ada] Simplify handling of user-defined numeric literals

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (String_From_Numeric_Literal): Simplify using membership tests and ranges; fix whitespace.diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb ---

[Ada] Proof of runtime units for integer exponentiation (checks on)

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the generic unit System.Expont instantiated for Integer, Long_Long_Integer and Long_Long_Long_Integer. The proof is similar to the one done for the same units with checks off. In this case too, the generic function is changed into a generic package. GNATprove is called with switch

[Ada] Remove unnecessary check for missing parameter specifications

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
List iteration with First/Present/Next is safe even for No_List. This safety is intentional and we rely on it in many places. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_disp.adb (Gen_Parameters_Profile): Remove redundant

[Ada] Introduce expression functions for contract of Scan_Exponent

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Introduce expression functions to make the contract of Scan_Exponent more readable. They can be reused in the contracts of scan functions for scalar types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-valuti.ads (Starts_As_Exponent_Format_Ghost): Ghost

[Ada] Prevent Get_Current_Value_Condition from returning the same node

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Get_Current_Value_Condition should never return Val = Var, because that could cause infinite recursion in Known_Null. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.ads (Get_Current_Value_Condition): Belt: Add a postcondition that Val /= Var. *

[Ada] Simplify making of null procedure wrappers

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Yet another cleanup related to expansion of dispatching primitives for GNATprove. To keep this change semantically neutral, one parameter is added to the Copy_Subprogram_Spec utility routine. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb

[Ada] Proof of runtime units for integer exponentiation (checks off)

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the generic unit System.Exponn instanciated for Integer, Long_Long_Integer and Long_Long_Long_Integer. In order to be able to add a suitable contract to the generic function, it is changed into a generic package which contains the function. Instantiations are adapted. GNATprove is

[Ada] Remove redundant code related to instances with formal subprograms

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to expansion of dispatching wrappers for GNATprove, which just like instantiation involves copying of a specification from an existing subprogram. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Instantiate_Formal_Subprogram): Remove redundant

[Ada] Fix sharing of formal parameters between wrapper spec and body

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
When creating wrappers for dispatching functions with controlling results, we first created the wrapper spec. Then we created a shallow copy of its specification for the wrapper body using New_Copy_Tree. However, formal parameters in spec and body must have distinct entities and New_Copy_Tree

[Ada] Renamed_Entity should return Entity_Id

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
This patch is minor cleanup. The Renamed_Entity and Alias synthesized attributes are of type Entity_Id. No change in behavior. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo-utils.ads, einfo-utils.adb (Renamed_Entity Alias): Change Node_Id to Entity_Id.diff

[Ada] Deconstruct dead wrappers added for external axiomatization

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Support for external axiomatization in GNATprove has been deconstructed few years ago, so the related frontend code can be deconstructed too. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.ads (Build_Function_Wrapper, Build_Operator_Wrapper): Remove

[Ada] Rename parameter-dependent constants in generic unit

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Constant names of Big2xx32, Big2xx63 and Big2xx64 were misleading, as SIngle_Size and Double_Size need not be 32 and 64. Replace by names that don't refer to an explicit size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb: Apply replacement.

[Ada] Remove Compiler_Unit[_Warning] pragmas

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
Updated base requirement on GNAT version and the fact that stage1 of the bootstrap now uses the base compiler's libgnat allows for more Ada features in the runtime and makes these pragma obsolete. Added comments in files that are still built during stage1 and that need to be modified with care

[Ada] Fix lemma in generic unit System.Arith_Double

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
This system unit is instanciated with values of Single_Size either 32 or 64 currently. A lemma was only valid for value of 32, which became visible when proving the instance with value of 64. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb

[Ada] Reduce runtime dependencies on stage1

2022-01-05 Thread Pierre-Marie de Rodat via Gcc-patches
To simplify the bootstrap constraints, duplicate a few definitions in order to remove dependencies on a recent version of System.Case_Util, System.Crtl, System.OS_Lib. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * osint.adb (File_Names_Equal): Declare To_Lower locally.

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

2022-01-05 Thread Tom de Vries via Gcc-patches
On 12/20/21 16:58, Andrew Stubbs wrote: This patch is submitted now for review and so I can commit a backport it to the OG11 branch, but isn't suitable for mainline until stage 1. The patch implements support for omp_low_lat_mem_space and omp_low_lat_mem_alloc on NVPTX offload devices. The

[PATCH] LTO plugin: modernize a bit.

2022-01-05 Thread Martin Liška
The patch is about small refactoring of the plugin. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin include/ChangeLog: * plugin-api.h (enum ld_plugin_tag): Do not set implicit enum values. lto-plugin/ChangeLog:

[PATCH] tree-optimization/103816 - detect offset overflow in SLP group analysis

2022-01-05 Thread Richard Biener via Gcc-patches
This makes sure to detect overflow when computing DR_GROUP_GAP and DR_GROUP_SIZE more thoroughly so artificial testcases like the added one are not fooling the existing check. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-01-05 Richard Biener PR

Re: [Patch][V2]Enable -Wuninitialized + -ftrivial-auto-var-init for address taken variables

2022-01-05 Thread Richard Biener via Gcc-patches
On Thu, Dec 16, 2021 at 5:00 PM Qing Zhao wrote: > > Hi, > > This is the 2nd version of the patch. > The original patch is at: > > https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586341.html > > In addition to resolve the two issues mentioned in the original patch, > This patch also can

Re: [PATCH] nvptx: bump default to PTX 4.1

2022-01-05 Thread Andrew Stubbs
On 05/01/2022 10:24, Tom de Vries wrote: On 12/21/21 12:33, Andrew Stubbs wrote: On 20/12/2021 15:58, Andrew Stubbs wrote: In order to support the %dynamic_smem_size PTX feature is is necessary to bump the minimum supported PTX version from 3.1 (~2013) to 4.1 (~2014). Tobias has pointed

Re: [PATCH] nvptx: bump default to PTX 4.1

2022-01-05 Thread Tom de Vries via Gcc-patches
On 12/21/21 12:33, Andrew Stubbs wrote: On 20/12/2021 15:58, Andrew Stubbs wrote: In order to support the %dynamic_smem_size PTX feature is is necessary to bump the minimum supported PTX version from 3.1 (~2013) to 4.1 (~2014). Tobias has pointed out, privately, that the default version is

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

2022-01-05 Thread Richard Biener via Gcc-patches
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 (hopefully?) going to be simplified > > > > as (unsigned)X + 1

Re: [PATCH] ifcvt: Check for asm goto at the end of then_bb/else_bb in ifcvt [PR103908]

2022-01-05 Thread Richard Biener via Gcc-patches
On Wed, 5 Jan 2022, Jakub Jelinek wrote: > Hi! > > On the following testcase, RTL ifcvt sees then_bb > (note 7 6 8 3 [bb 3] NOTE_INSN_BASIC_BLOCK) > (insn 8 7 9 3 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2] 0x7fdccf5b0cf0 b>) [1 b+0 S4 A32]) > (const_int 1 [0x1])) "pr103908.c":6:7

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

2022-01-05 Thread Jakub Jelinek via Gcc-patches
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 (hopefully?) going to be simplified > > > as (unsigned)X + 1 <= 2, it might be good to simplify it this way > > > here as well? >

Re: [PATCH] gimple-fold: Remove incorrect folding of debug stmts [PR103691]

2022-01-05 Thread Richard Biener via Gcc-patches
On Wed, 5 Jan 2022, Jakub Jelinek wrote: > Hi! > > For ADDR_EXPR gimple_debug_bind_get_value fold_stmt_1 uses > maybe_canonicalize_mem_ref_addr earlier and I think that should > resolve the concerns raised in PR52329. But folding ADDR_EXPR > operand using maybe_fold_reference and then taking

[PATCH] ifcvt: Check for asm goto at the end of then_bb/else_bb in ifcvt [PR103908]

2022-01-05 Thread Jakub Jelinek via Gcc-patches
Hi! On the following testcase, RTL ifcvt sees then_bb (note 7 6 8 3 [bb 3] NOTE_INSN_BASIC_BLOCK) (insn 8 7 9 3 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2] ) [1 b+0 S4 A32]) (const_int 1 [0x1])) "pr103908.c":6:7 81 {*movsi_internal} (nil)) (jump_insn 9 8 13 3 (parallel [

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

2022-01-05 Thread Richard Biener via Gcc-patches
On Wed, Jan 5, 2022 at 10:18 AM Zhao Wei Liew wrote: > > > X >= -1 && X <= 1 is (hopefully?) going to be simplified > > as (unsigned)X + 1 <= 2, it might be good to simplify it this way > > here as well? > > Yup, GCC does simplify it that way in the end, so I didn't really bother to > simplify

Re: [PATCH] Register --sysroot in the driver switches table

2022-01-05 Thread Olivier Hainque via Gcc-patches
Hi Martin, > On 5 Jan 2022, at 08:45, Martin Liška wrote: > > On 12/20/21 22:28, Olivier Hainque via Gcc-patches wrote: > I think the patch broke my cross-rx-gcc12 package, failing now with: > configure: error: in >

[PATCH] gimple-fold: Remove incorrect folding of debug stmts [PR103691]

2022-01-05 Thread Jakub Jelinek via Gcc-patches
Hi! For ADDR_EXPR gimple_debug_bind_get_value fold_stmt_1 uses maybe_canonicalize_mem_ref_addr earlier and I think that should resolve the concerns raised in PR52329. But folding ADDR_EXPR operand using maybe_fold_reference and then taking address of that looks like an invalid transformation, it

Re: [committed] testsuite: Fix gcc.target/i386/pr103895.c testcase [PR103895]

2022-01-05 Thread Jakub Jelinek via Gcc-patches
On Wed, Jan 05, 2022 at 10:16:30AM +0100, Andreas Schwab wrote: > On Jan 05 2022, Jakub Jelinek via Gcc-patches wrote: > > > The testcase uses SSE and SSE2 intrinsics, so fails on i686-linux > > if -msse2 isn't enabled by default. Fixed by adding -msse2 to > > dg-options. > > Shouldn't that use

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

2022-01-05 Thread Zhao Wei Liew via Gcc-patches
> X >= -1 && X <= 1 is (hopefully?) going to be simplified > as (unsigned)X + 1 <= 2, it might be good to simplify it this way > here as well? Yup, GCC does simplify it that way in the end, so I didn't really bother to simplify it here. That said, I'm open to simplifying it here as well, but I'm

Re: [committed] testsuite: Fix gcc.target/i386/pr103895.c testcase [PR103895]

2022-01-05 Thread Andreas Schwab
On Jan 05 2022, Jakub Jelinek via Gcc-patches wrote: > The testcase uses SSE and SSE2 intrinsics, so fails on i686-linux > if -msse2 isn't enabled by default. Fixed by adding -msse2 to > dg-options. Shouldn't that use { dg-require-effective-target sse2 }? -- Andreas Schwab,

[committed] testsuite: Fix gcc.target/i386/pr103895.c testcase [PR103895]

2022-01-05 Thread Jakub Jelinek via Gcc-patches
Hi! The testcase uses SSE and SSE2 intrinsics, so fails on i686-linux if -msse2 isn't enabled by default. Fixed by adding -msse2 to dg-options. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2022-01-05 Jakub Jelinek PR target/103895 *

Re: [PATCH] enable -Winvalid-memory-order for C++ [PR99612]

2022-01-05 Thread Martin Liška
On 12/8/21 17:49, Martin Sebor via Gcc-patches wrote: Even with -Wno-system-headers enabled, the -Winvalid-memory-order code tries to make sure calls to atomic functions with invalid memory orders are diagnosed even though the C atomic functions are defined as macros in the system header. The

  1   2   >