[PATCH 1/2] Improve early simplify and match for phiopt

2021-07-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski Previously the idea was gimple_simplify_phiopt would call resimplify with a NULL sequence but that sometimes fails even if there was only one statement produced. The cases where it fails is when there are two simplifications happen. In the case of the min/max production, the

[PATCH 2/2] [PHIOPT/MATCH] Remove the statement to move if not used

2021-07-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski Instead of waiting for DCE to remove the unused statement, and maybe optimize another conditional, it is better if we don't move the statement and have the statement removed. gcc/ChangeLog: * tree-ssa-phiopt.c (used_in_seq): New function.

[PATCH 0/2] Misc PHIOPT patches

2021-07-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski Just two misc improvements to simplify and match of phiopt. I decided to submit this two before I finish up the min/max movement to match.pd as that will take some time. Both showed up while looking into the movement of min/max though. Andrew Pinski (2): Improve early

Re: [RFA] Attach MEM_EXPR information when flushing BLKmode args to the stack - V2

2021-07-08 Thread Jeff Law
On 7/2/2021 10:13 AM, Jeff Law wrote: This is a minor missed optimization we found with our internal port. Given this code: typedef struct {short a; short b;} T; extern void g1(); void f(T s) {     if (s.a < 0)     g1(); } "s" is passed in a register, but it's still a

[PATCH] Check type size for doloop iv on BITS_PER_WORD [PR61837]

2021-07-08 Thread Jiufu Guo via Gcc-patches
Currently, doloop.xx variable is using the type as niter which may shorter than word size. For some cases, it may be better to use word size type. For example, on some 64bit system, to access 32bit niter, subreg maybe used. Then using 64bit type would not need to use subreg if the value can be

Re: [PATCH 0/2] RISC-V: Add ldr/str instruction for T-HEAD.

2021-07-08 Thread ALO via Gcc-patches
Hi, Ping. — Jojo 在 2021年6月29日 +0800 PM4:11,Jojo R ,写道: > T-HEAD extends some customized ISAs for Cores. > The patches support ldr/str insns, it likes arm's LDR insn, the > memory model is a base register indexed by (optionally scaled) register.

Re: rs6000: Generate an lxvp instead of two adjacent lxv instructions

2021-07-08 Thread Peter Bergner via Gcc-patches
On 7/8/21 6:28 PM, Segher Boessenkool wrote: > It needs testing on BE. Will do. >> +static bool consecutive_mem_locations (rtx, rtx); > > Please don't; just move functions to somewhere earlier than where they > are used. Will do. >> @@ -16841,8 +16843,35 @@ rs6000_split_multireg_move

Re: [PATCH] testsuite: mips: use noinline attribute instead of -fno-inline

2021-07-08 Thread Jeff Law via Gcc-patches
On 6/25/2021 8:40 AM, Richard Sandiford wrote: Xi Ruoyao via Gcc-patches writes: On Fri, 2021-06-25 at 01:02 +0800, Xi Ruoyao wrote: On Thu, 2021-06-24 at 10:48 -0600, Jeff Law wrote: I'd like to know a bit more here.  mips.exp shouldn't care about the options passed to the compiler and

Re: [PATCH] Fix PR testsuite/101269

2021-07-08 Thread Jeff Law via Gcc-patches
On 6/30/2021 2:33 PM, Indu Bhagat via Gcc-patches wrote: PR testsuite/101269 - new test case gcc.dg/debug/btf/btf-datasec-1.c fails with its introduction in r12-1852 BTF datasec records for .rodata/.data are expected for now for all targets. For powerpc based targets, use -msdata=none when

Re: [PATCH] consider parameter names in -Wvla-parameter (PR 97548)

2021-07-08 Thread Jeff Law via Gcc-patches
On 7/1/2021 7:02 PM, Martin Sebor via Gcc-patches wrote: -Wvla-parameter relies on operand_equal_p() with OEP_LEXICOGRAPHIC set to compare VLA bounds for equality.  But operand_equal_p() doesn't consider decl names, and so nontrivial expressions that refer to the same function parameter are

[r12-2132 Regression] FAIL: g++.dg/warn/Warray-bounds-20.C -std=gnu++98 note (test for warnings, line 55) on Linux/x86_64

2021-07-08 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, a110855667782dac7b674d3e328b253b3b3c919b is the first bad commit commit a110855667782dac7b674d3e328b253b3b3c919b Author: Martin Sebor Date: Wed Jul 7 14:05:25 2021 -0600 Correct handling of variable offset minus constant in -Warray-bounds [PR100137] caused FAIL:

Re: rs6000: Generate an lxvp instead of two adjacent lxv instructions

2021-07-08 Thread Segher Boessenkool
Hi! On Thu, Jul 08, 2021 at 05:01:05PM -0500, Peter Bergner wrote: > The MMA build built-ins currently use individual lxv instructions to > load up the registers of a __vector_pair or __vector_quad. If the > memory addresses of the built-in operands are to adjacent locations, > then we could use

Re: PING: [PATCH] mips: check MSA support for vector modes [PR100760,PR100761,PR100762]

2021-07-08 Thread Jeff Law via Gcc-patches
On 7/5/2021 8:04 PM, Paul Hua wrote: Looks good to me, but I have no right to approve. But your opinions are well respected :-) I'll go ahead and ACK, though in general I'm stepping away from reviewing target specific work. jeff

[committed] move warning suppression closer to invalid access (PR101372)

2021-07-08 Thread Martin Sebor via Gcc-patches
To unblock bootstrap this morning that was failing due to stricter array bounds checking, I suppressed two -Warray-bounds instances in cp/modules.cc without analyzing them, tracking the to-do in pr101372. Now that I understand what's going on -- the warning is behaving as designed, flagging

Re: [PATCH] [wwwdocs] Update description of GM2 and document branch

2021-07-08 Thread Gerald Pfeifer
Hi Gaius, On Thu, 8 Jul 2021, Gaius Mulley wrote: > Here are two proposed patches to wwwdocs: thank you for thinking of updating the web pages, too! > diff --git a/htdocs/frontends.html b/htdocs/frontends.html : > http://www.nongnu.org/gm2/;>GNU Modula-2 implements > the PIM2, PIM3, PIM4 and

[committed] remove an xfail

2021-07-08 Thread Martin Sebor via Gcc-patches
The test xfailed for ILP32 has been apparently passing for some time. I've removed the xfail after confirming in with -m32 on x86_64 and powerpc64. Martin commit 68b938fada4c728c0b850b44125d9a173c01c8fb Author: Martin Sebor Date: Thu Jul 8 16:22:25 2021 -0600 testsuite: Remove an xfail.

[RFC,PATCH] Allow means for targets to out out of CTF/BTF support

2021-07-08 Thread Indu Bhagat via Gcc-patches
Hello, It was brought up when discussing PR debug/101283 (Several tests fail on Darwin with -gctf/gbtf) that it will be good to provide means for targets to opt out of CTF/BTF support. By and large, it seems to me that CTF/BTF debug formats can be safely enabled for all ELF-based targets by

[PATCH] [wwwdocs] Update description of GM2 and document branch

2021-07-08 Thread Gaius Mulley via Gcc-patches
Hello Gerald, Here are two proposed patches to wwwdocs: htdocs/frontends.html: Update the description of GNU Modula-2. htdocs/git.html: Document the new devel/modula-2 branch. regards, Gaius = diff --git a/htdocs/frontends.html b/htdocs/frontends.html index bec33b7b..60f08aa4

[committed] adjust expected test output to LP32 (PR100451)

2021-07-08 Thread Martin Sebor via Gcc-patches
I have committed the attached change adjusting the expected test output to the difference between LP64 and ILP32. Tested in both modes on x86_64 and with a powerpc64 cross-compiler. Martin Adjust expected output for LP32 [PR100451]. gcc/testsuite/ChangeLog: PR testsuite/100451 *

[committed] avoid including to ease cross-compiler testing

2021-07-08 Thread Martin Sebor via Gcc-patches
I have committed the attached change to ease testing with bare bones cross-compilers with no libstdc++ headers. Tested on x86_64 and with a powerpc64 cross-compiler. Martin commit c68cac900ab4ccaf6b1a31168bc9a302ebc46428 Author: Martin Sebor Date: Thu Jul 8 16:02:01 2021 -0600 Avoid

rs6000: Generate an lxvp instead of two adjacent lxv instructions

2021-07-08 Thread Peter Bergner via Gcc-patches
The MMA build built-ins currently use individual lxv instructions to load up the registers of a __vector_pair or __vector_quad. If the memory addresses of the built-in operands are to adjacent locations, then we could use an lxvp in some cases to load up two registers at once. The patch below

Re: [PATCH] c++: requires-expr with dependent extra args [PR101181]

2021-07-08 Thread Jason Merrill via Gcc-patches
On 7/8/21 11:28 AM, Patrick Palka wrote: Here we're crashing ultimately because the mechanism for delaying substitution into a requires-expression (or constexpr if) doesn't expect to see dependent args. But we end up capturing dependent args here when substituting into the default template

Re: [PATCH v2] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Marek Polacek via Gcc-patches
On Thu, Jul 08, 2021 at 05:34:24PM -0400, Jason Merrill wrote: > On 7/8/21 4:26 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > OK for trunk and 11, at least. I lean toward putting it on older release > branches as well, but it doesn't seem urgent.

Re: [PATCH v2] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Jason Merrill via Gcc-patches
On 7/8/21 4:26 PM, Marek Polacek wrote: On Thu, Jul 08, 2021 at 09:35:02AM -0400, Marek Polacek wrote: On Thu, Jul 08, 2021 at 09:30:27AM -0400, Jason Merrill wrote: On 7/7/21 9:40 PM, Marek Polacek wrote: It sounds plausible that this assert int f();

[PATCH] Fix for powerpc64 long double complex divide failure

2021-07-08 Thread Patrick McGehearty via Gcc-patches
This patch resolves the failure of powerpc64 long double complex divide in native ibm long double format after the patch "Practical improvement to libgcc complex divide". See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101104 The new code uses the following macros which are intended to be mapped

[committed] Further improvements to H8 variable shift patterns

2021-07-08 Thread Jeff Law via Gcc-patches
And another installment in optimizing a dead architecture.   This builds on prior patches to improve compare/test elimination for shifts.  Specifically for the older chips in the H8 family we have to handle variable shifts with a loop. Right now the splitter generates (set (pc) (if_then_else

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

2021-07-08 Thread Qing Zhao via Gcc-patches
(Resend this email since the previous one didn’t quote, I changed one setting in my mail client, hopefully that can fix this issue). Hi, Martin, Thank you for the review and comment. > On Jul 8, 2021, at 8:29 AM, Martin Jambor wrote: >> diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c >> index

Re: disable -Warray-bounds in libgo (PR 101374)

2021-07-08 Thread Rainer Orth
Hi Martin, > Yesterday's enhancement to -Warray-bounds has exposed a couple of > issues in libgo where the code writes into an invalid constant > address that the warning is designed to flag. > > On the assumption that those invalid addresses are deliberate, > the attached patch suppresses these

Re: [PATCH v2] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Marek Polacek via Gcc-patches
On Thu, Jul 08, 2021 at 09:35:02AM -0400, Marek Polacek wrote: > On Thu, Jul 08, 2021 at 09:30:27AM -0400, Jason Merrill wrote: > > On 7/7/21 9:40 PM, Marek Polacek wrote: > > > It sounds plausible that this assert > > > > > >int f(); > > >static_assert(noexcept(sizeof(f(; > > > > >

Re: [RFA] Attach MEM_EXPR information when flushing BLKmode args to the stack

2021-07-08 Thread Jeff Law via Gcc-patches
On 7/5/2021 5:17 AM, Richard Biener via Gcc-patches wrote: On Fri, Jul 2, 2021 at 6:13 PM Jeff Law wrote: This is a minor missed optimization we found with our internal port. Given this code: typedef struct {short a; short b;} T; extern void g1(); void f(T s) { if (s.a < 0)

Re: PING 2 [PATCH] correct handling of variable offset minus constant in -Warray-bounds (PR 100137)

2021-07-08 Thread Martin Sebor via Gcc-patches
On 7/8/21 4:41 AM, Andreas Schwab wrote: On Jul 07 2021, Marek Polacek via Gcc-patches wrote: On Wed, Jul 07, 2021 at 02:38:11PM -0600, Martin Sebor via Gcc-patches wrote: I certainly will. Pushed in r12-2132. I think this patch breaks bootstrap on x86_64: It also breaks bootstrap on

disable -Warray-bounds in libgo (PR 101374)

2021-07-08 Thread Martin Sebor via Gcc-patches
Hi Ian, Yesterday's enhancement to -Warray-bounds has exposed a couple of issues in libgo where the code writes into an invalid constant address that the warning is designed to flag. On the assumption that those invalid addresses are deliberate, the attached patch suppresses these instances by

[committed] Use Object Size Type zero for -Warray-bounds [PR101374]

2021-07-08 Thread Martin Sebor via Gcc-patches
I have committed the attached patch to unblock the bootstrap errors due to the tightening up of the -Warray-bounds checking in r12-213. I have also temporarily disabled a couple of instances of the warning in gcc/cp/module.cc. They don't appear to be caused by the same tighter checking but I

Re: [PATCH 06/10] vect: Pass reduc_info to get_initial_defs_for_reduction

2021-07-08 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Thu, Jul 8, 2021 at 2:46 PM Richard Sandiford via Gcc-patches > wrote: >> >> This patch passes the reduc_info to get_initial_defs_for_reduction, >> so that the function can get general information from there rather >> than from the first SLP statement. This isn't a

[PATCH] c++: requires-expr with dependent extra args [PR101181]

2021-07-08 Thread Patrick Palka via Gcc-patches
Here we're crashing ultimately because the mechanism for delaying substitution into a requires-expression (or constexpr if) doesn't expect to see dependent args. But we end up capturing dependent args here when substituting into the default template argument during coerce_template_parms for the

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

2021-07-08 Thread Qing Zhao via Gcc-patches
Hi, Martin, Thank you for the review and comment. On Jul 8, 2021, at 8:29 AM, Martin Jambor mailto:mjam...@suse.cz>> wrote: diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index c05d22f3e8f1..35051d7c6b96 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -384,6 +384,13 @@ static struct /*

[Ada] Remove Unknown_ functions

2021-07-08 Thread Pierre-Marie de Rodat
Remove the Unknown_ type representation attribute predicates from Einfo.Utils. "not Known_Alignment (...)" is at least as readable as "Unknown_Alignment (...)" -- we don't need a bunch of functions that just do a "not". Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Tune detection of illegal occurrences of target_name

2021-07-08 Thread Pierre-Marie de Rodat
Prevent AST climbing from going outside of the current program unit; tune style; add comments. Also, only set the Current_Assignment global variable when needed and clear it once the analysis of an assignment statement is done. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Diagnose properly illegal uses of Target_Name

2021-07-08 Thread Pierre-Marie de Rodat
Ada_2022 introduces the notion of Target_Name, written @, to be used in assignment statements, where it denotes the value of the left-hand side prior to the assignment. This patch diagnoses illegal uses of the target name outside of its legal context. Tested on x86_64-pc-linux-gnu, committed on

[Ada] Use encoded names only with -fgnat-encodings=all

2021-07-08 Thread Pierre-Marie de Rodat
This disables the last special encoding done in Get_Encoded_Name, except when -fgnat-encodings=all is passed on the command line. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_dbug.adb (Get_Encoded_Name): Do not encode names of discrete types with custom

[Ada] Transient scope cleanup

2021-07-08 Thread Pierre-Marie de Rodat
Misc cleanups found while working on transient scopes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * comperr.adb (Compiler_Abort): Call Sinput.Unlock, because if this is called late, then Source_Dump would crash otherwise. * debug.adb: Correct

[Ada] Rename sigtramp-vxworks-target.inc to sigtramp-vxworks-target.h

2021-07-08 Thread Pierre-Marie de Rodat
The .inc extension isn't recognized by gprconfig. The original motivation for using this extension was to match the convention of putting code in .inc ala unwind.inc. However it's easier in this situation to just rename it to a .h file. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Duplicated D lines in ali files

2021-07-08 Thread Pierre-Marie de Rodat
GNATcoverage possibly relies on the presence of the duplicate D lines in ALI files for its Source Coverage Obligation tables among different instantiations of a same generic. Mention this in comments. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-writ.ads: Mention

[Ada] Spurious style message on missing overriding indicator

2021-07-08 Thread Pierre-Marie de Rodat
In the presence of style switch -gnatyO, the compiler emits a spurious style violation message naming an inherited operation that does not come from an explicit subprogram declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * style.adb (Missing_Overriding): Do not

[Ada] AI12-0156 Use subtype indication in generalized iterators

2021-07-08 Thread Pierre-Marie de Rodat
Add syntax and semantic support for this new Ada 2022 feature. Support for proper accessibility levels to be investigated in a second step. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch5.adb (P_Iterator_Specification): Add support for access definition in

[Ada] Spurious warning in generic instance

2021-07-08 Thread Pierre-Marie de Rodat
In the case of complex generic instantiations, the warning on component not being present can be spurious (corresponding to dead code for the given instance), so we disable it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads, sem_util.adb

[Ada] Fix violation of No_Implicit_Loops restriction for enumeration type

2021-07-08 Thread Pierre-Marie de Rodat
The perfect hash function generated by the compiler to speed up the Value attribute of an enumeration type contains an implicit loop and, therefore, violates the No_Implicit_Loops restriction when it is active. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_imgv.adb:

[Ada] Simplify redundant checks for non-empty lists

2021-07-08 Thread Pierre-Marie de Rodat
Simplify "Present (L) and then not Is_Empty_List (L)" into "not 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/ * sem_ch12.adb, sem_ch6.adb, sem_ch9.adb,

[Ada] Remove redundant condition for listing compilation units

2021-07-08 Thread Pierre-Marie de Rodat
There is only one call to Unit_Display and it is guarded by the List_Units global variable. There is no need to retest this variable inside the Unit_Display routine. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch10.adb

[Ada] Restore context on failure in loading of renamed child unit

2021-07-08 Thread Pierre-Marie de Rodat
When loading of renamed child unit failed, we didn't properly restore the value of a global Parsing_Main_Extended_Source variable. This is primarily a cleanup change; behaviour is not affected (perhaps except for errors reported on complicated code that is illegal anyway). Tested on

[Ada] Replace low-level condition with a high-level call

2021-07-08 Thread Pierre-Marie de Rodat
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-writ.adb (Ensure_System_Dependency): Simplify condition.diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb --- a/gcc/ada/lib-writ.adb +++ b/gcc/ada/lib-writ.adb @@ -147,7 +147,7

[Ada] Prevent infinite recursion when there is no expected unit

2021-07-08 Thread Pierre-Marie de Rodat
The comment in Par.Load says "... or we are in big trouble, and abandon the compilation", but the code merely emitted errors and kept going. Now it emits errors, flags the problem in the unit table and gives up. Also, it was wrong for this routine to remove the unit, because the callers who add

[Ada] Fix style in comments and code related to compilation units

2021-07-08 Thread Pierre-Marie de Rodat
Only style fixes; comments and code themselves are unchanged. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-load.adb (Load_Unit): Fix style in comment. * par-load.adb (Load): Likewise. * scng.adb (Initialize_Scanner): Fix whitespace.diff --git

[Ada] Fix use of single question mark in error message

2021-07-08 Thread Pierre-Marie de Rodat
Single question marks are deprecated. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_prag.adb (Expand_Pragma_Inspection_Point): Fix error message.diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@

[Ada] Skip types in error for test to compute array size

2021-07-08 Thread Pierre-Marie de Rodat
After a syntax error, if the code is compiled with -gnatq, semantic analysis should still proceed without internal errors if possible. Add special case to recognize ill-formed array type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * layout.adb (Layout_Type): Do not call

[Ada] Prevent crash on inspection point for unfrozen entity

2021-07-08 Thread Pierre-Marie de Rodat
Before this patch, the following program would make GNAT crash: procedure P is Unused_Var : Integer with Shared => False; pragma Inspection_Point; begin null; end tmp; This was because the Shared aspect resulted in a freeze node being inserted after the Inspection_Point pragma. This

[Ada] Fix on computation of packed array size in case of error

2021-07-08 Thread Pierre-Marie de Rodat
In case of compilation error, the low and high bounds of the array type might have been replaced by an error node. Deal with this case by checking that the bounds are known at compile time. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * layout.adb (Layout_Type): Add guard

[Ada] Make runtime code compatible with No_Dynamic_Accessibility_Checks

2021-07-08 Thread Pierre-Marie de Rodat
To help experiment with this new model. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cobove.adb,

[Ada] Compute sizes when possible for packed array with Component_Size

2021-07-08 Thread Pierre-Marie de Rodat
For a packed constrained array type with a Component_Size clause, it may be possible to compute both its RM_Size and Esize. Do this as it benefits GNATprove for checking validity of overlays. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * layout.adb (Layout_Type): Special

[Ada] Unsynchronized concurrent access to a Boolean variable

2021-07-08 Thread Pierre-Marie de Rodat
If an exception declaration occurs in a nonstatic scope (for example, within the body of a task type), System.Exception_Table.Register_Exception is to be called the first (and *only* the first) time the declaration is elaborated. A library-level "this exception has been registered" Boolean flag

[Ada] Add No_Tasking restriction is system.ads for bootstrap

2021-07-08 Thread Pierre-Marie de Rodat
Make it explicit that tasking is not used in the compiler, which also allows generating simpler and more efficient code. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/system.ads: Add No_Tasking restriction.diff --git a/gcc/ada/gcc-interface/system.ads

[Ada] Incorrect iteration over hashed containers after multiple Inserts

2021-07-08 Thread Pierre-Marie de Rodat
Cursors for Hashed maps and hashed sets include a component that speeds up iteration over these containers. However, in the presence of multiple insertions into the corresponding hash-tables, this component may become unreliable when a cursor obtained before an iteration is compared with a cursor

[Ada] Revert meaning of -gnatd_b

2021-07-08 Thread Pierre-Marie de Rodat
As part of experimenting with No_Dynamic_Accessibility_Checks, it seems that reverting the meaning of -gnatd_b is a better default for this experiment. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb, sem_util.adb: Revert meaning of -gnatd_b. *

[Ada] Make tools compatible with No_Dynamic_Accessibility_Checks

2021-07-08 Thread Pierre-Marie de Rodat
To help experiment with this new model. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * make.adb, osint.adb: Make code compatible with No_Dynamic_Accessibility_Checks restriction.diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb --- a/gcc/ada/make.adb +++

[Ada] Avoid linear search when ensuring dependency on System

2021-07-08 Thread Pierre-Marie de Rodat
Replace a linear search with a hash table query. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * lib-writ.adb (Ensure_System_Dependency): Replace search in Lib.Units with a search in Lib.Unit_Names.diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb ---

[Ada] Simplify string manipulation related to preprocessing

2021-07-08 Thread Pierre-Marie de Rodat
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sinput-l.adb (Load_File): Simplify foreword manipulation with concatenation; similar for filename with preprocessed output.diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb

Re: PING 2 [PATCH] correct handling of variable offset minus constant in -Warray-bounds (PR 100137)

2021-07-08 Thread Christophe Lyon via Gcc-patches
On Thu, 8 Jul 2021 at 12:42, Andreas Schwab wrote: > > On Jul 07 2021, Marek Polacek via Gcc-patches wrote: > > > On Wed, Jul 07, 2021 at 02:38:11PM -0600, Martin Sebor via Gcc-patches > > wrote: > >> I certainly will. Pushed in r12-2132. > > > > I think this patch breaks bootstrap on x86_64: >

Re: [PATCH] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Marek Polacek via Gcc-patches
On Thu, Jul 08, 2021 at 09:30:27AM -0400, Jason Merrill wrote: > On 7/7/21 9:40 PM, Marek Polacek wrote: > > It sounds plausible that this assert > > > >int f(); > >static_assert(noexcept(sizeof(f(; > > > > should pass: sizeof produces a std::size_t and its operand is not > >

Re: [PATCH] c++: Fix noexcept with unevaluated operand [PR101087]

2021-07-08 Thread Jason Merrill via Gcc-patches
On 7/7/21 9:40 PM, Marek Polacek wrote: It sounds plausible that this assert int f(); static_assert(noexcept(sizeof(f(; should pass: sizeof produces a std::size_t and its operand is not evaluated, so it can't throw. noexcept should only evaluate to false for potentially evaluated

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

2021-07-08 Thread Martin Jambor
Hi, On Wed, Jul 07 2021, Qing Zhao via Gcc-patches wrote: > Hi, > > This is the 4th version of the patch for the new security feature for GCC. I have been following the threads about this feature only very lightly, so please accept my apologies if my comments are about something which has been

Re: [PATCH] ipa-sra: Fix thinko when overriding safe_to_import_accesses (PR 101066)

2021-07-08 Thread Jan Hubicka
Hi, > 2021-06-16 Martin Jambor > > PR ipa/101066 > * ipa-sra.c (class isra_call_summary): New member > m_before_any_store, initialize it in the constructor. > (isra_call_summary::dump): Dump the new field. > (ipa_sra_call_summaries::duplicate): Copy it. >

Re: [PATCH 09/10] vect: Simplify get_initial_def_for_reduction

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:49 PM Richard Sandiford via Gcc-patches wrote: > > After previous patches, we can now easily provide the neutral op > as an argument to get_initial_def_for_reduction. This in turn > allows the adjustment calculation to be moved outside of > get_initial_def_for_reduction,

Re: [PATCH 08/10] vect: Generalise neutral_op_for_slp_reduction

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:48 PM Richard Sandiford via Gcc-patches wrote: > > This patch generalises the interface to neutral_op_for_slp_reduction > so that it can be used for non-SLP reductions too. This isn't much > of a win on its own, but it helps later patches. I guess that makes sense - OK.

Re: [PATCH 05/10] vect: Add a vect_phi_initial_value helper function

2021-07-08 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Thu, Jul 8, 2021 at 2:45 PM Richard Sandiford via Gcc-patches > wrote: >> >> This patch adds a helper function called vect_phi_initial_value >> for returning the incoming value of a given loop phi. The main >> reason for adding it is to ensure that the right

Re: [PATCH 06/10] vect: Pass reduc_info to get_initial_defs_for_reduction

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:46 PM Richard Sandiford via Gcc-patches wrote: > > This patch passes the reduc_info to get_initial_defs_for_reduction, > so that the function can get general information from there rather > than from the first SLP statement. This isn't a win on its own, > but it becomes

RE: [PATCH] testsuite: Add arm_arch_v7a_ok effective-target to pr57351.c

2021-07-08 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Gcc-patches bounces+kyrylo.tkachov=arm@gcc.gnu.org> On Behalf Of Christophe > Lyon via Gcc-patches > Sent: 07 July 2021 13:24 > To: Christophe LYON > Cc: gcc Patches > Subject: Re: [PATCH] testsuite: Add arm_arch_v7a_ok effective-target to > pr57351.c

Re: [PATCH 05/10] vect: Add a vect_phi_initial_value helper function

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:45 PM Richard Sandiford via Gcc-patches wrote: > > This patch adds a helper function called vect_phi_initial_value > for returning the incoming value of a given loop phi. The main > reason for adding it is to ensure that the right preheader edge > is used when

Re: [PATCH 04/10] vect: Ensure reduc_inputs always have vectype

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:44 PM Richard Sandiford via Gcc-patches wrote: > > Vector reduction accumulators can differ in signedness from the > final scalar result. The conversions to handle that case were > distributed through vect_create_epilog_for_reduction; this patch > does the conversion

Re: [PATCH 03/10] vect: Remove new_phis from

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:43 PM Richard Sandiford via Gcc-patches wrote: > > vect_create_epilog_for_reduction had a variable called new_phis. > It collected the statements that produce the exit block definitions > of the vector reduction accumulators. Although those statements > are indeed phis

Re: [PATCH 02/10] vect: Create array_slice of live-out stmts

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:42 PM Richard Sandiford via Gcc-patches wrote: > > This patch constructs an array_slice of the scalar statements that > produce live-out reduction results in the original unvectorised loop. > There are three cases: > > - SLP reduction chains: the final SLP stmt is

Re: [PATCH 01/10] vect: Simplify epilogue reduction code

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:41 PM Richard Sandiford via Gcc-patches wrote: > > vect_create_epilog_for_reduction only handles two cases: single-loop > reductions and double reductions. “nested cycles” (i.e. reductions > in the inner loop when vectorising an outer loop) are handled elsewhere > and

Re: [x86_64 PATCH]: Improvement to signed division of integer constant.

2021-07-08 Thread Uros Bizjak via Gcc-patches
On Thu, Jul 8, 2021 at 10:25 AM Roger Sayle wrote: > > > This patch tweaks the way GCC handles 32-bit integer division on > x86_64, when the numerator is constant. Currently the function > > int foo (int x) { > return 100/x; > } > > generates the code: > foo:movl$100, %eax >

Re: [PATCH] PR tree-optimization/38943: Preserve trapping instructions with -fnon-call-exceptions

2021-07-08 Thread Eric Botcazou
> This patch has been tested on x86_64-pc-linux-gnu with a "make > bootstrap" and "make -k check" with no new failures. This should > be relatively safe, as there are no changes in behaviour unless > the user explicitly specifies -fnon-call-exceptions, when the C > compiler then behaves more like

[PATCH 10/10] vect: Reuse reduction accumulators between loops

2021-07-08 Thread Richard Sandiford via Gcc-patches
This patch adds support for reusing a main loop's reduction accumulator in an epilogue loop. This in turn lets the loops share a single piece of vector->scalar reduction code. The patch has the following restrictions: (1) The epilogue reduction can only operate on a single vector (e.g.

[PATCH 09/10] vect: Simplify get_initial_def_for_reduction

2021-07-08 Thread Richard Sandiford via Gcc-patches
After previous patches, we can now easily provide the neutral op as an argument to get_initial_def_for_reduction. This in turn allows the adjustment calculation to be moved outside of get_initial_def_for_reduction, which is the main motivation of the patch. gcc/ * tree-vect-loop.c

[PATCH 08/10] vect: Generalise neutral_op_for_slp_reduction

2021-07-08 Thread Richard Sandiford via Gcc-patches
This patch generalises the interface to neutral_op_for_slp_reduction so that it can be used for non-SLP reductions too. This isn't much of a win on its own, but it helps later patches. gcc/ * tree-vect-loop.c (neutral_op_for_slp_reduction): Replace with...

[PATCH 07/10] vect: Pass reduc_info to get_initial_def_for_reduction

2021-07-08 Thread Richard Sandiford via Gcc-patches
Similarly to the previous patch, this one passes the reduc_info to get_initial_def_for_reduction, rather than a stmt_vec_info that lacks the metadata. This again becomes useful later. gcc/ * tree-vect-loop.c (get_initial_def_for_reduction): Take the reduc_info instead of the

[PATCH 06/10] vect: Pass reduc_info to get_initial_defs_for_reduction

2021-07-08 Thread Richard Sandiford via Gcc-patches
This patch passes the reduc_info to get_initial_defs_for_reduction, so that the function can get general information from there rather than from the first SLP statement. This isn't a win on its own, but it becomes important with later patches. gcc/ * tree-vect-loop.c

[PATCH 05/10] vect: Add a vect_phi_initial_value helper function

2021-07-08 Thread Richard Sandiford via Gcc-patches
This patch adds a helper function called vect_phi_initial_value for returning the incoming value of a given loop phi. The main reason for adding it is to ensure that the right preheader edge is used when vectorising nested loops. (PHI_ARG_DEF_FROM_EDGE itself doesn't assert that the given edge

[PATCH 04/10] vect: Ensure reduc_inputs always have vectype

2021-07-08 Thread Richard Sandiford via Gcc-patches
Vector reduction accumulators can differ in signedness from the final scalar result. The conversions to handle that case were distributed through vect_create_epilog_for_reduction; this patch does the conversion up-front instead. gcc/ * tree-vect-loop.c (vect_create_epilog_for_reduction):

[PATCH 03/10] vect: Remove new_phis from

2021-07-08 Thread Richard Sandiford via Gcc-patches
vect_create_epilog_for_reduction had a variable called new_phis. It collected the statements that produce the exit block definitions of the vector reduction accumulators. Although those statements are indeed phis initially, they are often replaced with normal statements later, leading to puzzling

[PATCH 02/10] vect: Create array_slice of live-out stmts

2021-07-08 Thread Richard Sandiford via Gcc-patches
This patch constructs an array_slice of the scalar statements that produce live-out reduction results in the original unvectorised loop. There are three cases: - SLP reduction chains: the final SLP stmt is live-out - full SLP reductions: all SLP stmts are live-out - non-SLP reductions: the single

[PATCH 01/10] vect: Simplify epilogue reduction code

2021-07-08 Thread Richard Sandiford via Gcc-patches
vect_create_epilog_for_reduction only handles two cases: single-loop reductions and double reductions. “nested cycles” (i.e. reductions in the inner loop when vectorising an outer loop) are handled elsewhere and don't need a vector->scalar reduction. The function had variables called

[PATCH 00/10] vect: Reuse reduction accumulators between loops

2021-07-08 Thread Richard Sandiford via Gcc-patches
Quoting from the final patch in the series: This patch adds support for reusing a main loop's reduction accumulator in an epilogue loop. This in turn lets the loops share a single piece of vector->scalar reduction code.

Re: [committed] match.pd: Relax rule to include POLY_INT_CSTs

2021-07-08 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Thu, Jul 8, 2021 at 1:52 PM Richard Sandiford via Gcc-patches > wrote: >> >> match.pd has a rule to simplify an extension, operation and truncation >> back to the original type: >> >> (simplify >>(convert (op:s@0 (convert1?@3 @1) (convert2?@4

Re: [PATCH] ifcvt: Improve tests for predicated operations

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 2:04 PM Richard Sandiford via Gcc-patches wrote: > > -msve-vector-bits=128 causes the AArch64 port to list 128-bit Advanced > SIMD as the first-choice mode for vectorisation, with SVE being used for > things that Advanced SIMD can't handle as easily. However, ifcvt would >

Re: [committed] match.pd: Relax rule to include POLY_INT_CSTs

2021-07-08 Thread Richard Biener via Gcc-patches
On Thu, Jul 8, 2021 at 1:52 PM Richard Sandiford via Gcc-patches wrote: > > match.pd has a rule to simplify an extension, operation and truncation > back to the original type: > > (simplify >(convert (op:s@0 (convert1?@3 @1) (convert2?@4 @2))) > > Currently it handles cases in which @2 is an

[PATCH] ifcvt: Improve tests for predicated operations

2021-07-08 Thread Richard Sandiford via Gcc-patches
-msve-vector-bits=128 causes the AArch64 port to list 128-bit Advanced SIMD as the first-choice mode for vectorisation, with SVE being used for things that Advanced SIMD can't handle as easily. However, ifcvt would not then try to use SVE's predicated FP arithmetic, leading to tests like TSVC

[committed] vect: Remove always-true condition

2021-07-08 Thread Richard Sandiford via Gcc-patches
vectorizable_reduction had code guarded by: if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def || STMT_VINFO_DEF_TYPE (stmt_info) == vect_double_reduction_def) But that's always true after: if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def && STMT_VINFO_DEF_TYPE

[committed] match.pd: Relax rule to include POLY_INT_CSTs

2021-07-08 Thread Richard Sandiford via Gcc-patches
match.pd has a rule to simplify an extension, operation and truncation back to the original type: (simplify (convert (op:s@0 (convert1?@3 @1) (convert2?@4 @2))) Currently it handles cases in which @2 is an INTEGER_CST, but it also works for POLY_INT_CSTs.[*] For INTEGER_CST it doesn't

  1   2   >