[PATCH] sim: depend on gnulib

2021-05-07 Thread Mike Frysinger via Gcc-patches
We're going to start using gnulib in the sim, so make sure it exists. ChangeLog: * Makefile.def: Add configure-sim dependency on all-gnulib. * Makefile.in: Regenerated. --- Makefile.def | 1 + Makefile.in | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile.def

Re: [PATCH/RFC] Add a new memory gathering optimization for loop (PR98598)

2021-05-07 Thread Bin.Cheng via Gcc-patches
On Fri, Apr 30, 2021 at 1:20 PM Feng Xue OS via Gcc-patches wrote: > > >> This patch implements a new loop optimization according to the proposal > >> in RFC given at > >> https://gcc.gnu.org/pipermail/gcc/2021-January/234682.html. > >> So do not repeat the idea in this mail. Hope your comments

Re: PowerPC64 ELFv1 -fpatchable-function-entry

2021-05-07 Thread Segher Boessenkool
Hi! On Fri, May 07, 2021 at 12:19:50PM +0930, Alan Modra wrote: > --- a/gcc/varasm.c > +++ b/gcc/varasm.c > @@ -6866,6 +6866,26 @@ default_elf_asm_named_section (const char *name, > unsigned int flags, >*f = '\0'; > } > > + char func_label[256]; > + if (flags &

Re: PowerPC64 ELFv1 -fpatchable-function-entry

2021-05-07 Thread Segher Boessenkool
On Fri, May 07, 2021 at 08:47:02AM -0500, will schmidt wrote: > On Fri, 2021-05-07 at 12:19 +0930, Alan Modra via Gcc-patches wrote: > > --- a/gcc/varasm.c > > +++ b/gcc/varasm.c > > @@ -6866,6 +6866,26 @@ default_elf_asm_named_section (const char > > *name, unsigned int flags, > >*f =

Re: Revert "rs6000: Avoid -fpatchable-function-entry* regressions on powerpc64 be [PR98125]"

2021-05-07 Thread Segher Boessenkool
On Fri, May 07, 2021 at 12:19:51PM +0930, Alan Modra wrote: > This reverts commit b680b9049737198d010e49cf434704c6a6ed2b3f now > that the PowerPC64 ELFv1 regression is fixed properly. This is okay when the rest goes in. Do it in a bisectable order if possible? If that is easy :-) Segher

Re: PR98125, PowerPC64 -fpatchable-function-entry

2021-05-07 Thread Segher Boessenkool
On Fri, May 07, 2021 at 12:19:49PM +0930, Alan Modra wrote: > This series of patches fixes -fpatchable-function-entry on PowerPC64 > ELFv1 so that SECTION_LINK_ORDER (.section 'o' arg) is now supported, > and on PowerPC64 ELFv2 to not break the global entry code. > > Bootstrapped

Re: [PATCH, rs6000] Add ALTIVEC_REGS as pressure class

2021-05-07 Thread Segher Boessenkool
Hi! On Fri, May 07, 2021 at 10:53:31AM -0500, Pat Haugen wrote: > Code that has heavy register pressure on Altivec registers can suffer from > over-aggressive scheduling during sched1, which then leads to increased > register spill. This is due to the fact that registers that prefer >

Re: [committed] amdgcn: disable TImode

2021-05-07 Thread Andrew Stubbs
Indeed, libgomp fails to build: configure: error: unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind I've reverted the patch for now. We'll just have to put up with a lot of new test failures in the stand-alone toolchain so that the offload toolchain will at

Re: [committed] libstdc++: Implement LWG 1203 for rvalue iostreams

2021-05-07 Thread Jonathan Wakely via Gcc-patches
On 06/05/21 18:28 +0100, Jonathan Wakely wrote: On 06/05/21 18:09 +0100, Jonathan Wakely wrote: On 06/05/21 17:55 +0200, Stephan Bergmann wrote: On 30/04/2021 15:48, Jonathan Wakely via Libstdc++ wrote: This implements the resolution of LWG 1203 so that the constraints for rvalue stream

Re: [committed] amdgcn: disable TImode

2021-05-07 Thread Andrew Stubbs
On 07/05/2021 18:11, Tobias Burnus wrote: On 07.05.21 18:35, Andrew Stubbs wrote: TImode has always been a problem on amdgcn, and now it is causing many new test failures, so I'm disabling it. Does still still work with libgomp? The patch sounds as if it might cause problems, but on the

[PATCH] Use the dominator tree when checking for non-null.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
The current non-null processing only sets a bit for the block which contains a non-null setting event. We should check the dom tree to see if a predecessor dom block sets non-null, otherwise we can miss it.  We don't need to do this within the propagation engines like the on-entry cache. 

[PATCH] abstract the on entry cache.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
This patch cleans up the ssa_block_range class which represents the bulk of the on-entry cache storage. PR 100299 shows the we need better control over the cache, and different approaches can be useful for different situations. In preparation for fixing that PR, this patch: 1) Abstracts

[PATCH] tweak range-on-exit.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
Range on exit was not ding the right thing when a basic block contained no statements other than a PHI node. Rather than returning the value of the PHI, it was instead asking for range-on-entry for the phi, which  would trigger a walk back to the top of the CFG looking for the definition.

[PATCH] Export gcond edge range routine.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
Rename the outgoing_edge class to gimple_outgoing_edge, and provide an extern entry point for convenience to return a range for the TRUE and FALSE edges of a gcond. Bootstraps on  x86_64-pc-linux-gnu with no testsuite regressions. Pushed. Andrew commit

[PATCH] Don;t over allocate switch default clauses.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
We were always allocating the 255 max ranges for the default condition.    Instead, use int_range_max to build the default range, then allocate and store only what is needed. Bootstraps on  x86_64-pc-linux-gnu with no testsuite regressions. Pushed. Andrew commit

[PATCH] Change x mod 0 to undefined.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
We were setting x % 0 to varying...  change it to undefined. Bootstraps on  x86_64-pc-linux-gnu with no testsuite regressions. Pushed. Andrew commit 2262206b82da0ab4050fe6168a7d09be4e4b3d0f Author: Andrew MacLeod Date: Mon Apr 26 17:46:31 2021 -0400 Change x mod 0 to produce UNDEFINED

[PATCH] Enhance initial global ranges.

2021-05-07 Thread Andrew MacLeod via Gcc-patches
Add some tweaks to gimple_range_global () that 1) incorporates code from vr-values to pick up initial parameter values from IPA, 2) used before defined locals start with UNDEFINED instead of varying.  This makes a big difference when folding PHI nodes. Bootstraps on  x86_64-pc-linux-gnu

Re: [patch] Fix incorrect array bounds with -fgnat-encodings=minimal in DWARF

2021-05-07 Thread Jeff Law via Gcc-patches
On 5/7/2021 5:09 AM, Eric Botcazou wrote: Hi, this makes add_subscript_info query the get_array_descr_info hook for the actual information when it is defined. Tested on x86-64/Linux, OK for mainline? 2021-05-07 Eric Botcazou * dwarf2out.c (add_subscript_info): Retrieve the

Re: [PATCH] builtins.c: Ensure emit_move_insn operands are valid (PR100418)

2021-05-07 Thread Jeff Law via Gcc-patches
On 5/7/2021 10:26 AM, Andrew Stubbs wrote: A recent patch from Alexandre added new calls to emit_move_insn with PLUS expressions in the operands. Apparently this works fine on (at least) x86_64, but fails on (at least) amdgcn, where the adddi3 patten has clobbers that the movdi3 does not.

Re: [PATCH] PR libstdc++/71579 assert that type traits are not misused with an incomplete type

2021-05-07 Thread Antony Polukhin via Gcc-patches
Rebased the patch on current master. Please review. Changelog stays the same: New std::common_type assertions attempt to give a proper 'required from here' hint for user code, do not bring many changes to the implementation and check all the template parameters for completeness. In some cases

Re: [PATCH V7 4/7] CTF/BTF debug formats

2021-05-07 Thread Indu Bhagat via Gcc-patches
On 4/29/21 11:17 PM, Richard Biener wrote: On Thu, 29 Apr 2021, Indu Bhagat wrote: Hello, On 4/29/21 5:10 AM, Richard Biener wrote: On Thu, 29 Apr 2021, Jose E. Marchesi wrote: This commit introduces support for generating CTF debugging information and BTF debugging information from GCC.

Re: [committed] amdgcn: disable TImode

2021-05-07 Thread Tobias Burnus
On 07.05.21 18:35, Andrew Stubbs wrote: TImode has always been a problem on amdgcn, and now it is causing many new test failures, so I'm disabling it. Does still still work with libgomp? The patch sounds as if it might cause problems, but on the other hand, I assume you did test it? To

[PATCH] tsan: fix false positive for pthread_cond_clockwait

2021-05-07 Thread Michael de Lang via Gcc-patches
pthread_cond_clockwait isn't added to TSAN_INTERCEPTORS which leads to false positives regarding double locking of a mutex. This was uncovered by a user reporting an issue to the google sanitizer github: https://github.com/google/sanitizers/issues/1259 This patch copies code from the fix made in

[committed] amdgcn: disable TImode

2021-05-07 Thread Andrew Stubbs
TImode has always been a problem on amdgcn, and now it is causing many new test failures, so I'm disabling it. The mode only has move instructions defined, which was enough for SLP, but any other code trying to use it without checking the optabs is a problem. The mode remains available for

[PATCH] c++: argument pack expansion inside constraint [PR100138]

2021-05-07 Thread Patrick Palka via Gcc-patches
This PR is about CTAD but the underlying problems are more general; CTAD is a good trigger for them because of the necessary substitution into constraints that deduction guide generation entails. In the testcase below, when generating the implicit deduction guide for the constrained constructor

[PATCH] builtins.c: Ensure emit_move_insn operands are valid (PR100418)

2021-05-07 Thread Andrew Stubbs
A recent patch from Alexandre added new calls to emit_move_insn with PLUS expressions in the operands. Apparently this works fine on (at least) x86_64, but fails on (at least) amdgcn, where the adddi3 patten has clobbers that the movdi3 does not. This results in ICEs in recog. This patch

[pushed] c++: reject class lvalues in 'rvalue'

2021-05-07 Thread Jason Merrill via Gcc-patches
Wrapping a class lvalue in NON_LVALUE_EXPR is not sufficient to make it a usable prvalue; callers must use force_rvalue instead. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/cp/ChangeLog: * tree.c (rvalue): Assert expr is not a class lvalue. --- gcc/cp/tree.c | 7 ++- 1 file

[pushed] c++: avoid non-TARGET_EXPR class prvalues

2021-05-07 Thread Jason Merrill via Gcc-patches
Around PR98469 I asked Jakub to wrap a class BIT_CAST_EXPR in TARGET_EXPR; SPACESHIP_EXPR needs the same thing. The dummy CAST_EXPR created in can_convert is another instance of a non-TARGET_EXPR prvalue, so let's use the declval-like build_stub_object there instead. Tested x86_64-pc-linux-gnu,

[PATCH] c: don't drop typedef information in casts

2021-05-07 Thread David Lamparter
The TYPE_MAIN_VARIANT() here was, for casts to a typedef'd type name, resulting in all information about the typedef's involvement getting lost. This drops necessary information for warnings and can make them confusing or even misleading. It also makes specialized warnings for unspecified-size

[pushed] c++: tweak prvalue test [PR98469]

2021-05-07 Thread Jason Merrill via Gcc-patches
Discussing the 98469 patch and class prvalues with Jakub also inspired me to change the place that was mishandling BIT_CAST_EXPR and one other to use the lvalue_kind machinery to decide whether something is a prvalue, instead of looking specifically for a TARGET_EXPR. Tested x86_64-pc-linux-gnu,

[PATCH, rs6000] Add ALTIVEC_REGS as pressure class

2021-05-07 Thread Pat Haugen via Gcc-patches
Add ALTIVEC_REGS as pressure class. Code that has heavy register pressure on Altivec registers can suffer from over-aggressive scheduling during sched1, which then leads to increased register spill. This is due to the fact that registers that prefer ALTIVEC_REGS are currently assigned an allocno

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

2021-05-07 Thread Richard Biener
On May 7, 2021 4:12:02 PM GMT+02:00, Christophe Lyon wrote: >On Wed, 5 May 2021 at 09:56, Richard Biener wrote: >> >> 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

[PATCH] i386: Implement mmx_pblendv to optimize SSE conditional moves [PR98218]

2021-05-07 Thread Uros Bizjak via Gcc-patches
Implement mmx_pblendv to optimize V8HI, V4HI and V2SI mode conditional moves for SSE4.1 targets. 2021-05-07 Uroš Bizjak gcc/ PR target/98218 * config/i386/i386-expand.c (ix86_expand_sse_movcc): Handle V8QI, V4HI and V2SI modes. * config/i386/mmx.md (mmx_pblendvb): New insn

Re: [PATCH] libcpp: Fix up pragma preprocessing [PR100450]

2021-05-07 Thread Marek Polacek via Gcc-patches
On Fri, May 07, 2021 at 09:53:29AM +0200, Jakub Jelinek wrote: > Hi! > > Since the r0-85991-ga25a8f3be322fe0f838947b679f73d6efc2a412c > https://gcc.gnu.org/legacy-ml/gcc-patches/2008-02/msg01329.html > changes, so that we handle macros inside of pragmas that should expand > macros, during

Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration

2021-05-07 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 12:33 +0100, Jonathan Wakely wrote: 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. Ville pointed out that we'll need to use libbacktrace for std::stacktrace

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

2021-05-07 Thread Christophe Lyon via Gcc-patches
On Wed, 5 May 2021 at 09:56, Richard Biener wrote: > > 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,

Re: PowerPC64 ELFv1 -fpatchable-function-entry

2021-05-07 Thread will schmidt via Gcc-patches
On Fri, 2021-05-07 at 12:19 +0930, Alan Modra via Gcc-patches wrote: > On PowerPC64 ELFv1 function symbols are defined on function > descriptors in an .opd section rather than in the function code. > .opd is not split up by the PowerPC64 backend for comdat groups or > other situations where

Re: Revert "rs6000: Avoid -fpatchable-function-entry* regressions on powerpc64 be [PR98125]"

2021-05-07 Thread will schmidt via Gcc-patches
On Fri, 2021-05-07 at 12:19 +0930, Alan Modra via Gcc-patches wrote: > This reverts commit b680b9049737198d010e49cf434704c6a6ed2b3f now > that the PowerPC64 ELFv1 regression is fixed properly. > Hi, Ok. looks like that was initially handled by Jakub, on copy, good. :-) Contents below appear to

Re: PowerPC64 ELFv2 -fpatchable-function-entry

2021-05-07 Thread will schmidt via Gcc-patches
On Fri, 2021-05-07 at 12:19 +0930, Alan Modra via Gcc-patches wrote: > PowerPC64 ELFv2 dual entry point functions have a couple of problems > with -fpatchable-function-entry. One is that the nops added after the > global entry land in the global entry code which is constrained to be > a power of

RE: [PATCH 1/4]middle-end Vect: Add support for dot-product where the sign for the multiplicant changes.

2021-05-07 Thread Tamar Christina via Gcc-patches
Hi Richi, > -Original Message- > From: Richard Biener > Sent: Friday, May 7, 2021 12:46 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH 1/4]middle-end Vect: Add support for dot-product > where the sign for the multiplicant changes. > > On Wed, 5 May

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

2021-05-07 Thread Thomas Schwinge
Hi Chung-Lin! On 2021-05-05T23:17:25+0800, Chung-Lin Tang via Gcc-patches wrote: > This patch implements relaxing the requirements when a map with the implicit > attribute encounters > an overlapping existing map. [...] Oh, oh, these data mapping interfaces/semantics ares getting more and

Re: [RFC] ldist: Recognize rawmemchr loop patterns

2021-05-07 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Wed, May 05, 2021 at 11:36:41AM +0200, 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

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

2021-05-07 Thread Richard Biener
On Wed, 5 May 2021, Andre Vieira (lists) wrote: > > 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

Re: [PATCH] Vect: Remove restrictions on dotprod signedness

2021-05-07 Thread Richard Biener
On Wed, 5 May 2021, Tamar Christina wrote: > Hi All, > > There's no reason that the sign of the operands of dot-product have to all be > the same. The only restriction really is that the sign of the multiplicands > are the same, however the sign between the multiplier and the accumulator need >

Re: [PATCH 1/4]middle-end Vect: Add support for dot-product where the sign for the multiplicant changes.

2021-05-07 Thread Richard Biener
On Wed, 5 May 2021, Tamar Christina wrote: > Hi All, > > This patch adds support for a dot product where the sign of the multiplication > arguments differ. i.e. one is signed and one is unsigned but the precisions > are > the same. > > #define N 480 > #define SIGNEDNESS_1 unsigned > #define

Re: [PATCH] rs6000: Make density_test only for vector version

2021-05-07 Thread will schmidt via Gcc-patches
On Fri, 2021-05-07 at 10:28 +0800, Kewen.Lin via Gcc-patches wrote: > Hi, > > When I was investigating density_test heuristics, I noticed that > the current rs6000_density_test could be used for single scalar > iteration cost calculation, through the call trace: >

Re: [vect] Support min/max + index pattern

2021-05-07 Thread Richard Biener
On Wed, 5 May 2021, Joel Hutton wrote: > 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

Re: [patch] Do not apply scalar storage order to pointer fields

2021-05-07 Thread Richard Biener via Gcc-patches
On Fri, May 7, 2021 at 12:42 PM Eric Botcazou wrote: > > Hi, > > I didn't really think of pointer fields (nor of vector fields originally) when > implementing the scalar_storage_order attribute, so they are swapped as well. > As Ulrich pointed out, this is problematic to describe in DWARF and

[patch] Fix incorrect array bounds with -fgnat-encodings=minimal in DWARF

2021-05-07 Thread Eric Botcazou
Hi, this makes add_subscript_info query the get_array_descr_info hook for the actual information when it is defined. Tested on x86-64/Linux, OK for mainline? 2021-05-07 Eric Botcazou * dwarf2out.c (add_subscript_info): Retrieve the bounds and the index type by means of the

[PATCH][GCC 8] aarch64: PR target/99037 Fix RTL represntation in move_lo_quad patterns

2021-05-07 Thread Kyrylo Tkachov via Gcc-patches
This is a GCC 8 backport This patch fixes the RTL representation of the move_lo_quad patterns to use aarch64_simd_or_scalar_imm_zero for the zero part rather than a vec_duplicate of zero or a const_int 0. The expander that generates them is also adjusted so that we use and match the

[PATCH][GCC-9]aarch64: PR target/99037 Fix RTL represntation in move_lo_quad patterns

2021-05-07 Thread Kyrylo Tkachov via Gcc-patches
This is a GCC 9 backport This patch fixes the RTL representation of the move_lo_quad patterns to use aarch64_simd_or_scalar_imm_zero for the zero part rather than a vec_duplicate of zero or a const_int 0. The expander that generates them is also adjusted so that we use and match the

[Patch] contrib/gcc-changelog: Detect if same file appears twice

2021-05-07 Thread Tobias Burnus
Test for a copyed-but-not-fully-edited error. OK? Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf contrib/gcc-changelog: Detect if same file appears twice

Re: [PATCH] middle-end/100464 - avoid spurious TREE_ADDRESSABLE in folding debug stmts

2021-05-07 Thread Richard Biener via Gcc-patches
On Fri, May 7, 2021 at 12:17 PM Richard Biener wrote: > > canonicalize_constructor_val was setting TREE_ADDRESSABLE on bases > of ADDR_EXPRs but that's futile when we're dealing with CTOR values > in debug stmts. This rips out the code which was added for Java > and should have been an assertion

Re: [Patch] + [nvptx RFH/RFC]: OpenMP: Fix SIMT for complex/float reduction with && and ||

2021-05-07 Thread Tom de Vries
On 5/7/21 12:05 PM, Tobias Burnus wrote: > On 06.05.21 16:32, Jakub Jelinek wrote: > >> s/recution/reduction/ > Fixed. >> This comment needs to be adjusted to talk about non-integral types. > Fixed. >> Is this hunk still needed when the first hunk is in? > > No - and now removed. > > Updated

Re: [Patch] + [nvptx RFH/RFC]: OpenMP: Fix SIMT for complex/float reduction with && and ||

2021-05-07 Thread Jakub Jelinek via Gcc-patches
On Fri, May 07, 2021 at 12:05:11PM +0200, Tobias Burnus wrote: > 2021-05-07 Tobias Burnus > Tom de Vries > > gcc/ChangeLog: > > * omp-low.c (lower_rec_simd_input_clauses): Set max_vf = 1 if > a truth_value_p reduction variable is nonintegral. > > libgomp/ChangeLog: >

Re: [Patch] + [nvptx RFH/RFC]: OpenMP: Fix SIMT for complex/float reduction with && and ||

2021-05-07 Thread Tobias Burnus
On 06.05.21 16:32, Jakub Jelinek wrote: s/recution/reduction/ Fixed. This comment needs to be adjusted to talk about non-integral types. Fixed. Is this hunk still needed when the first hunk is in? No - and now removed. Updated code attached. Tobias - Mentor Graphics

Re: [PATCH] split loop for NE condition.

2021-05-07 Thread Richard Biener
On Fri, 7 May 2021, guojiufu wrote: > On 2021-05-06 16:27, Richard Biener wrote: > > On Thu, 6 May 2021, guojiufu wrote: > > > >> On 2021-05-03 20:18, Richard Biener wrote: > >> > On Thu, 29 Apr 2021, Jiufu Guo wrote: > >> > > >> >> When there is the possibility that overflow may happen on the

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

2021-05-07 Thread Aldy Hernandez via Gcc-patches
On 5/7/21 11:34 AM, Richard Biener wrote: On Fri, May 7, 2021 at 2:12 AM Martin Sebor wrote: On 5/6/21 8:32 AM, Aldy Hernandez wrote: On 5/5/21 9:26 AM, Richard Biener wrote: On Wed, May 5, 2021 at 1:32 AM Martin Sebor via Gcc-patches wrote: With no optimization, -Wformat-overflow

Re: [PATCH] rs6000: Make density_test only for vector version

2021-05-07 Thread Richard Biener via Gcc-patches
On Fri, May 7, 2021 at 5:30 AM Kewen.Lin via Gcc-patches wrote: > > Hi, > > When I was investigating density_test heuristics, I noticed that > the current rs6000_density_test could be used for single scalar > iteration cost calculation, through the call trace: >

[Ada] Restore nnd capability

2021-05-07 Thread Pierre-Marie de Rodat
Move the nnd capability from Atree to Sinfo.Utils, because Atree is now compiled with "pragma Assertion_Policy (Ignore);", which disables pragma Debug. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.adb: Move nnd-related code from here, and leave a comment

[Ada] Robust detection of access-to-subprogram and access-to-object types

2021-05-07 Thread Pierre-Marie de Rodat
Routines Is_Access_Object_Type and Is_Access_Subprogram_Type were arbitrarily categorizing E_Access_Subtype as an access-to-object, even though it could represent an access-to-subprogram. Now those routines examine not just the Ekind, but also the Designated_Type of an access (sub)type, which is

[Ada] Reinitialize Private_Dependents when it is vanishing

2021-05-07 Thread Pierre-Marie de Rodat
We call Set_Ekind on a E_Incomplete_Subtype entity, and the Private_Dependents field vanishes. This patch resets it to zero, as required for vanishing fields. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Process_Incomplete_Dependents): Reset

[Ada] Fix type mismatch warnings during LTO bootstrap #4

2021-05-07 Thread Pierre-Marie de Rodat
There are 3 views of the exception record type in an Ada program: the master is declared as Exception_Data in System.Standard_Library, the compiler view is built by Cstand at the beginning of the compilation, and the C view is declared in the raise.h header file. These views must be sufficiently

[Ada] Variable-sized node types -- cleanup

2021-05-07 Thread Pierre-Marie de Rodat
Fix incorrect comments. Clean up marks. Rename Set_Ekind to be Mutate_Ekind to match Mutate_Nkind. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.ads, atree.adb, gen_il-gen.ads: Fix comments and clean up ??? marks. Rename Set_Ekind to be Mutate_Ekind.

[Ada] Fix link from body protected entry implementation to source code

2021-05-07 Thread Pierre-Marie de Rodat
CodePeer needs to recognize internally generated procedures that implement protected entries. Previously this was done with an extra field in the procedure entity; now it is done with an extra field in the procedure body. The new field bypasses the trouble with the procedure entity changing its

[Ada] Replace packed records with integers in low-level implementation

2021-05-07 Thread Pierre-Marie de Rodat
Accessing components in packed record types turns out to be too slow for practical use so this replaces them with integer types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.ads (Slot): Change to modular type. (Slot_1_Bit): Delete. (Slot_2_Bit):

[Ada] Fix type mismatch warnings during LTO bootstrap #3

2021-05-07 Thread Pierre-Marie de Rodat
This changes a type name to avoid a violation of the C++ ODR with LTO, sets convention C on another enumeration type and declares a matching enumeration type in C, fixes a blatant type mismatch, marks components as aliased in a couple of record types and tweaks one of them a bit more. Tested on

[Ada] Fix type mismatch warnings during LTO bootstrap #5

2021-05-07 Thread Pierre-Marie de Rodat
This changes the C interface to Ada.Exceptions.Exception_Propagation from using the opaque _Unwind_Ptr to using the explicit Exception_Id, which is the C view of the Exception_Data_Ptr declared in System.Standard_Library. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Fix type mismatch warnings during LTO bootstrap #2

2021-05-07 Thread Pierre-Marie de Rodat
This fixes the type of parameters and variables in the C code, changes the convention of Raise_From_Signal_Handler to C and uses a compatible boolean type for Is_Handled_By_Others. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * init.c (__gnat_raise_program_error): Fix

[Ada] Small cleanup in C header file

2021-05-07 Thread Pierre-Marie de Rodat
This fixes a few deviations from the GCC Coding Conventions, differences between declarations and definitions of functions and minor other things. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.h (Parent): Remove duplicate declaration. (Get_1_Bit_Field): Also

[Ada] Fix type mismatch warnings during LTO bootstrap #1

2021-05-07 Thread Pierre-Marie de Rodat
This sets convention C on enumeration types and functions declarations involving System.Address, and makes adjustements to fe.h accordingly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * errout.ads (Set_Identifier_Casing): Add pragma Convention C. * eval_fat.ads

[Ada] Implement aspect No_Controlled_Parts

2021-05-07 Thread Pierre-Marie de Rodat
This patch implements the No_Controlled_Parts aspect defined in AI12-0256 which when specified for a type will verify such type or any ancestors of such type with contain no controlled components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * aspects.ads: Add entries to

[Ada] Spurious error with component of unchecked_union type

2021-05-07 Thread Pierre-Marie de Rodat
Compiler rejects an equality operation on a record type when the nominal subtype of a component is a constrained subtype of an Unchecked_Union type, and that subtype is declared outside of the enclosing record declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Generate warning for negative literal of a modular type

2021-05-07 Thread Pierre-Marie de Rodat
A negative literal of a module type is interpreted with wrap-around as a large positive number. Warn if this value is not enclosed in a type qualification or type conversion explicitly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * opt.ads: Update comment for

[Ada] Remove End_Interp_List from the overloaded resolution API

2021-05-07 Thread Pierre-Marie de Rodat
Routine End_Interp_List was part of the API for overloaded resolution from the very beginning. However, it quickly become unnecessary, because both adding and removing interpretation maintains a No_Interp marker at the end of the interpretation list. The only effect of this routine was that it

[Ada] Attribute Address is not an interfering context in SPARK

2021-05-07 Thread Pierre-Marie de Rodat
Allow taking the address of a volatile object in SPARK, as it doesn't cause problems related to interfering contexts. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Flag_Object): Ignore prefixes of attribute Address.diff --git a/gcc/ada/sem_res.adb

[Ada] Crash on imported object with deep initialization and No_Aborts

2021-05-07 Thread Pierre-Marie de Rodat
Compiler aborts on an object declaration without an expression, when the type of the object includes controlled components and thus requires deep initialization, there are various restrictions in effect that prevent Abort statements, and there is a later Import pragma that applies to the object

[Ada] Computation of Shift_Left and large signed values

2021-05-07 Thread Pierre-Marie de Rodat
The computation of Shift_Left on signed values might wrongly overflow instead of generating a negative value. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_eval.adb (Fold_Shift): Fix computation of Shift_Left resulting in negative signed values.diff --git

[Ada] Fix signature mismatch for Defining_Entity

2021-05-07 Thread Pierre-Marie de Rodat
This fixes the signature mismatch recently introduced for Defining_Entity between the front-end proper and gigi. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads (Defining_Entity): Remove Empty_On_Errors parameter. (Defining_Entity_Or_Empty): New

[Ada] Minor efficiency improvement in containers

2021-05-07 Thread Pierre-Marie de Rodat
Move an assertion to be conditional on T_Check, so pragma Suppress (Tampering_Checks) will suppress it. Note that the Lock component being checked has the Atomic aspect. This is not a bug fix. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-conhel.adb (TC_Check):

[Ada] sigtramp: fix powerpc64 against -fPIC

2021-05-07 Thread Pierre-Marie de Rodat
Use a local label to set the TOC location on powerpc64 to prevent DT_TEXTREL, not supported by the VxWorks loader for shared libraries. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sigtramp-vxworks-target.inc: Use a local label for the TOC.diff --git

[Ada] Raise Constraint_Error for Compose and Scaling if Machine_Overflows

2021-05-07 Thread Pierre-Marie de Rodat
This is an optional behavior specified by the RM and it makes sense to do it when T'Machine_Overflows is True for the sake of consistency. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-fatgen.adb (Scaling): Raise Constraint_Error in the overflow case

[Ada] Move Has_Inferable_Discriminants to Sem_Util

2021-05-07 Thread Pierre-Marie de Rodat
Move the Has_Inferable_Discriminants utility to Sem_Util so that it can be reused inside GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Has_Inferable_Discriminants): Moved to Sem_Util. * sem_util.ads, sem_util.adb

[Ada] Spurious error on protected call in inherited postcondition

2021-05-07 Thread Pierre-Marie de Rodat
An inherited class-wide precondition of a primitive of a protected type cannot include a call to a protected primitive of the type, as specified in AI12-0166. This patch adds a guard to verify that this legality rule applies only to a precondition and not to a postcondition. Tested on

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

2021-05-07 Thread Richard Biener via Gcc-patches
On Fri, May 7, 2021 at 2:12 AM Martin Sebor wrote: > > On 5/6/21 8:32 AM, Aldy Hernandez wrote: > > > > > > On 5/5/21 9:26 AM, Richard Biener wrote: > >> On Wed, May 5, 2021 at 1:32 AM Martin Sebor via Gcc-patches > >> wrote: > >>> > >>> With no optimization, -Wformat-overflow and

[patch] Do not apply scalar storage order to pointer fields

2021-05-07 Thread Eric Botcazou
Hi, I didn't really think of pointer fields (nor of vector fields originally) when implementing the scalar_storage_order attribute, so they are swapped as well. As Ulrich pointed out, this is problematic to describe in DWARF and probably not very useful in any case, so the attached patch pulls

[Patch] contrib/gcc-changelog: Add/improve --help

2021-05-07 Thread Tobias Burnus
Hi all, hi Martin, when running the scripts manually, I tend to get confused which one is which. --help helps a bit :-) OK? Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung,

[PATCH] i386: Do not emit mask compares for mode sizes < 16 [PR100445]

2021-05-07 Thread Uros Bizjak via Gcc-patches
Recent addition of v*cond* patterns for MMXMODEI modes allows 64bit MMX modes to enter ix86_expand_sse_cmp. ix86_use_mask_cmp_p was not prepared to reject mode sizes < 16, resulting in ICE due to unavailability of 64bit masked PCOM instructions. 2021-05-07 Uroš Bizjak gcc/ PR

[PATCH] middle-end/100464 - avoid spurious TREE_ADDRESSABLE in folding debug stmts

2021-05-07 Thread Richard Biener
canonicalize_constructor_val was setting TREE_ADDRESSABLE on bases of ADDR_EXPRs but that's futile when we're dealing with CTOR values in debug stmts. This rips out the code which was added for Java and should have been an assertion when we didn't have debug stmts. Bootstrapped and tested on

Re: [PATCH] split loop for NE condition.

2021-05-07 Thread guojiufu via Gcc-patches
On 2021-05-06 16:27, Richard Biener wrote: On Thu, 6 May 2021, guojiufu wrote: On 2021-05-03 20:18, Richard Biener wrote: > On Thu, 29 Apr 2021, Jiufu Guo wrote: > >> When there is the possibility that overflow may happen on the loop index, >> a few optimizations would not happen. For example

Re: [PATCH] i386: Fix up 8-byte vcond* with -mxop [PR100445]

2021-05-07 Thread Uros Bizjak via Gcc-patches
On Fri, May 7, 2021 at 9:57 AM Jakub Jelinek wrote: > > Hi! > > ix86_expand_sse_movcc has special TARGET_XOP handling and the recent > addition of support of v*cond* patterns for MMXMODEI modes results in > ICEs because the expected pattern doesn't exist. We can handle it > using 128-bit vpcmov

[PATCH] i386: Fix up 8-byte vcond* with -mxop [PR100445]

2021-05-07 Thread Jakub Jelinek via Gcc-patches
Hi! ix86_expand_sse_movcc has special TARGET_XOP handling and the recent addition of support of v*cond* patterns for MMXMODEI modes results in ICEs because the expected pattern doesn't exist. We can handle it using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in other

[PATCH] libcpp: Fix up pragma preprocessing [PR100450]

2021-05-07 Thread Jakub Jelinek via Gcc-patches
Hi! Since the r0-85991-ga25a8f3be322fe0f838947b679f73d6efc2a412c https://gcc.gnu.org/legacy-ml/gcc-patches/2008-02/msg01329.html changes, so that we handle macros inside of pragmas that should expand macros, during preprocessing we print those pragmas token by token, with CPP_PRAGMA printed as