[PATCH] testsuite/rs6000: Add option to ignore vect cost model

2020-07-15 Thread Kewen.Lin via Gcc-patches
Hi, In my testing with cost tweaking for vector with length, I found two cases below didn't get the expected output. Since the expected instructions reply on the vectorization occurrence, we don't expect vectorization gets disabled by cost model. To make it not fragile, the fix is to force it wi

[PATCH] c++: Get rid of convert_like* macros.

2020-07-15 Thread Marek Polacek via Gcc-patches
The convert_like* macros were introduced in 2000-03-05 Nathan Sidwell * call.c (convert_like): Macrofy. (convert_like_with_context): New macro. but now we can use overloading so we can do away with the macros. I've also taken this chance to rename _real to _internal to make it

Re: [PATCH, rs6000, gcc-8 ] Improve handling of built-in initialization. [PR95952]

2020-07-15 Thread Segher Boessenkool
Hi! On Tue, Jul 14, 2020 at 12:15:01PM -0500, will schmidt wrote: > We've got a scenario with a combination of old hardware, gcc-8 and > binutils where gcc will ICE during it's selftest. This ICE was exposed > when the builtin processing for better #pragma support was added, where > we no longe

[committed, OG10] amdgcn: Tune default OpenMP/OpenACC GPU utilization

2020-07-15 Thread Andrew Stubbs
This patch tunes the default GPU thread count for OpenMP and OpenACC on AMD GCN devices. It chooses a sensible default if no attributes are given at all, increases the number of OpenACC gangs if only one worker per gang is specified, and increases the number of workers otherwise. The tuning is

Re: [PATCH 0/6 ver 4] ] Permute Class Operations

2020-07-15 Thread Segher Boessenkool
Hi! On Wed, Jul 08, 2020 at 12:59:29PM -0700, Carl Love wrote: > [PATCH 5/6] rs6000, Add vector splat builtin support > +(define_insn "xxspltiw_v4si" > + [(set (match_operand:V4SI 0 "register_operand" "=wa") > + (unspec:V4SI [(match_operand:SI 1 "s32bit_cint_operand" "n")] > +

i386: Introduce peephole2 to use flags from CMPXCHG more [PR96189]

2020-07-15 Thread Uros Bizjak via Gcc-patches
CMPXCHG instruction sets ZF flag if the values in the destination operand and EAX register are equal; otherwise the ZF flag is cleared and value from destination operand is loaded to EAX. Following assembly: movl%esi, %eax lock cmpxchgl %edx, (%rdi) cmpl%esi, %eax

Re: [PATCH] nvptx: Add support for subword compare-and-swap

2020-07-15 Thread Kwok Cheung Yeung
On 01/07/2020 3:28 pm, Tom de Vries wrote: I looked at the implementation, and it looks ok to me, though I think we need to make explicit in a comment what the assumptions are: - that we have read and write access to the entire word, and Is there a situation where an 8/16-bit portion of memory

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-07-15 Thread Patrick Palka via Gcc-patches
On Tue, 14 Jul 2020, Patrick Palka wrote: > This implements the floating-point std::to_chars overloads for float, > double and long double. We use the Ryu library to compute the shortest > round-trippable fixed and scientific forms of a number for float, double > and long double. We also use Ryu

Re: [PATCH 2/4] libstdc++: Apply modifications to our local copy of Ryu

2020-07-15 Thread Patrick Palka via Gcc-patches
On Tue, 14 Jul 2020, Patrick Palka wrote: > This performs the following modifications to our local copy of Ryu in > order to make it more easily usable for our std::to_chars implementation: > > * Remove all #includes > * Remove copy_special_str routines > * Adjust the exponent formatting to

[PATCH] x86: Inline strncmp only with -minline-all-stringops

2020-07-15 Thread H.J. Lu via Gcc-patches
Expand strncmp to "repz cmpsb" only with -minline-all-stringops since "repz cmpsb" can be much slower than strncmp function implemented with vector instructions, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052 gcc/ PR target/95458 * config/i386/i386-expand.c (ix86_expand_c

Re: [PATCH] Require CET support only for the final GCC build

2020-07-15 Thread Joseph Myers
On Wed, 15 Jul 2020, Richard Biener wrote: > But note one of the issues is that when not cross-compiling we're > using a single libiberty for target and host objects (likewise There shouldn't be a target libiberty, since commit 8499116aa30a46993deff5acf73985df6b16fb8b (re PR regression/47836 (So

[PATCH 2/2] S/390: Emit vector alignment hints for z13 if AS accepts them

2020-07-15 Thread Stefan Schulze Frielinghaus via Gcc-patches
gcc/ChangeLog: * config.in: Regenerate. * config/s390/s390.c (print_operand): Emit vector alignment hints for target z13, if AS accepts them. For other targets the logic stays the same. * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define

[PATCH 1/2] S/390: Support vector load/store alignment hints

2020-07-15 Thread Stefan Schulze Frielinghaus via Gcc-patches
From: Andreas Krebbel The IBM z14 POP adds an optional alignment operand to the vl, vst, vlm, and vstm instruction (vector loads and stores). Vectors residing on 8 or 16 byte boundaries might get loaded or stored faster on some models given the instruction uses the proper hint operand. A wrong h

[PATCH 0/2][BACKPORT GCC8] S/390: Support vector load/store alignment hints

2020-07-15 Thread Stefan Schulze Frielinghaus via Gcc-patches
Backport for supporting vector load/store alignment hints for GCC8. Bootstrapped and regtested on s390x with and without patched gas. Ok for releases/gcc-8 branch? Andreas Krebbel (1): S/390: Support vector load/store alignment hints Stefan Schulze Frielinghaus (1): S/390: Emit vector alignm

[PATCH] non-power-of-2 group size can be vectorized for 2-element vectors case (PR96208)

2020-07-15 Thread Dmitrij Pochepko
Hi, here is an enhancement to gcc, which allows load/store groups with size being non-power-of-2 to be vectorized. Current implementation is using interleaving permutations to transform load/store groups. That is where power-of-2 requirements comes from. For N-element vectors simplest approch wo

Re: [Patch] libgomp: Add Fortran routine support for allocators

2020-07-15 Thread Tobias Burnus
It turned out that using -fdefault-integer-8 on 32bit systems didn't work with omp_alloc – as that gave a 64bit / kind=8 integer for the (c_)size_t argument. [As reported by Jakub on #gcc.] Fixed (and committed to mainline + OG10) as attached; the most trivial version of the patch didn't not work

Re: [PATCH] Require CET support only for the final GCC build

2020-07-15 Thread H.J. Lu via Gcc-patches
On Wed, Jul 15, 2020 at 8:20 AM Richard Biener wrote: > > On Wed, 15 Jul 2020, H.J. Lu wrote: > > > With --enable-cet, require CET support only for the final GCC build. > > Don't enable CET without CET support in stage1 nor for build support. > > I wonder if we want to do sth less fragile than tes

Re: [PATCH] Require CET support only for the final GCC build

2020-07-15 Thread Richard Biener
On Wed, 15 Jul 2020, H.J. Lu wrote: > With --enable-cet, require CET support only for the final GCC build. > Don't enable CET without CET support in stage1 nor for build support. I wonder if we want to do sth less fragile than testing for ../stage_current - for example the toplevel make could exp

[committed] openmp: Fix up loop-21.c [PR96198]

2020-07-15 Thread Jakub Jelinek via Gcc-patches
Hi! I've missed +FAIL: libgomp.c/loop-21.c execution test during testing of the recent patch. The problem is that while for the number of iterations computation it doesn't matter if we compute min_inner_iterations as (m2 * first + n2 + (adjusted step) + m1 * first + n1) / step or (m2 * last + n2

[PATCH] Require CET support only for the final GCC build

2020-07-15 Thread H.J. Lu via Gcc-patches
With --enable-cet, require CET support only for the final GCC build. Don't enable CET without CET support in stage1 nor for build support. config/ PR bootstrap/96202 * cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET support in stage1 nor for build support. gcc/

c++: refactor some parser code

2020-07-15 Thread Nathan Sidwell
cp_parser_declaration copies tokens to local variables, before inspecting (some of) their fields. There's no need. Just point at them in the token buffer -- they don't move. Also, we never look at the second token if the first is EOF, so no need for some kind of dummy value in that case.

[Ada] Cleanup in Convert_To_Positional after previous work

2020-07-15 Thread Pierre-Marie de Rodat
This adjusts the description of Flatten, removes an obsolete comment and uses Compile_Time_Known_Value as now done in Is_Static_Element. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb (Flatten): Adjust description. (Convert_To_Po

[Ada] Spurious error on Predicate_Failure aspect

2020-07-15 Thread Pierre-Marie de Rodat
GNAT would in some cases not resolve a Predicate_Failure aspect properly and generate spurious errors of the form: cannot find unique type for raise expression Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Add proper

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

2020-07-15 Thread Pierre-Marie de Rodat
This patch modifies the parser to recognize iterated_element_associations, which may include a key_exprewsion to be used in a named aggregate such as a map. The new syntactic node N_Iterated_Element_Association is recognized throughout the compiler. The patch also extends the analysis and expansion

[Ada] Guard against access to wrong fields in Is_Renaming

2020-07-15 Thread Pierre-Marie de Rodat
Renamed_Entity is only valid for a few entities, using it on any entity passed to Is_Renaming can result in crashes. Fixing this requires making sure that Is_Renaming only uses Renamed_Entity on entities where this is allowed and uses Is_Renaming_Of_Object everywhere else. Tested on x86_64-pc-lin

[Ada] Fix logic in Allocate_Any_Controlled

2020-07-15 Thread Pierre-Marie de Rodat
If an exception is raised early in Allocate_Any_Controlled, no lock is taken yet and Unlock is called on a lock which isn't taken. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-stposu.adb (Allocate_Any_Controlled): Fix logic in lock/unlock.diff --git a/gc

[Ada] Do not generate elaboration code for alignment aspect

2020-07-15 Thread Pierre-Marie de Rodat
This prevents the compiler from generating elaboration code for a record declared with an initial value and an alignment aspect. The expression of an alignment aspect must be static so, in practice, there is no need to defer the elaboration of the object just because of it. Tested on x86_64-pc-li

[Ada] Cleanup code related to object overlays

2020-07-15 Thread Pierre-Marie de Rodat
Cleanup frontend code before routine Find_Overlaid_Entity will be reused in GNATprove backend. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Find_Overlaid_Entity): Fix style in comment. (Note_Possible_Modification): Simplify repeated calls to Ekind.di

[Ada] Target name is an object reference

2020-07-15 Thread Pierre-Marie de Rodat
Target name (i.e. "@"), which was introduced to Ada 202X in AI12-0125, denotes a constant object (RM 3.3(21.2/5)), even though target_name itself is not an object (RM 3.3(2)). This patch allows @ to be appear as a prefix for Address attribute (which requires an object). Also, it enables constructs

[Ada] Missing error on operator call

2020-07-15 Thread Pierre-Marie de Rodat
In some cases where a procedure call is expected but a function is provided such as "Interfaces.C."=" (x, y);" GNAT would not generate any error message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Analyze_Procedure_Call): Detect use of operators in

[Ada] Fix for possibly null ranges in 'Update and delta_aggregate

2020-07-15 Thread Pierre-Marie de Rodat
In expression like "(Arr with delta Low .. High => New_Component_Value)" bounds Low .. High might denote a null range. In this case both Low and High can be any values from the base type of the array's index type; they don't need to belong to the array's index type itself. This patch removes unnec

[Ada] Mark standard containers as not in SPARK

2020-07-15 Thread Pierre-Marie de Rodat
Use aspect SPARK_Mode with value Off in the spec and body of standard containers, bounded and unbounded versions, so that it is clearer that they cannot be used in SPARK code. Formal containers should be used instead. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a

[Ada] Fix slices and qualified expressions being effectively volatile

2020-07-15 Thread Pierre-Marie de Rodat
Detecting effectively volatile objects in restricted contexts happens in two routines: Is_Effectively_Volatile_Object and Is_OK_Volatile_Context. Their handling of type conversions and slices were different; also none of them has been dealing with qualified expressions, which has been just added to

[Ada] Extend static functions

2020-07-15 Thread Pierre-Marie de Rodat
This patch extends static functions and allow them on Intrinsic imported subprograms in addition to expression functions, under -gnatX. We also implement compile time evaluation of Shift_Left/Right operators as a first set of useful static-compatible intrinsics. Tested on x86_64-pc-linux-gnu, com

[Ada] Assert failure with -gnatwr

2020-07-15 Thread Pierre-Marie de Rodat
In a case of a complex precondition expression with quantifiers, we can get a crash in Resolve_Type_Conversion when trying to emit a -gnatwr warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_Type_Conversion): Protect against null entity.

[Ada] ACATS 4.1P [BDB4001] - 13.11.4(22-23/3) not enforced

2020-07-15 Thread Pierre-Marie de Rodat
This ACATS test shows GNAT was not enforcing legality rules related to subpools. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Freeze_Type): Remove warning in expander, replaced by a corresponding error in sem_ch13.adb. Replace RTE_Available by

[Ada] Do not generate extra copies inside initialization procedures

2020-07-15 Thread Pierre-Marie de Rodat
The RM C.6(19) clause says that atomic or volatile objects of types that are not by reference must be passed by copy in a call if the type of the formal is not atomic or volatile respectively. But this requirement does not apply to initialization procedures, which are generated by the compiler, an

[Ada] Fix oversight in Delayed_Aspect_Present predicate

2020-07-15 Thread Pierre-Marie de Rodat
The predicate returns true only if an aspect requiring delaying like Alignment or Address is the first aspect in the list. The change also contains a small consistency fix for Freeze_Object_Declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Delayed_As

[Ada] Small addition and tweaks in documentation on freezing

2020-07-15 Thread Pierre-Marie de Rodat
Apart from the usual editorial tweaks, this documents the discrepancy between the aspect and the non-aspect cases for alignment settings in object declarations. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo.ads (Delayed Freezing and Elaboration): Minor tweaks.

[Ada] Spurious accessibility error on allocator

2020-07-15 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby an allocator for a limited type may cause spurious accessibility errors due to a miscalculation of access levels on interally generated temporaries. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Make_Build_In_P

[Ada] Use Sloc of delay statement in timed entry call

2020-07-15 Thread Pierre-Marie de Rodat
This changes the Sloc used to expand a timed entry call from that of the Select to that of the Delay statement for coverage purposes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch9.adb (Expand_N_Timed_Entry_Call): Use the Sloc of the delay statement in the e

[Ada] Cleanup condition for an effectively volatile array type

2020-07-15 Thread Pierre-Marie de Rodat
When we detect effectively volatile array type we only need to examine the type of array component if the array itself has no Has_Volatile_Components property. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Atomic_Components): Simplify with Ekind_In. (

[Ada] Ongoing work for unnamed and named container aggregates

2020-07-15 Thread Pierre-Marie de Rodat
This implements additional functionality for the Ada 202x container aggregates, in particular the use of iterated_component_association in both Unnamed (positional) and Named (keyed) aggregates for types for which the Aspect Aggregate is defined. Tested on x86_64-pc-linux-gnu, committed on trunk

Re: [PATCH] libsanitizer: Fix GetPcSpBp determination of SP on 32-bit Solaris/x86

2020-07-15 Thread Jakub Jelinek via Gcc-patches
On Wed, Jul 15, 2020 at 03:06:18PM +0200, Rainer Orth wrote: > I must admit I missed that in that terrible nested maze of #ifdef's > compiler-rt uses. > > > I mean, while the ifndef/define change is guarded by #if SANITIZER_SOLARIS, > > the last changed line is not. I'm afraid I don't know if > >

c++: error recovery & pragmas

2020-07-15 Thread Nathan Sidwell
Parser error recovery can get confused by the tokens within a deferred pragma, as treats those as regular tokens. This adjusts the recovery so that the pragma is treated as a unit. Also, the preprocessor now ensures that we never have an EOF token inside a pragma -- the pragma is always close

Re: [PATCH] libsanitizer: Fix GetPcSpBp determination of SP on 32-bit Solaris/x86

2020-07-15 Thread Rainer Orth
Hi Jakub, > On Tue, Jul 14, 2020 at 02:32:57PM +0200, Rainer Orth wrote: >> The latest Solaris 11.4/x86 update uncovered a libsanitizer bug that >> caused one test to FAIL for 32-bit: >> >> +FAIL: c-c++-common/asan/null-deref-1.c -O0 output pattern test >> +FAIL: c-c++-common/asan/null-deref-1

Re: [PATCH v2] sparc/sparc64: use crtendS.o for default-pie executables [PR96190]

2020-07-15 Thread Eric Botcazou
> This should be: > > PR target/96190 > * config/sparc/linux.h (ENDFILE_SPEC): Use GNU_USER_TARGET_ENDFILE_SPEC > to get crtendS.o for !no-pie mode. > * config/sparc/linux64.h(ENDFILE_SPEC): Ditto. * config/sparc/linux64.h (ENDFILE_SPEC): Ditto. > OK for mainline

GCC 10.1.1 Status Report (2020-07-15)

2020-07-15 Thread Richard Biener
Status == The GCC 10 branch is now frozen for the GCC 10.2 release, all changes to he branch require a RM approval. Quality Data Priority # Change from last report --- --- P1 P2 218 + 2 P3

Re: [patch] Reunify x86 stack checking implementation

2020-07-15 Thread Uros Bizjak via Gcc-patches
> the stack clash protection mechanism in the x86 back-end was implemented by > largely duplicating the existing stack checking implementation. Now the only > significant difference between them is the probing window, which is shifted by > 1 probing interval (not 2 as documented in explow.c), but

Re: [Patch] [OpenMP, Fortran] Add structure/derived-type element mapping

2020-07-15 Thread Tobias Burnus
On 6/24/20 7:32 PM, Tobias Burnus wrote: While testing, I encountered two bugs, one relating to kind=4 character string (patch pending review; PR95837) not part of testcase) As that PR has been committed, I updated the testcase to check character(kind=4) as well. (I also removed the unused var

Re: [PATCH 8/9] [OpenACC] Fix standalone attach for Fortran assumed-shape array pointers

2020-07-15 Thread Thomas Schwinge
Hi Julian, Tobias! On 2020-07-14T13:43:37+0200, I wrote: > On 2020-06-16T15:39:44-0700, Julian Brown wrote: >> As mentioned in the blurb for the previous patch, an "attach" operation >> for a Fortran pointer with an array descriptor must copy that array >> descriptor to the target. > > Heh, I see

Re: [GCC 10 PATCH] c++: Treat GNU and Advanced SIMD vectors as distinct [PR95726]

2020-07-15 Thread Richard Biener via Gcc-patches
On Tue, Jul 14, 2020 at 1:21 AM Richard Sandiford wrote: > > Jakub Jelinek writes: > > On Wed, Jul 08, 2020 at 03:10:14PM +0100, Richard Sandiford wrote: > >> gcc/ > >> PR target/95726 > >> * config/aarch64/aarch64.c (aarch64_attribute_table): Add > >> "Advanced SIMD type". > >>

Re: [PATCH] genemit.c (main): split insn-emit.c for compiling parallelly

2020-07-15 Thread Rainer Orth
Hi Jojo, > diff --git a/gcc/Makefile.in b/gcc/Makefile.in > index 2ba76656dbf..3306510a9a8 100644 > --- a/gcc/Makefile.in > +++ b/gcc/Makefile.in > @@ -1253,6 +1253,13 @@ ANALYZER_OBJS = \ >  # We put the *-match.o and insn-*.o files first so that a parallel make >  # will build them sooner, becau

[PATCH] genemit.c (main): split insn-emit.c for compiling parallelly

2020-07-15 Thread Jojo R
Hi, The size of generated file like insn-emit.c is very huge if we add lots of define_expand patten or define_insn patten. It’s present easily when there are much more intrinsic interfaces it costs much more time to create toolchain with compiling these files :(

[patch] Reunify x86 stack checking implementation

2020-07-15 Thread Eric Botcazou
Hi, the stack clash protection mechanism in the x86 back-end was implemented by largely duplicating the existing stack checking implementation. Now the only significant difference between them is the probing window, which is shifted by 1 probing interval (not 2 as documented in explow.c), but

RE: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions emitted at -O3

2020-07-15 Thread xiezhiheng
> -Original Message- > From: Richard Sandiford [mailto:richard.sandif...@arm.com] > Sent: Tuesday, July 7, 2020 10:08 PM > To: xiezhiheng > Cc: Richard Biener ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH PR94442] [AArch64] Redundant ldp/stp instructions > emitted at -O3 > > xiezhiheng

Re: [PATCH v2] sparc/sparc64: use crtendS.o for default-pie executables [PR96190]

2020-07-15 Thread Eric Botcazou
> In --enable-default-pie mode compiler should switch from > using crtend.o to crtendS.o. On sparc it is especially important > because crtend.o contains PIC-unfriendly code. > > We use GNU_USER_TARGET_ENDFILE_SPEC as a baseline spec to get > crtendS.o instead of crtend.o in !no-pie mode. > > gcc

[PATCH PR96195] aarch64: ICE during GIMPLE pass:vect

2020-07-15 Thread yangyang (ET)
Hi, This is a simple fix for PR96195. For the test case, GCC generates the following gimple statement in pass_vect: vect__21.16_58 = zp.simdclone.2 (vect_vec_iv_.15_56); The mode of vect__21.16_58 is VNx2SI while the mode of zp.simdclone.2 (vect_vec_iv_.15_5

[PATCH] nvptx: Provide vec_set and vec_extract patterns.

2020-07-15 Thread Roger Sayle
This patch provides standard vec_extract and vec_set patterns to the nvptx backend, to extract an element from a PTX vector and set an element of a PTX vector respectively. PTX vectors (I hesitate to call them SIMD vectors) may contain up to four elements, so vector modes up to size four are supp