Re: RFC: Changing AC_PROG_CC to AC_PROG_CC_C99 in top level configure

2021-05-05 Thread Iain Sandoe via Gcc-patches
Alan Modra via Gcc-patches wrote: On 2021-05-04 8:42 a.m., Nick Clifton wrote: Hi Guys, On 4/30/21 7:36 PM, Simon Marchi wrote: I think this fix is obvious enough, I encourage you to push it, OK - I have pushed the patch to the mainline branches of both the gcc and binutils-gdb repositorie

Re: [PATCH] testsuite: Add s390 to gcc.dg/vect/slp-21.c

2021-05-05 Thread Richard Biener via Gcc-patches
On Tue, May 4, 2021 at 7:43 PM Robin Dapp via Gcc-patches wrote: > > Hi, > > on s390 we vectorize 4 statements using SLP. Add s390*-*-* to the > appropriate dg-finals. > > Is that OK? sure > Regards > Robin > > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/slp-21.c: Add s390.

Re: RFC: Changing AC_PROG_CC to AC_PROG_CC_C99 in top level configure

2021-05-05 Thread Alan Modra via Gcc-patches
On Wed, May 05, 2021 at 08:05:29AM +0100, Iain Sandoe wrote: > Alan Modra via Gcc-patches wrote: > > > On 2021-05-04 8:42 a.m., Nick Clifton wrote: > > > Hi Guys, > > > > > > On 4/30/21 7:36 PM, Simon Marchi wrote: > > > > I think this fix is obvious enough, I encourage you to push it, > > > >

Re: RFC: Changing AC_PROG_CC to AC_PROG_CC_C99 in top level configure

2021-05-05 Thread Iain Sandoe via Gcc-patches
Alan Modra wrote: On Wed, May 05, 2021 at 08:05:29AM +0100, Iain Sandoe wrote: Alan Modra via Gcc-patches wrote: On 2021-05-04 8:42 a.m., Nick Clifton wrote: Hi Guys, On 4/30/21 7:36 PM, Simon Marchi wrote: I think this fix is obvious enough, I encourage you to push it, OK - I have pus

[PATCH] PR rtl-optimization/100263: Ensure register can change mode

2021-05-05 Thread Stefan Schulze Frielinghaus via Gcc-patches
For move2add_valid_value_p we also have to ask the target whether a register can be accessed in a different mode than it was set before. gcc/ChangeLog: PR rtl-optimization/100263 * postreload.c (move2add_valid_value_p): Ensure register can change mode. Bootstrapped and re

Re: [PATCH] run early sprintf warning after SSA (PR 100325)

2021-05-05 Thread Richard Biener via Gcc-patches
On Wed, May 5, 2021 at 1:32 AM Martin Sebor via Gcc-patches wrote: > > With no optimization, -Wformat-overflow and -Wformat-truncation > runs early to detect a subset of simple bugs. But as it turns out, > the pass runs just a tad too early, before SSA. That causes it to > miss a class of proble

Re: [PATCH] -Walloca-larger-than with constant sizes at -O0 (PR 100425)

2021-05-05 Thread Richard Biener via Gcc-patches
On Wed, May 5, 2021 at 4:20 AM Martin Sebor via Gcc-patches wrote: > > Even when explicitly enabled, -Walloca-larger-than doesn't run > unless optimization is enabled as well. This prevents diagnosing > alloca calls with constant arguments in excess of the limit that > could otherwise be flagged

Re: [PATCH] [PR91400] build only one __cpu_model variable

2021-05-05 Thread Richard Biener via Gcc-patches
On Mon, May 3, 2021 at 11:31 AM Ivan Sorokin via Gcc-patches wrote: > > Prior to this commit GCC -O2 generated quite bad code for this > function: > > bool f() > { > return __builtin_cpu_supports("popcnt") > && __builtin_cpu_supports("ssse3"); > } > > f: > movl__cpu_model+1

Re: [PATCH v2 0/2] OpenRISC support for cmodel=large

2021-05-05 Thread Giulio Benetti
Hi Stafford, All, > Il giorno 5 mag 2021, alle ore 08:30, Stafford Horne ha > scritto: > > On Mon, May 03, 2021 at 12:34:22PM +0200, Giulio Benetti wrote: >> Hi Stafford, All, >> >> I've backported this patchset for Buildroot to versions: >> - 9.3.0 >> - 10.3.0 >> >> Does it make sense to se

[PATCH] tree-optimization/79333 - fold stmts following SSA edges in VN

2021-05-05 Thread Richard Biener
This makes sure to follow SSA edges when folding eliminated stmts. This reaps the same benefit as forwprop folding all stmts, not waiting for one to produce copysign in the new testcase. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. 2021-05-04 Richard Biener PR tree-o

[Patch, committed] g++.dg/gomp/clause-3.C: Fix - missing in r12-438-g1580fc7 [PR100422]

2021-05-05 Thread Tobias Burnus
Committed as r12-477-gaf4e4d35f0b84d7c2f57a7b682a09116e9911142 Was missing in commit r12-438-g1580fc764423bf89e9b853aaa8c65999e37ccb8b OpenMP: Support complex/float in && and || reduction Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergeric

[Ada] Set constraint error on real division just like on integer division

2021-05-05 Thread Pierre-Marie de Rodat
In Eval_Arithmetic_Op we set Raises_Constraint_Error flag on integer division by zero, but we didn't set it for real division by zero. This only affects GNATprove, because GNAT sets this flag inside Apply_Compile_Time_Constraint_Error (which has an early return guarded by GNATprove_Mode). Possibly

[Ada] Ongoing work for AI12-0212: container aggregates

2021-05-05 Thread Pierre-Marie de Rodat
Add legality checks for indexed aggregates with component associations. RN 4.3.5 (28/5 - 30/5) specifies validity rules for indexed aggregates, intended to simplify implementation as well as the computation of the expected size of an indexed aggregate, such for an aggregaate of a vector type. Tes

[Ada] Implement tiered support for floating-point output operations

2021-05-05 Thread Pierre-Marie de Rodat
This changes the implementation of output operations for floating-point types from using Long_Long_Float for all floating-point types to using a base type tailored to the type being operated on. This comprises adjusting Ada.Text_IO.Float_IO and Ada.Text_IO.Complex_IO to the new approach, as well a

[Ada] Remove unnecessary parameter of Apply_Compile_Time_Constraint_Error

2021-05-05 Thread Pierre-Marie de Rodat
In routine Apply_Compile_Time_Constraint_Error the Rep parameter was disabling rewriting into N_Raise_Constraint_Error node. It is only referenced when this routine is called from GNATprove, but in GNATprove_Mode rewriting is disabled anyway. It seems cleaner to remove this parameter and keep this

[Ada] Refactor repeated call to Next when pretty-printing if-expressions

2021-05-05 Thread Pierre-Marie de Rodat
Code cleanup (and minuscule performance improvement); semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * pprint.adb (Expr_Name): Introduce local constants to make the code more readable and avoid repeated calls to Next to reach the ELSE

[Ada] Remove redundant explicit calls to UI_From_Int in comparisons

2021-05-05 Thread Pierre-Marie de Rodat
Relational operators for universal integers come in three variants, e.g.: function "=" (Left : Uint; Right : Uint) return Boolean renames UI_Eq; function "=" (Left : Int; Right : Uint) return Boolean renames UI_Eq; function "=" (Left : Uint; Right : Int) return Boolean renames UI_Eq; p

[Ada] Adjust expansion of perfect hash function for Value

2021-05-05 Thread Pierre-Marie de Rodat
This moves the declaration of the 4 tables to inside the function itself for reasons explained in the code. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_imgv.ads (Build_Enumeration_Image_Tables): Adjust comment. * exp_imgv.adb (Build_Enumeration_Image_Tables):

[Ada] Use inline expansion of Image for enumeration types by default

2021-05-05 Thread Pierre-Marie de Rodat
This reduces the number of bootstrap dependencies for the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d_x): Document new usage. * exp_imgv.adb (Expand_User_Defined_Enumeration_Image): Add Typ parameter and use it throughout the proces

[Ada] Handle defaults in declare_expressions in postconditions

2021-05-05 Thread Pierre-Marie de Rodat
In Ada2020 the expression for a postcondition can be a Declare_Expression containing object declarations with defaults. These defaults may generate local subtypes, but as for other default expressions their full expansion must be deferred, typically to the freeze point of the object being declared,

[Ada] Speed up enumeration'Value with perfect hash function

2021-05-05 Thread Pierre-Marie de Rodat
This speeds up the implementation of the Value attribute for enumeration types with more than 3 values by using a perfect hash function to do the lookup instead of a linear search. This also generizes the implementation of the associated support routines in the runtime, as well as that of the supp

[Ada] Don't emit style errors when parens are required

2021-05-05 Thread Pierre-Marie de Rodat
GNAT currently emits style errors for declare expressions in conditions even though their parens are required. This commit fixes that. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch5.adb (P_Condition): Check if expression is declare expression.diff --git a/gc

[Ada] Qualify internal access-to-subprogram types as not null

2021-05-05 Thread Pierre-Marie de Rodat
When an access-to-subprogram type is qualified as not null, then the compiler is likely to generate a more efficient code. This patch adds such qualifiers to the internal runtime bodies, so no clients of those runtime units are affected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Small cleanup in the Expand_Image_Attribute procedure

2021-05-05 Thread Pierre-Marie de Rodat
This moves the inline expansion for user-defined enumeration types back into the normal flow of control, moves the declarations of local objects to where they are needed and removes an explicit check for private types in the enumeration case, which is now superfluous. No functional changes. Teste

[Ada] Use inline expansion of Image for standard boolean by default

2021-05-05 Thread Pierre-Marie de Rodat
This avoids a call to the runtime and a string copy. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d_x): Document extended usage. * exp_imgv.adb (Expand_Standard_Boolean_Image): New procedure. (Expand_Image_Attribute): Call it to expand in line t

[Ada] Move Build_And_Insert_CUDA_Initialization to expansion phase

2021-05-05 Thread Pierre-Marie de Rodat
This function really had no business being called during analysis. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb (Expand_N_Package_Body): Add CUDA init call. * sem_ch7.adb (Analyze_Package_Body_Helper): Remove CUDA init call.diff --git a/gcc/ada

[Ada] Spurious warning on useless assignment with target name

2021-05-05 Thread Pierre-Marie de Rodat
An assignment to an entity E triggers an improper warning that an immediately preceding assignment to E is useless, when the right-hand side of the new assignment includes a target name, that is to say the Ada2020 use of "@" to designate the left-hand side of the assignment. Tested on x86_64-pc-li

[Ada] Detect unchecked union components with fully qualified names

2021-05-05 Thread Pierre-Marie de Rodat
Unchecked union components were detected only when declared with unqualified type names. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Component_Is_Unconstrained_UU): Detect both qualified and unqualified names of unchecked union components.diff --git

[Ada] Fix s-os_lib.adb so vectorizing compilation works

2021-05-05 Thread Pierre-Marie de Rodat
Fix s-os_lib.adb so vectorizing compilation works. Without this, the compiler crashes while compiling s-os_lib.adb. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-os_lib.adb (Missed_Drive_Letter): Simplify the code.diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/

[Ada] Remove redundant checks for empty lists

2021-05-05 Thread Pierre-Marie de Rodat
When iterating over list elements with First/Next there is no need to detect empty or non-existing list, because First intentionally returns Empty in those cases. Cleanup of code related to Unchecked_Unions; behaviour is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Do not use hash function for enumeration Value with trampolines

2021-05-05 Thread Pierre-Marie de Rodat
This prevents the generation of the new perfect hash function for the Value attribute of local enumeration types when the target still uses trampolines to implement pointers to local subprograms. The generation of trampolines would be unexpected in these circumstances and maybe even forbidden by t

[Ada] Refine types of variables with call to Scope as their initial values

2021-05-05 Thread Pierre-Marie de Rodat
Call to Scope returns an Entity_Id, not just Node_Id. This patch refines the types in two occurrences of a call to Scope as an initial value. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (User_Defined_Primitive_Equality_

[Ada] Remove commented code

2021-05-05 Thread Pierre-Marie de Rodat
The comment indicates that "The whole section including this comment can be removed later ???", and 10 years qualifies as "later". Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Is_Possibly_Unaligned_Object): Remove commented code.diff --git a/gcc/ada/

[Ada] Incorrect accessibility level on actual in procedure call

2021-05-05 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby dispatching calls to subprograms featuring anonymous access formals may get incorrectly expanded in such a way so as to lead to spurious runtime accessibility check failures within the callee. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/

[Ada] Detect unchecked union subcomponents in nested variant parts

2021-05-05 Thread Pierre-Marie de Rodat
Routine Has_Unconstrained_UU_Component didn't traverse into nested variant parts of a record type definition. Now it precisely follows the Ada RM grammar to make sure that the traversal doesn't miss anything. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Has_U

[Ada] Fix expansion of attributes Input/Output for unchecked union types

2021-05-05 Thread Pierre-Marie de Rodat
Expansion of attributes Input/Output for unchecked unions didn't work, because it looked for a No_Elist where the AST has an empty list. Now we look for a default value of a first discriminant (because the default values must be given either for all or for none of the discrminants). Also, it was w

[Ada] Reuse Has_Defaulted_Discriminants where possible

2021-05-05 Thread Pierre-Marie de Rodat
Remove excessive defensive check from Has_Defaulted_Discriminants and reuse it where possible. Cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb, exp_ch9.adb, sem_ch3.adb: Reuse Has_Defaulted_Discriminants. *

RE: [RFC v2] bpf.2: Use standard types and attributes

2021-05-05 Thread David Laight via Gcc-patches
From: Florian Weimer > Sent: 04 May 2021 20:46 > > * Alejandro Colomar: > > > The thing is, in all of those threads, the only reasons to avoid > > types in the kernel (at least, the only explicitly > > mentioned ones) are (a bit simplified, but this is the general idea of > > those threads): > >

Re: [PR97903][ARM] Missed optimization in lowering to vtst

2021-05-05 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 5 Feb 2021 at 15:42, Kyrylo Tkachov wrote: > > Hi Prathamesh, > > > -Original Message- > > From: Prathamesh Kulkarni > > Sent: 05 February 2021 09:53 > > To: gcc Patches ; Kyrylo Tkachov > > > > Subject: [PR97903][ARM] Missed optimization in lowering to vtst > > > > Hi, > > For t

[PATCH] libcpp: Fix up -fdirectives-only preprocessing of includes not ending with newline [PR100392]

2021-05-05 Thread Jakub Jelinek via Gcc-patches
Hi! If a header doesn't end with a new-line, with -fdirectives-only we right now preprocess it as int i = 1;# 2 "pr100392.c" 2 i.e. the line directive isn't on the next line, which means we fail to parse it when compiling. GCC 10 and earlier libcpp/directives-only.c had for this: if (!pfile->st

RE: [PR97903][ARM] Missed optimization in lowering to vtst

2021-05-05 Thread Kyrylo Tkachov via Gcc-patches
Hi Prathamesh, > -Original Message- > From: Prathamesh Kulkarni > Sent: 05 May 2021 09:35 > To: Kyrylo Tkachov > Cc: gcc Patches > Subject: Re: [PR97903][ARM] Missed optimization in lowering to vtst > > On Fri, 5 Feb 2021 at 15:42, Kyrylo Tkachov > wrote: > > > > Hi Prathamesh, > > >

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-05 Thread Richard Biener via Gcc-patches
On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus wrote: > > [snip] > > Please find attached a new version of the patch. A major change compared to > the previous patch is that I created a separate pass which hopefully makes > reviewing also easier since it is almost self-contained. Af

Re: [PATCH v2] IBM Z: Handle hard registers in s390_md_asm_adjust()

2021-05-05 Thread Andreas Krebbel via Gcc-patches
On 5/3/21 1:09 PM, Ilya Leoshkevich wrote: > On Fri, 2021-04-30 at 08:49 +0200, Andreas Krebbel wrote: >> On 4/28/21 3:48 AM, Ilya Leoshkevich wrote: >>> Bootstrapped and regtested on s390x-redhat-linux.  Tested with >>> valgrind >>> too (PR 100278 is now fixed).  Ok for master? >>> >>> v1: >>> htt

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: This rewrites ranges::minmax and ranges::minmax_element so that it performs at most 3*N/2 many comparisons, as required by the standard. In passing, this also fixes PR100387 by avoiding a premature std::move in ranges::minmax and in std:

Re: [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: These constraints are already present on the template we're partially specilalizing for. [ This was recently fixed editorially in https://github.com/cplusplus/draft/pull/4519 ] Tested on x86_64-pc-linux-gnu, does this look OK for trunk

Re: [PATCH] libstdc++: Implement LWG 3517 and 3520 for transform_view/join_view

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 10/11? Yes, for all branches. libstdc++-v3/ChangeLog: * include/std/ranges (transform_view::_Iterator::iter_swap): Remove as per LWG 3520.

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 10:39 +0100, Jonathan Wakely wrote: On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: This rewrites ranges::minmax and ranges::minmax_element so that it performs at most 3*N/2 many comparisons, as required by the standard. In passing, this also fixes PR100387 by avoiding a

[patch, committed] libgfortran/intrinsics/chmod.c: Silence unused var warning

2021-05-05 Thread Tobias Burnus
Found with amdgcn – silences a build warning there. Committed as r12-509-gdee371fdd4ae25f837b9b2ded7789d07ed739c9e Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf c

[GCC][PATCH] arm: Remove duplicate definitions from arm_mve.h (pr100419).

2021-05-05 Thread Srinath Parvathaneni via Gcc-patches
Hi All, This patch removes several duplicated intrinsic definitions from arm_mve.h mentioned in PR100419 and also fixes the wrong arguments in few of intrinsics polymorphic variants. Regression tested and found no issues. Ok for master ? GCC-11 and GCC-10 branch backports? gcc/ChangeLog: 2021-0

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 04/05/21 08:03 +0200, François Dumont wrote: On 03/05/21 11:06 pm, Jonathan Wakely wrote: On 03/05/21 22:17 +0200, François Dumont via Libstdc++ wrote: Is it too early to consider this patch ? Or just lack of time ? I haven't had time to review it yet, but my general feeling hasn't changed

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-05 Thread Richard Biener via Gcc-patches
On Wed, May 5, 2021 at 11:36 AM Richard Biener wrote: > > On Tue, Mar 16, 2021 at 6:13 PM Stefan Schulze Frielinghaus > wrote: > > > > [snip] > > > > Please find attached a new version of the patch. A major change compared to > > the previous patch is that I created a separate pass which hopeful

Re: [patch] Generate debug info for local dynamic record types

2021-05-05 Thread Eric Botcazou
> OK. Thanks. > I suppose there's no easy way to build a gnat.dg "guality" testcase for > this? On all the platforms I test, I have a bunch of guality failures so I'm not really thrilled by the idea... This should be covered by the GDB testsuite run with -fgnat-encodings=minimal but it's actu

Re: [GCC][PATCH] arm: Remove duplicate definitions from arm_mve.h (pr100419).

2021-05-05 Thread Richard Earnshaw via Gcc-patches
On 05/05/2021 10:56, Srinath Parvathaneni via Gcc-patches wrote: Hi All, This patch removes several duplicated intrinsic definitions from arm_mve.h mentioned in PR100419 and also fixes the wrong arguments in few of intrinsics polymorphic variants. Regression tested and found no issues. Ok f

Re: [PATCH] PR rtl-optimization/100263: Ensure register can change mode

2021-05-05 Thread Eric Botcazou
> For move2add_valid_value_p we also have to ask the target whether a > register can be accessed in a different mode than it was set before. > > gcc/ChangeLog: > > PR rtl-optimization/100263 > * postreload.c (move2add_valid_value_p): Ensure register can > change mode. > > Boots

[patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Eric Botcazou
Hi, this is the bootstrap failure of GCC 11 on MinGW64 configured with --enable- tune=nocona. The bottom line is that SEH does not support CFI for epilogues but the x86 back-end nevertheless attaches it to instructions, so we have to filter it out and this is done by detecting the end of the pr

Re: [patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Wed, May 05, 2021 at 01:00:35PM +0200, Eric Botcazou wrote: > 2021-05-05 Eric Botcazou > > PR rtl-optimization/100411 > * cfgcleanup.c (try_crossjump_to_edge): Also skip end of prologue > and beginning of function markers. > > -- > Eric Botcazou > diff --git a/gcc/cfgcle

Re: [patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Eric Botcazou
> I mean, can't we have just one while loop that skips over all debug insns, > NOTE_INSN_BASIC_BLOCK_P, NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG > and stops on anything else, or, if we want to skip at most one of some or > all of those note kinds, do some tracking if we've already skipped

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 24/04/21 15:46 +0200, François Dumont via Libstdc++ wrote: Hi     Here is the patch to add backtrace generation on _GLIBCXX_DEBUG assertions thanks to libbacktrace.     In addition to this integration I am also improving the generation of the assertion message thanks to the "%.*s" printf

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Andre Vieira (lists) via Gcc-patches
Hi Richi, So I'm trying to look at what IVOPTs does right now and how it might be able to help us. Looking at these two code examples: #include #if 0 int foo(short * a, short * b, unsigned int n) {     int sum = 0;     for (unsigned int i = 0; i < n; ++i)     sum += a[i] + b[i];     retur

Re: [patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Wed, May 05, 2021 at 01:21:20PM +0200, Eric Botcazou wrote: > > I mean, can't we have just one while loop that skips over all debug insns, > > NOTE_INSN_BASIC_BLOCK_P, NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG > > and stops on anything else, or, if we want to skip at most one of some or

Re: [PATCH] phiopt: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Richard Biener
On Tue, 4 May 2021, Jakub Jelinek wrote: > Hi! > > genericize_spaceship genericizes i <=> j to approximately > ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else c = 1; c; }) > for strong ordering and > ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; > else c =

Re: [PATCH] phiopt: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Marc Glisse
On Tue, 4 May 2021, Jakub Jelinek via Gcc-patches wrote: 2) the pr94589-2.C testcase should be matching just 12 times each, but runs into operator>=(strong_ordering, unspecified) being defined as (_M_value&1)==_M_value rather than _M_value>=0. When not honoring NaNs, the 2 case should be unreac

[committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-05 Thread Jonathan Wakely via Gcc-patches
Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char to std::isdigit. Tested powerpc64le-linux. Committed to trunk. commit d0d6ca019717305df0ef41e3fe1da48f7f561fac Author: Jon

[committed] libstdc++: Add tests for std::invoke feature test macro

2021-05-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/20_util/function_objects/invoke/3.cc: Check feature test macro. * testsuite/20_util/function_objects/invoke/version.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit 29745bf06276b9628d08ef1c9e28890cc56df4aa Author: Jona

Re: [patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Eric Botcazou
> At least for NOTE_INSN_BASIC_BLOCK skipping more than one might > be problematic, because that would mean we've skipped into a different basic > block and it wouldn't surprise me if split_block in that case crashed or > did something weird (if the first argument is not BLOCK_FOR_INSN of the > sec

[Alert]: ASSIGNMENT ($500.00)

2021-05-05 Thread LifePoints Research , Inc . ® via Gcc-patches
Dear Prospective Panelist, You have been selected as a Customer Satisfaction Analyst to participate in our short exclusive 10-15 minutes paid project study on Walmart,Walgreens & CVS stores within your area. REWARDS: You will earn $500.00 for each completed survey project. SURVEY [#53779-1001

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Richard Biener
On Wed, 5 May 2021, Andre Vieira (lists) wrote: > Hi Richi, > > So I'm trying to look at what IVOPTs does right now and how it might be able > to help us. Looking at these two code examples: > #include > #if 0 > int foo(short * a, short * b, unsigned int n) > { >     int sum = 0; >     for (unsi

Re: [patch] Fix PR rtl-optimization/100411

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Wed, May 05, 2021 at 02:19:27PM +0200, Eric Botcazou wrote: > > At least for NOTE_INSN_BASIC_BLOCK skipping more than one might > > be problematic, because that would mean we've skipped into a different basic > > block and it wouldn't surprise me if split_block in that case crashed or > > did so

RE: [GCC][PATCH] arm: Remove duplicate definitions from arm_mve.h (pr100419).

2021-05-05 Thread Srinath Parvathaneni via Gcc-patches
Hi Richard, > -Original Message- > From: Richard Earnshaw > Sent: 05 May 2021 11:15 > To: Srinath Parvathaneni ; gcc- > patc...@gcc.gnu.org > Cc: Richard Earnshaw > Subject: Re: [GCC][PATCH] arm: Remove duplicate definitions from > arm_mve.h (pr100419). > > > > On 05/05/2021 10:56, Sr

Re: [PATCH] Remove CC0

2021-05-05 Thread Segher Boessenkool
Hi~ On Tue, May 04, 2021 at 04:08:22PM +0100, Richard Earnshaw wrote: > On 03/05/2021 23:55, Segher Boessenkool wrote: > >CC_STATUS_INIT is suggested in final.c to also be useful for ports that > >are not CC0, and at least arm seems to use it for something. So I am > >leaving that alone, but most

[wwwdocs] Remove powerpcspe from backends.html

2021-05-05 Thread Segher Boessenkool
Committed. Segher --- htdocs/backends.html | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/backends.html b/htdocs/backends.html index 8034a5776360..f80378b90170 100644 --- a/htdocs/backends.html +++ b/htdocs/backends.html @@ -103,7 +103,6 @@ nios2 | C ia nvptx

Re: [wwwdocs] Remove CC0 from backends.html

2021-05-05 Thread Segher Boessenkool
On Tue, May 04, 2021 at 06:30:04PM +0200, Eric Botcazou wrote: > > Pushed. What is next? :-) > > You can finally remove powerpcspe. :-) Done, thanks! Segher

Re: [PATCH] ipa-sra: Do not bail out when callers cannot be cloned

2021-05-05 Thread Richard Biener via Gcc-patches
On Tue, Apr 27, 2021 at 5:29 PM Martin Jambor wrote: > > Hi, > > IPA-SRA fails to produce (very simple) edge summaries when a caller > cannot be cloned or its signature cannot be changed which makes it > less powerful for no good reason. This patch fixes that problem. > > Bootstrapped, LTO-bootst

Re: [PATCH][PR94156] Split COMDAT groups on target that do not support them

2021-05-05 Thread Richard Biener via Gcc-patches
On Tue, Mar 23, 2021 at 5:29 PM Markus Böck via Gcc-patches wrote: > > GCC at the moment uses COMDAT groups for things like virtual thunks, > even on targets that do not support COMDAT groups. This has not been a > problem as on platforms not supporting these (such as PE COFF on > Windows), the ba

[PATCH] AArch64: Improve GOT addressing

2021-05-05 Thread Wilco Dijkstra via Gcc-patches
Improve GOT addressing by emitting the instructions as a pair. This reduces register pressure and improves code quality. With -fPIC codesize improves by 0.65% and SPECINT2017 improves by 0.25%. Passes bootstrap and regress. OK for commit? ChangeLog: 2021-05-05 Wilco Dijkstra * confi

[PATCH] phiopt, v2: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Wed, May 05, 2021 at 01:39:32PM +0200, Richard Biener wrote: > Can you in the above IL snippets mark COND_BB and MIDDLE_BB? ... Thanks. Here is an updated patch (attached) and interdiff from previous patch. Ok for trunk if it passes bootstrap/regtest? --- gcc/tree-ssa-phiopt.c 2021-05-03

[PATCH] i386: Implement integer vector compares for 64bit vectors [PR98218]

2021-05-05 Thread Uros Bizjak via Gcc-patches
Implement integer vector compares for 64bit vectors for TARGET_MMX_WITH_SSE. 2021-05-05 Uroš Bizjak gcc/ PR target/98218 * config/i386/i386-expand.c (ix86_expand_int_sse_cmp): Handle V8QI, V4HI and V2SI modes. * config/i386/i386.c (ix86_build_const_vector): Handle V2SImode.

[GCC-10 backport][PATCH] arm: Fix testisms introduced with fix for pr target/95646.

2021-05-05 Thread Srinath Parvathaneni via Gcc-patches
Hi, This is a backport to gcc-10, cleanly applied on the branch. This patch changes the test to use the effective-target machinery disables the error message "ARMv8-M Security Extensions incompatible with selected FPU" when -mfloat-abi=soft. Further changes 'asm' to '__asm__' to avoid failures wi

[GCC-10 backport][PATCH] arm: PR target/95646: Do not clobber callee saved registers with CMSE.

2021-05-05 Thread Srinath Parvathaneni via Gcc-patches
Hi, This is a backport to gcc-10, cleanly applied on the branch. As reported in bugzilla when the -mcmse option is used while compiling for size (-Os) with a thumb-1 target the generated code will clear the registers r7-r10. These however are callee saved and should be preserved accross ABI bound

[Patch?][RFC][RTL] clobber handling & buildin expansion - missing insn_invalid_p call [PR100418]

2021-05-05 Thread Tobias Burnus
Hi Eric, hi all, currently, gcn (amdgcn-amdhsa) bootstrapping fails as Alexandre's patch to __builtin_memset (applied yesterday) now does more expansions. The problem is [→ PR100418] (set(reg:DI)(plus:DI(reg:DI)(const_int))) [= "adddi3"] This fails with gcn as gcn has two clobbers for "adddi3

[committed] Fix minor CC0 removal fallout on cr16

2021-05-05 Thread Jeff Law via Gcc-patches
cr16 failed to build due to remnants of CC0 support (NOTICE_UPDATE_CC).  This removes the macro and obvious bits necessary to support it.  Committed to the trunk. Jeff commit 14cf6aab8578132ec89ccb46e69899ae6008ff63 Author: Jeff Law Date: Wed May 5 07:49:28 2021 -0600 Remove NOTICE

Re: [PATCH 6/9] arm: Auto-vectorization for MVE: vcmp

2021-05-05 Thread Christophe Lyon via Gcc-patches
On Tue, 4 May 2021 at 15:41, Christophe Lyon wrote: > > On Tue, 4 May 2021 at 13:29, Andre Vieira (lists) > wrote: > > > > Hi Christophe, > > > > On 30/04/2021 15:09, Christophe Lyon via Gcc-patches wrote: > > > Since MVE has a different set of vector comparison operators from > > > Neon, we have

Re: [PATCH 7/9] arm: Auto-vectorization for MVE: add __fp16 support to VCMP

2021-05-05 Thread Christophe Lyon via Gcc-patches
On Tue, 4 May 2021 at 19:03, Christophe Lyon wrote: > > On Tue, 4 May 2021 at 15:43, Christophe Lyon > wrote: > > > > On Tue, 4 May 2021 at 13:48, Andre Vieira (lists) > > wrote: > > > > > > It would be good to also add tests for NEON as you also enable auto-vec > > > for it. I checked and I do

Re: [PATCH] phiopt, v2: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Richard Biener
On Wed, 5 May 2021, Jakub Jelinek wrote: > On Wed, May 05, 2021 at 01:39:32PM +0200, Richard Biener wrote: > > Can you in the above IL snippets mark COND_BB and MIDDLE_BB? > ... > > Thanks. > Here is an updated patch (attached) and interdiff from previous patch. > Ok for trunk if it passes bootst

[PATCH] testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c

2021-05-05 Thread Robin Dapp via Gcc-patches
Hi, pr56541.c implicitly converts a float vector to an int (bool) vector: rMin = (rMax>0) ? rMin : rBig; It fails on some s390 targets because the do not support converting from vector float to int. Is adding a vect_floatint_cvt as in the attached patch the OK thing to do? Or better an xf

[PATCH] testsuite: Add s390 to vect_*_cvt checks

2021-05-05 Thread Robin Dapp via Gcc-patches
Hi, this patch adds some s390 checks for vect_*_cvts. Is it OK? Regards Robin gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add s390 checks for vect conversions. >From 959251d5d2684a9ffebec1b341a4413c2f2328db Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 22 Apr 2021 09:3

Re: [patch for gcc12 stage1][version 2] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-05-05 Thread Qing Zhao via Gcc-patches
Hi, Richard, During the change for the 2nd version based on your previous comments, I have the following questions need your help: > >> + sra_stats.subtree_deferred_init++; >> +} >> + else if (access->grp_to_be_debug_replaced) >> +{ >> + /* FIXME, this part might have so

[PATCH v2] x86: Build only one __cpu_model/__cpu_features2 variables

2021-05-05 Thread H.J. Lu via Gcc-patches
On Wed, May 05, 2021 at 09:36:16AM +0200, Richard Biener wrote: > On Mon, May 3, 2021 at 11:31 AM Ivan Sorokin via Gcc-patches > wrote: > > > > Prior to this commit GCC -O2 generated quite bad code for this > > function: > > > > bool f() > > { > > return __builtin_cpu_supports("popcnt") > >

[PATCH, OG10, OpenMP 5.0, committed] Implement relaxation of implicit map vs. existing device mappings

2021-05-05 Thread Chung-Lin Tang via Gcc-patches
This patch implements relaxing the requirements when a map with the implicit attribute encounters an overlapping existing map. As the OpenMP 5.0 spec describes on page 320, lines 18-27 (and 5.1 spec, page 352, lines 13-22): "If a single contiguous part of the original storage of a list item wit

[PATCH] s390: Add more vcond_mask patterns.

2021-05-05 Thread Robin Dapp via Gcc-patches
Hi, this patch adds vcond_mask patterns with mixed mode for the condition/mask and source, target so e.g. boolean conditions become possible: vtarget = bool_cond ? vsource1 : vsource2. Is it OK for trunk? Regards Robin gcc/ChangeLog: * config/s390/vector.md (vcond_mask_): Add

[committed] Get avr building again

2021-05-05 Thread Jeff Law via Gcc-patches
Removes references to CC_STATUS_INIT from the avr port, which should get it to the point of building again. Committed to the trunk. Jeff commit b927ffdd6cecd0eeda6ef77df2623519870b1e75 Author: Jeff Law Date: Wed May 5 09:15:42 2021 -0600 Remove cc0 remnants from avr port g

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Patrick Palka via Gcc-patches
On Wed, 5 May 2021, Jonathan Wakely wrote: > On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: > > This rewrites ranges::minmax and ranges::minmax_element so that it > > performs at most 3*N/2 many comparisons, as required by the standard. > > In passing, this also fixes PR100387 by avoi

Re: [PATCH] phiopt: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Martin Sebor via Gcc-patches
On 5/4/21 1:44 AM, Jakub Jelinek via Gcc-patches wrote: Hi! genericize_spaceship genericizes i <=> j to approximately ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else c = 1; c; }) for strong ordering and ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c

Re: [PATCH] libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

2021-05-05 Thread Patrick Palka via Gcc-patches
On Wed, 5 May 2021, Patrick Palka wrote: > On Wed, 5 May 2021, Jonathan Wakely wrote: > > > On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote: > > > This rewrites ranges::minmax and ranges::minmax_element so that it > > > performs at most 3*N/2 many comparisons, as required by the standa

[vect] Support min/max + index pattern

2021-05-05 Thread Joel Hutton via Gcc-patches
Hi all, looking for some feedback on this, one thing I would like to draw attention to is the fact that this pattern requires 2 separate dependent reductions in the epilogue. The accumulator vector for the maximum/minimum elements can be reduced to a scalar result trivially with a min/max, but

Re: [PATCH] phiopt: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Wed, May 05, 2021 at 01:45:29PM +0200, Marc Glisse wrote: > On Tue, 4 May 2021, Jakub Jelinek via Gcc-patches wrote: > > > 2) the pr94589-2.C testcase should be matching just 12 times each, but runs > > into operator>=(strong_ordering, unspecified) being defined as > > (_M_value&1)==_M_value >

Re: [RFC] Using main loop's updated IV as base_address for epilogue vectorization

2021-05-05 Thread Andre Vieira (lists) via Gcc-patches
On 05/05/2021 13:34, Richard Biener wrote: On Wed, 5 May 2021, Andre Vieira (lists) wrote: I tried to see what IVOPTs would make of this and it is able to analyze the IVs but it doesn't realize (not even sure it tries) that one IV's end (loop 1) could be used as the base for the other (loop 2

Re: [PATCH] testsuite: Add s390 to vect_*_cvt checks

2021-05-05 Thread Jeff Law via Gcc-patches
On 5/5/2021 8:39 AM, Robin Dapp via Gcc-patches wrote: Hi, this patch adds some s390 checks for vect_*_cvts. Is it OK? Regards  Robin gcc/testsuite/ChangeLog:     * lib/target-supports.exp: Add s390 checks for vect conversions. OK jeff

Re: [PATCH] testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c

2021-05-05 Thread Jeff Law via Gcc-patches
On 5/5/2021 8:31 AM, Robin Dapp via Gcc-patches wrote: Hi, pr56541.c implicitly converts a float vector to an int (bool) vector:  rMin = (rMax>0) ? rMin : rBig; It fails on some s390 targets because the do not support converting from vector float to int.  Is adding a vect_floatint_cvt as in

Re: [patch for gcc12 stage1][version 2] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-05-05 Thread Qing Zhao via Gcc-patches
> >> >>> @@ -11950,6 +12088,72 @@ lower_bound_in_type (tree outer, tree inner) >>>} >>> } >>> >>> +/* Returns true when the given TYPE has padding inside it. >>> + return false otherwise. */ >>> +bool >>> +type_has_padding (tree type) >> >> Would it be possible to reuse __builtin_clear_p

  1   2   >