Re: [PATCH] rs6000: Fix cpu selection w/ isel (PR100108)

2022-01-11 Thread Sebastian Huber
Hello Segher, On 20/04/2021 17:00, Segher Boessenkool wrote: There are various non-IBM CPUs with isel as well, so it is easiest if we just don't consider that flag here (it is not needed). 2021-04-20 Segher Boessenkool PR target/100108 * config/rs6000/rs6000.c (rs6000_machine_

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

2022-01-11 Thread Robin Dapp via Gcc-patches
Hi Richard, this causes a bootstrap error on s390 (where IRA_HARD_REGNO_ADD_COST_MULTIPLIER is defined). rclass is used in the #define-guarded area. I guess you also wanted to move this to the new function ira_caller_save_cost? Regards Robin -- ../../gcc/ira-costs.c: In function ‘void ira_tun

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

2022-01-11 Thread Richard Sandiford via Gcc-patches
Robin Dapp writes: > Hi Richard, > > this causes a bootstrap error on s390 (where > IRA_HARD_REGNO_ADD_COST_MULTIPLIER is defined). rclass is used in the > #define-guarded area. Gah, sorry about that. > I guess you also wanted to move this to the new function > ira_caller_save_cost? No, the IRA

[PATCH v6 0/4] __builtin_dynamic_object_size

2022-01-11 Thread Siddhesh Poyarekar
This patchset enhances the __builtin_dynamic_object_size builtin to produce dynamic expressions for object sizes to improve coverage of _FORTIFY_SOURCE. Testing: This series has been tested with build and test for i686, bootstrap with ubsan and bootstrap+test with x86_64. Additional tes

[PATCH v6 2/4] tree-object-size: Handle function parameters

2022-01-11 Thread Siddhesh Poyarekar
Handle hints provided by __attribute__ ((access (...))) to compute dynamic sizes for objects. gcc/ChangeLog: * tree-object-size.c: Include tree-dfa.h. (parm_object_size): New function. (collect_object_sizes_for): Call it. gcc/testsuite/ChangeLog: * gcc.dg/builtin

[PATCH v6 1/4] tree-object-size: Support dynamic sizes in conditions

2022-01-11 Thread Siddhesh Poyarekar
Handle GIMPLE_PHI and conditionals specially for dynamic objects, returning PHI/conditional expressions instead of just a MIN/MAX estimate. This makes the returned object size variable for loops and conditionals, so tests need to be adjusted to look for precise size in some cases. builtin-dynamic-

[PATCH v6 4/4] tree-object-size: Dynamic sizes for ADDR_EXPR

2022-01-11 Thread Siddhesh Poyarekar
Allow returning dynamic expressions from ADDR_EXPR for __builtin_dynamic_object_size and also allow offsets to be dynamic. gcc/ChangeLog: * tree-object-size.c (size_valid_p): New function. (size_for_offset): Remove OFFSET constness assertion. (addr_object_size): Build dyna

[PATCH v6 3/4] tree-object-size: Handle GIMPLE_CALL

2022-01-11 Thread Siddhesh Poyarekar
Handle non-constant expressions in GIMPLE_CALL arguments. Also handle alloca. gcc/ChangeLog: * tree-object-size.c (alloc_object_size): Make and return non-constant size expression. (call_object_size): Return expression or unknown based on whether dynamic object si

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/10/22 17:14, Martin Liška wrote: Are you fine with the suggested changes? Hello. Jakub had comments so I'm sending v2 where I added few parsing exceptions. Now it reports: ... Chandra Chavva Dehao Chen - Fabi

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 10:27:19AM +0100, Martin Liška wrote: > On 1/10/22 17:14, Martin Liška wrote: > > Are you fine with the suggested changes? > > Hello. > > Jakub had comments so I'm sending v2 where I added few parsing > exceptions. Now it reports: I'm still surprised by what the sort is d

Re: [PATCH v6 1/4] tree-object-size: Support dynamic sizes in conditions

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 02:27:47PM +0530, Siddhesh Poyarekar wrote: > Handle GIMPLE_PHI and conditionals specially for dynamic objects, > returning PHI/conditional expressions instead of just a MIN/MAX > estimate. > > This makes the returned object size variable for loops and conditionals, > so te

Re: [PATCH v6 1/4] tree-object-size: Support dynamic sizes in conditions

2022-01-11 Thread Siddhesh Poyarekar
On 11/01/2022 15:13, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 02:27:47PM +0530, Siddhesh Poyarekar wrote: Handle GIMPLE_PHI and conditionals specially for dynamic objects, returning PHI/conditional expressions instead of just a MIN/MAX estimate. This makes the returned object size variable

Re: [PATCH v6 2/4] tree-object-size: Handle function parameters

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 02:27:48PM +0530, Siddhesh Poyarekar wrote: > Handle hints provided by __attribute__ ((access (...))) to compute > dynamic sizes for objects. > > gcc/ChangeLog: > > * tree-object-size.c: Include tree-dfa.h. > (parm_object_size): New function. > (collect_o

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Tobias Burnus
On 10.01.22 17:14, Martin Liška wrote: Are you fine with the suggested changes? I don't feel strong and having some automatic sorting is nice. But ut as a human, I note: + Kris Van Hees - Dominique d'Humieres Sorting 'Van Hees' under 'H' and 'd'Humieres' under 'd' feels inconsistent - I'd

Re: [PATCH v6 4/4] tree-object-size: Dynamic sizes for ADDR_EXPR

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 02:27:50PM +0530, Siddhesh Poyarekar wrote: > Allow returning dynamic expressions from ADDR_EXPR for > __builtin_dynamic_object_size and also allow offsets to be dynamic. > > gcc/ChangeLog: > > * tree-object-size.c (size_valid_p): New function. > (size_for_offs

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/11/22 10:45, Tobias Burnus wrote: On 10.01.22 17:14, Martin Liška wrote: Are you fine with the suggested changes? I don't feel strong and having some automatic sorting is nice. But ut as a human, I note: + Kris Van Hees - Dominique d'Humieres Sorting 'Van Hees' under 'H' and 'd'Humi

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/11/22 10:38, Jakub Jelinek wrote: That is on glibc 2.32. On glibc 2.34.9000 I get a different order though, Chêne last. Heh, that's definitely surprising. Can you raise an issue against Glibc so that we can discuss it? Thanks, Martin

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/11/22 10:38, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 10:27:19AM +0100, Martin Liška wrote: On 1/10/22 17:14, Martin Liška wrote: Are you fine with the suggested changes? Hello. Jakub had comments so I'm sending v2 where I added few parsing exceptions. Now it reports: I'm still su

[patch] Fix reverse SSO issues in IPA-SRA

2022-01-11 Thread Eric Botcazou via Gcc-patches
Hi, we recently received the report that the IPA-SRA pass introduced in GCC 10 does not always play nice with the reverse scalar storage order that can be used in structures/records/unions. Reading the code, the pass apparently correctly detects it but fails to propagate the information to the

Re: [PATCH, OpenMP, C/C++] Fix PR103705

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 10, 2022 at 11:01:46PM +0800, Chung-Lin Tang wrote: > Forgot to attach the patch, here it is :P > > On 2022/1/10 10:59 PM, Chung-Lin Tang wrote: > > For cases like: > >   #pragma omp target update from(s[0].a[0:1]) > > > > The handling in [c_]finish_omp_clauses was only peeling off A

Re: [PATCH] Add VxWorks fixincludes hack, open posix API

2022-01-11 Thread Olivier Hainque via Gcc-patches
Hi Rasmus, > On 17 Dec 2021, at 13:49, Rasmus Villemoes wrote: > > In the end, we ended up adding a two-argument overload for C++ only, as > this is/was only relevant for getting libstdc++ (more specifically, the > new filesystem abstraction stuff) to build. That is, we added > > +#if __GNUC__

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

2022-01-11 Thread Robin Dapp via Gcc-patches
Hi Richard, > Could you try the attached? build and bootstrap look OK with it. Testsuite shows lots of fallout but the proper bisect isn't finished yet. The commit before your series is still fine - the problem could also be after it, though. Will report back later. Thanks Robin

Re: [PATCH] C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 06:08:02PM +0100, Marcel Vollweiler wrote: > + case OMP_CLAUSE_HAS_DEVICE_ADDR: > + t = OMP_CLAUSE_DECL (c); > + if (TREE_CODE (t) == TREE_LIST) > + { > + if (handle_omp_array_sections (c, ort)) > + remove = true; > + e

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

2022-01-11 Thread Martin Liška
On 1/11/22 09:52, Richard Sandiford via Gcc-patches wrote: Robin Dapp writes: Hi Richard, this causes a bootstrap error on s390 (where IRA_HARD_REGNO_ADD_COST_MULTIPLIER is defined). rclass is used in the #define-guarded area. Gah, sorry about that. I guess you also wanted to move this to

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

2022-01-11 Thread Robin Dapp via Gcc-patches
> Could you try the attached? The series with the patch is OK from a testsuite point of view. The other problem appears later. Regards Robin

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

2022-01-11 Thread Richard Sandiford via Gcc-patches
Robin Dapp writes: >> Could you try the attached? > > The series with the patch is OK from a testsuite point of view. The > other problem appears later. OK, thanks for checking. I've pushed the patch as obvious. Richard

[PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
Hello. I've got a patch series that does the renaming. It contains of 2 automatic scripts ([1] and [2]) that were run as: $ gcc-renaming-candidates.py gcc --rename && git commit -a -m 'Rename files.' && rename-gcc.py . -vv && git commit -a -m 'Automatic renaming' The first scripts does the ren

[PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Siddhesh Poyarekar
Never try to compute size for offset when the object size is -1, which is either unknown maximum or uninitialized minimum irrespective of the osi->pass number. gcc/ChangeLog: PR tree-optimization/pr103961 * tree-object-size.c (plus_stmt_object_size): Always avoid computing

Re: [PATCH] Check sorting of MAINTAINERS

2022-01-11 Thread Martin Liška
On 1/11/22 11:05, Martin Liška wrote: On 1/11/22 10:38, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 10:27:19AM +0100, Martin Liška wrote: On 1/10/22 17:14, Martin Liška wrote: Are you fine with the suggested changes? Hello. Jakub had comments so I'm sending v2 where I added few parsing exc

Re: [power-ieee128, committed] Enable conversion selection via environment variable

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 10, 2022 at 11:44:13PM +0100, Thomas Koenig wrote: > Hello world, > > I have just pushed the attched patch to the branch. Thanks. Here is a patch to fix up the ppc64be vs. ppc64le byteswapping of IBM extended real(kind=16) and complex(kind=16). Similarly to the BT_COMPLEX case it hal

Re: [patch] Fix reverse SSO issues in IPA-SRA

2022-01-11 Thread Richard Biener via Gcc-patches
On Tue, Jan 11, 2022 at 11:45 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > we recently received the report that the IPA-SRA pass introduced in GCC 10 > does not always play nice with the reverse scalar storage order that can be > used in structures/records/unions. Reading the code, the pas

[committed] libstdc++: Make std::common_iterator completely constexpr-able (LWG 3574)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. This library issue was approved in the October 2021 plenary. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (common_iterator): Add constexpr to all member functions (LWG 3574). * testsuite/24_iterators/common_iterator/1.cc: Ev

[committed] libstdc++: Make std::variant work with Clang in C++20 mode [PR103891]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Clang has some bugs with destructors that use constraints to be conditionally trivial, so disable the P2231R1 constexpr changes to std::variant unless the compiler is GCC 12 or later. If/when P2493R0 gets accepted and implemented by G++ we can remove the __G

[PATCH] x86_64: Improvements to arithmetic right shifts of V1TImode values.

2022-01-11 Thread Roger Sayle
This patch to the i386 backend's ix86_expand_v1ti_ashiftrt provides improved (shorter) implementations of V1TI mode arithmetic right shifts for constant amounts between 111 and 126 bits. The significance of this range is that this functionality is useful for (eventually) providing sign extension

Re: [RFC][PATCH 3/N] lto-plugin: Port to C++

2022-01-11 Thread Martin Liška
On 1/10/22 08:50, Richard Biener wrote: On Wed, Jan 5, 2022 at 2:28 PM Martin Liška wrote: Hello. I'm working on some changes that will be needed for support of ld.mold. And I would like to have the plugin in C++. Having that, we can utilize basic contains like std::vector (instead of xreallo

Re: [PATCH] C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct

2022-01-11 Thread Tobias Burnus
Hi Jakub, hi all, let me quickly comment on 'has_device_addr' with Fortran arrays and with an array section (i.e. regarding your comment quoted at the very bottom of this email). Unfortunately, the OpenMP specification is rather unclear what has_device_addr means for C/C++ array sections and in

[committed] libstdc++: Optimize std::ostream inserters for single characters

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. On the libsdc++ mailing list Lewis Hyatt pointed out the performance overhead of using sputn in stream inserters, rather than writing directly to the streambuf's put area: https://gcc.gnu.org/pipermail/libstdc++/2021-July/052877.html As Lewis noted, the stan

[committed] libstdc++: Install header for freestanding [PR103726]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and by minimally tested on mips-none-elf. Pushed to trunk. The standard says that should be present for freestanding. That was intentionally left out of the initial implementation, but can be done without much trouble. The header should be moved to libsupc++ at some point in

[Ada] Use atomic builtins for atomic counters on x86 (32bit)

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Remove the x86-specific (32bit) variant of System.Atomic_Counters, because the __atomic builtins work fine on all x86 CPUs except for i386, where they can be provided by libatomic (when compiling with -march=i386). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl

[Ada] Document LLVM-specific flags

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Add documentation for new -gnatd_u and old -gnatd_R flags used for GNAT LLVM and its CCG. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb: Add documentation for new -gnatd_u and old -gnatd_R flags used for GNAT LLVM and its CCG.diff --git a/gcc/ada/debug.ad

[Ada] Escalate pre-continuation messages from warnings to errors

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
When a compile-time constraint error is inserted into the AST, we emit a main message (e.g. "value not in range of ...") and its continuation (e.g. "Constraint_Error will be raised at run time"). When the main message is emitted as a warning and the continuation is escalated into an error, the main

[Ada] Code cleanups

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Use membership tests when possible Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch9.adb, gen_il-types.ads, make.adb, par-ch12.adb, sem_ch13.adb: Use membership tests.diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada

[Ada] Remove warnings-as-errors about constraints error in dead code

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
GNAT removes error messages attached to nodes within dead code; in particular, within instances of generic units with alternative branches for different generic formal types and parameters. Now this removal also works for error messages that come from warnings about constraint errors that have been

[Ada] Remove extra space in single object declarations

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Fix whitespace in single object declarations; violations detected with a simple LKQL checker. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb, exp_attr.adb, exp_ch3.adb, exp_ch7.adb, exp_dist.adb, exp_util.adb, freeze.adb, frontend.adb, inline.ad

[Ada] Proof of System.Vectors.Boolean_Operations

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This proves in SPARK the unit System.Vectors.Boolean_Operations. The specification models explicitly the array of Boolean represented by Vectors.Vector, so that the result of functions can be specified by expressing the relationship between input and output models. Tested on x86_64-pc-linux-gnu,

[Ada] Conformance error on protected subp with anonymous-access-to-tagged formal

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler incorrectly rejected a protected subprogram with a formal of an anonymous access type that designates a tagged type when the protected type extends an interface and the formal's designated type (a different type) is declared immediately within the same scope as the protected type; an e

[Ada] Tune inconsistent message about fixed-lower-bound and -gnatX

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Use a dedicated routine to complain about the missing -gnatX switch. Previously the message was: error: fixed-lower-bound array is an extension feature; use -gnatX and after this change it is: error: fixed-lower-bound array is a GNAT specific extension error: unit must be compiled with -g

[Ada] Remove redundant initialization of Test_And_Set_Flag object

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
When expanding exception declarations we explicitly initialized the System.Atomic_Operations.Test_And_Set.Test_And_Set_Flag object with 0. This was redundant, because the Test_And_Set_Flag type has aspect Default_Value => 0. It is better to not duplicate this constant in the GNAT code, in case that

[Ada] Adapt ghost code to maintain proof

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Add two assertions that are now required for the proof of System.Exp_Mod to go through. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-expmod.adb (Exp_Modular): Add assertions.diff --git a/gcc/ada/libgnat/s-expmod.adb b/gcc/ada/libgnat/s-expmod.adb --- a/gcc/ada/l

[Ada] Proof of unit System.Case_Util

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This unit is needed to prove System.Val_Bool, as it is used in System.Val_Util called from System.Val_Bool. Add contracts that reflect the implementation, as we don't want these units to depend on units under Ada.Characters. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * li

[Ada] Fix check for implicit allocation of dynamic objects

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
We check for dynamic objects by recursively examining record components. We should thus first check if the component is a record type before checking if it is a `Discriminated_Size` which will be false for all non array-type components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Reuse Make_Temporary where possible

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Simplify: Make_Defining_Identifier (Loc, Chars => New_Internal_Name (C)); into: Make_Temporary (Loc, C); Code cleanup related to creation of itypes for allocators in GNATprove mode; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb

[Ada] Fix incomplete debug info for derived packed array type

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
The front-end was copying the Packed_Array_Impl_Type of the parent onto the derived type, which fools the logic of the debug back-end. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): In the case of an array copy Packed_Array

[Ada] Remove unnecessary block in code for expansion of allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators in GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Size_In_Storage_Elements): Remove unnecessary DECLARE block; refill code and comments.diff --git a/gcc/ada/exp_ch4.adb b/gcc/

[Ada] PR ada/79724

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Fix handling of e.g. gcc-11 in Osint.Program_Name. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ PR ada/79724 * osint.adb (Program_Name): Fix handling of suffixes.diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb --- a/gcc/ada/osint.adb +++ b/gcc/ada/osint.adb @@ -2

[Ada] Recover proof of Ada.Strings.Fixed with assertions

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Changes in GNATprove make it necessary to add assertions here. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-strfix.adb (Insert, Overwrite): Add assertions.diff --git a/gcc/ada/libgnat/a-strfix.adb b/gcc/ada/libgnat/a-strfix.adb --- a/gcc/ada/libgnat/a-strfix.adb

[Ada] Deconstruct a VMS utility routine which is only used by GNATprove

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Compile_Time_Known_Value_Or_Aggr was needed for VMS compatibility, which was deconstructed in 2014. This routine was dead since then, until it got accidentally reused by GNATprove to pretty print counterexamples. Cleanup related to handling of compile-time-known null values in GNATprove.

[Ada] Adapt proof of System.Arith_Double

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Following changes in GNATprove, ghost code needs some adjustments for proof to go through. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb (Double_Divide): Adjust proof of lemma Prove_Signs, call lemma for commutation of Big and multiplic

[Ada] Remove unreferenced name constants

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
In the Snames unit we had many unreferenced constants. Most of them are leftovers from features that have been deconstructed years ago, e.g. VAX support. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * snames.ads-tmpl: Remove unreferen

[Ada] Balance parentheses in comments about allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators and compile-time-known null expressions in GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Analyze_Allocator): Fix comment. * sem_eval.ads (Compile-Time Known Values): Likewise.diff --git a/gcc/ada/sem

[Ada] Reduce scope of declare block in analysis of allocators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of allocators in GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Analyze_Allocator): Move DECLARE block inside IF statement; refill code and comments.diff --git a/gcc/ada/sem_ch4.adb b/gcc/a

[Ada] Remove name constant used by GNATprove but not by GNAT

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Revert recent removal of Name_Rpc, which is needed by GNATprove to detect calls to potentially blocking subprograms. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * snames.ads-tmpl: Restore Name_Rpc.diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl --- a/gcc/ada

[Ada] Avoid redundant checks for empty lists

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Simplify "No (L) or else Is_Empty_List (L)" into "Is_Empty_List (L)", since Is_Empty_List can be called on No_List and returns True. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Expression_With_Actions): Avoid

[Ada] Remove unreferenced CCG-specific routine Insert_Declaration

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Insert_Declaration was originally added for the Ada-to-C translator, because in C we can't have declarations within an expressions. However, it is no longer used, because now we insert declarations into N_Expression_With_Actions. Code cleanup related to inserting itypes in spec expressions

[Ada] Task arrays trigger spurious unreferenced warnings

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Incremental patch to handle multi-dimensional arrays of tasks and records with task components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_warn.adb (Check_References): Add call to Has_Task instead of checking component type.diff --git a/gcc/ada/sem_warn.adb

[Ada] Accept square brackets for expression functions

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
Ada RM 6.8 allows an expression function to return an aggregate directly at the top level (enclosed with either parentheses or square brackets). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch6.adb (Scan_Body_Or_Expression_Function): Accept left bracket as tok

[Ada] Include generic instance names in non-visible entity errors

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds the printing of generic instance names when encountering non-visible entities instead of just the line number of the package instantiation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch8.adb (Nvis_Messages): Add generic instance name to error

[Ada] Relax assertion on designated types for equality operators

2022-01-11 Thread Pierre-Marie de Rodat via Gcc-patches
This will avoid doing artificial conversions during semantic analysis. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/utils2.c (build_binary_op) : Relax a little the assertion on designated types of pointer types.diff --git a/gcc/ada/gcc-interface/util

Re: [PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 06:40:44PM +0530, Siddhesh Poyarekar wrote: > Never try to compute size for offset when the object size is -1, which > is either unknown maximum or uninitialized minimum irrespective of the > osi->pass number. > > gcc/ChangeLog: > > PR tree-optimization/pr103961 >

Re: [PATCH] [12/11/10] Fix invalid format warnings on Windows

2022-01-11 Thread Martin Liška
Hello. I do support the patch, but I would ... On 1/7/22 19:33, Tomas Kalibera wrote: +  if (is_attribute_p ("format", get_attribute_name (aa)) && +  fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL)) +{ +  switch (DECL_FUNCTION_CODE (fndecl)) +  

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

2022-01-11 Thread Richard Biener via Gcc-patches
On Wed, Jan 5, 2022 at 5:59 PM Qing Zhao wrote: > > 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 t

Re: [Patch][V3][Patch 1/2]Change the 3rd parameter of function .DEFERRED_INIT from IS_VLA to decl name

2022-01-11 Thread Richard Biener via Gcc-patches
On Tue, Jan 11, 2022 at 12:58 AM Qing Zhao wrote: > > Hi, Richard, > > I splited the previous patch for “Enable -Wuninitialized + > -ftrivial-auto-var-init for address taken variables” into two separate > patches. > This is the first one > > This first patch is to fix (or work around ) PR10372

Re: [PATCH] C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 02:27:57PM +0100, Tobias Burnus wrote: > Hi Jakub, hi all, > > let me quickly comment on 'has_device_addr' with Fortran arrays > and with an array section (i.e. regarding your comment quoted > at the very bottom of this email). > > Unfortunately, the OpenMP specification i

Re: [PATCH] tree-optimization/pr103961: Never compute offset for -1 size

2022-01-11 Thread Siddhesh Poyarekar
On 11/01/2022 19:04, Jakub Jelinek wrote: On Tue, Jan 11, 2022 at 06:40:44PM +0530, Siddhesh Poyarekar wrote: Never try to compute size for offset when the object size is -1, which is either unknown maximum or uninitialized minimum irrespective of the osi->pass number. gcc/ChangeLog: P

Re: [PATCH] PR tree-optimization/103821 - Prevent exponential range calculations.

2022-01-11 Thread Andrew MacLeod via Gcc-patches
On 1/11/22 02:01, Richard Biener wrote: On Tue, Jan 11, 2022 at 12:28 AM Andrew MacLeod via Gcc-patches wrote: This test case demonstrates an unnoticed exponential situation in range-ops. We end up unrolling the loop, and the pattern of code creates a set of cascading multiplies for which we

[committed] analyzer: fix false +ve on bitwise binops (PR analyzer/102692)

2022-01-11 Thread David Malcolm via Gcc-patches
PR analyzer/102692 reports a false positive at -O2 from -Wanalyzer-null-dereference on: if (!p || q || !p->next) At the gimple level, -O2 has converted the first || into bitwise or controlling a jump: _4 = _2 | _3; if (_4 != 0) and a recursive call has been converted to iteration. The analy

Re: Ping: [PATCH] rs6000: Add split pattern to replace

2022-01-11 Thread David Edelsohn via Gcc-patches
On Tue, Jan 11, 2022 at 2:27 AM Xionghu Luo wrote: > > On 2022/1/11 06:55, David Edelsohn wrote: > >>> +(define_insn_and_split "sldoi_to_mov_" > > It would be more consistent with the naming convention to use > > "sldoi_to_mov" without the final "_". > > OK, thanks. > > > > >>> + [(set (match_ope

Re: [patch] Fix reverse SSO issues in IPA-SRA

2022-01-11 Thread Martin Jambor
Hi Eric, On Tue, Jan 11 2022, Eric Botcazou via Gcc-patches wrote: > Hi, > > we recently received the report that the IPA-SRA pass introduced in GCC 10 > does not always play nice with the reverse scalar storage order that can be > used in structures/records/unions. Reading the code, the pass a

[committed] libstdc++: Make copyable-box completely constexpr (LWG 3572)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. This LWG issue was approved at the October 2021 plenary and can be implemented now that std::optional is fully constexpr. libstdc++-v3/ChangeLog: * include/std/ranges (ranges::__detail::__box): Add constexpr to assignment operators (LWG

[committed] libstdc++: Add missing noexcept to lazy_split_view iterator (LWG 3593)

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. This was approved at the October 2021 plenary. We already have noexcept in the other places the issue adds it in the spec. libstdc++-v3/ChangeLog: * include/std/ranges (ranges::lazy_split_view::_InnerIter::end()): Add neoxcept (LWG 3593

Re: [Patch][V3][Patch 1/2]Change the 3rd parameter of function .DEFERRED_INIT from IS_VLA to decl name

2022-01-11 Thread Qing Zhao via Gcc-patches
> On Jan 11, 2022, at 7:53 AM, Richard Biener > wrote: > > On Tue, Jan 11, 2022 at 12:58 AM Qing Zhao wrote: >> >> Hi, Richard, >> >> I splited the previous patch for “Enable -Wuninitialized + >> -ftrivial-auto-var-init for address taken variables” into two separate >> patches. >> This is

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Toon Moene
On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross compilers. Does this also rename .c files in the fortran and libgfortran direct

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
On 1/11/22 16:48, Toon Moene wrote: On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross compilers. Does this also rename .c files in

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 04:50:02PM +0100, Martin Liška wrote: > On 1/11/22 16:48, Toon Moene wrote: > > On 1/11/22 13:56, Martin Liška wrote: > > > > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > > Plus it survives build of all FEs (--enable-languages=all) on > > >

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Martin Liška
On 1/11/22 16:56, Jakub Jelinek wrote: While e.g. libcpp or gcc are in C++. Which means I should rename .c files under libcpp, right? Is there any other folder from gcc/ and libcpp/ that would need that as well? Martin

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 05:03:34PM +0100, Martin Liška wrote: > On 1/11/22 16:56, Jakub Jelinek wrote: > > While e.g. libcpp or gcc are in C++. > > Which means I should rename .c files under libcpp, right? > Is there any other folder from gcc/ and libcpp/ that would need that as well? >From the d

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

2022-01-11 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Jan 11, 2022, at 7:43 AM, Richard Biener > wrote: > 1. Add some meaningful temporaries to break the long expression to make it Readable. And also add comments to explain the purpose of the statement; 2. Resolve the memory leakage of the dy

Re: [PATCH] c-family: Fix up -W*conversion on bitwise &/|/^ [PR101537]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 1/4/22 04:32, Jakub Jelinek wrote: Hi! The following testcases emit a bogus -Wconversion warning. This is because conversion_warning function doesn't handle BIT_*_EXPR (only unsafe_conversion_p that is called during the default: case, and that one doesn't handle SAVE_EXPRs added because the

Re: [PATCH] c++: Silence -Wuseless-cast warnings during move [PR103480]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/31/21 04:30, Jakub Jelinek wrote: Hi! This is maybe just a shot in the dark, but IMHO we shouldn't be diagnosing -Wuseless-cast on casts the compiler adds on its own when calling its move function. We don't seem to warn when user calls std::move either. We call move on elinit (*NON_LVALUE

Re: [PATCH] c++: Fix ICEs with OBJ_TYPE_REF pretty printing [PR101597]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/31/21 04:13, Jakub Jelinek wrote: Hi! The following testcase ICEs, because middle-end uses the C++ FE pretty printing code through langhooks in the diagnostics. The FE expects OBJ_TYPE_REF_OBJECT's type to be useful (pointer to the class type it is called on), but in the middle-end convers

Re: [PATCH] PR 102935, Fix pr101384-1.c code generation test.

2022-01-11 Thread Bill Schmidt via Gcc-patches
Hi Mike, This looks fine to me.  Maintainers? Thanks, Bill On 1/7/22 6:33 PM, Michael Meissner wrote: > Fix pr101384-1.c code generation test. > > Add support for the compiler using XXSPLTIB reg,255 to load all 1's into a > register on power9 and above instead of using VSPLTI{B,H,W} reg,-1. > >

Re: [PATCH] c++: dependent bases and 'this' availability [PR103831]

2022-01-11 Thread Jason Merrill via Gcc-patches
On 12/28/21 10:08, Patrick Palka wrote: Here during satisfaction of B's associated constraints we're failing to reject the object-less call to the non-static member function A::size ultimately because satisfaction is performed in the (access) context of the class template B, which has a dependent

[PATCH] ira: Fix old-reload targets [PR103974]

2022-01-11 Thread Richard Sandiford via Gcc-patches
The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. This patch therefore makes all the new calls to ira_subloop_allocnos_can_differ_p return false if !ira_use_lra_p. The color_pas

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Harald Anlauf via Gcc-patches
Am 11.01.22 um 16:50 schrieb Martin Liška: On 1/11/22 16:48, Toon Moene wrote: On 1/11/22 13:56, Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Plus it survives build of all FEs (--enable-languages=all) on x86_64-linux-gnu and I've built all cross co

Re: [PATCH] PR 102935, Fix pr101384-1.c code generation test.

2022-01-11 Thread David Edelsohn via Gcc-patches
On Tue, Jan 11, 2022 at 12:06 PM Bill Schmidt wrote: > > Hi Mike, > > This looks fine to me. Maintainers? Okay. Thanks, David > > Thanks, > Bill > > On 1/7/22 6:33 PM, Michael Meissner wrote: > > Fix pr101384-1.c code generation test. > > > > Add support for the compiler using XXSPLTIB reg,255

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 11 Jan 2022 at 18:02, Harald Anlauf via Gcc wrote: > > Am 11.01.22 um 16:50 schrieb Martin Liška: > > On 1/11/22 16:48, Toon Moene wrote: > >> On 1/11/22 13:56, Martin Liška wrote: > >> > >>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > >>> Plus it survives buil

[PATCH] i386: Introduce V2QImode vector cmove for -msse4.1 [PR103861]

2022-01-11 Thread Uros Bizjak via Gcc-patches
This patch also moves V2HI and V4QImode vector conditional moves to SSE4.1 targets. Vector cmoves are implemented with SSE logic functions without -msse4.1, and they are hardly worthwile for narrow vector modes. More important, we would like to keep vector logic functions for GPR registers, and th

Re: [PATCH] Mass rename of C++ .c files to .cc suffix

2022-01-11 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 11, 2022 at 06:23:51PM +, Jonathan Wakely via Gcc-patches wrote: > > Regarding fortran: can we have a vote on this one? > > > > Some developers (including myself) are not really familiar with C++, > > and in the past preference has been expressed on the fortran ML in > > favor of no

[committed] libstdc++: Install header for freestanding [PR103726]

2022-01-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and freestanding mips-elf. This C++20 header is also supposed to be present for freestanding. libstdc++-v3/ChangeLog: PR libstdc++/103726 * include/Makefile.am: Install for freestanding. * include/Makefile.in: Regenerate. * include/st

Re: [PATCH] ira: Fix old-reload targets [PR103974]

2022-01-11 Thread Vladimir Makarov via Gcc-patches
On 2022-01-11 12:42, Richard Sandiford wrote: The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. Agree. It is not worth to spend your time for work for reload. This patch th

  1   2   >