[PATCH 7/7] AVX512FP16: Enable vec_cmpmn/vcondmn expanders for HF modes.

2021-09-22 Thread liuhongt via Gcc-patches
From: Hongyu Wang gcc/ChangeLog: * config/i386/i386-expand.c (ix86_use_mask_cmp_p): Enable HFmode mask_cmp. * config/i386/sse.md (sseintvecmodelower): Add HF vector modes. (_store_mask): Extend to support HF vector modes. (vec_cmp): Likewise.

[PATCH 6/7] AVX512FP16: add truncmn2/extendmn2 expanders

2021-09-22 Thread liuhongt via Gcc-patches
From: Hongyu Wang gcc/ChangeLog: * config/i386/sse.md (extend2): New expander. (extendv4hf2): Likewise. (extendv2hfv2df2): Likewise. (trunc2): Likewise. (avx512fp16_vcvt2ph_): Rename to ... (truncv4hf2): ... this, and drop constraints.

[PATCH 5/7] AVX512FP16: Add float(uns)?mn2 expander

2021-09-22 Thread liuhongt via Gcc-patches
From: Hongyu Wang gcc/ChangeLog: * config/i386/sse.md (float2): New expander. (avx512fp16_vcvt2ph_): Rename to ... (floatv4hf2): ... this, and drop constraints. (avx512fp16_vcvtqq2ph_v2di): Rename to ... (floatv2div2hf2): ... this, and

[PATCH 4/7] AVX512FP16: Add fix(uns)?_truncmn2 for HF scalar and vector modes

2021-09-22 Thread liuhongt via Gcc-patches
From: Hongyu Wang NB: 64bit/32bit vectorize for HFmode is not supported for now, will adjust this patch when V2HF/V4HF operations supported. gcc/ChangeLog: * config/i386/i386.md (fix_trunchf2): New expander. (fixuns_trunchfhi2): Likewise. (*fixuns_trunchfsi2zext): New

[PATCH 3/7] AVX512FP16: Add expander for smin/maxhf3.

2021-09-22 Thread liuhongt via Gcc-patches
From: Hongyu Wang gcc/ChangeLog: * config/i386/i386.md (hf3): New expander. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512fp16-builtin-minmax-1.c: New test. --- gcc/config/i386/i386.md | 11 ++ .../i386/avx512fp16-builtin-minmax-1.c| 35

[PATCH 2/7] AVX512FP16: Add expander for fmahf4

2021-09-22 Thread liuhongt via Gcc-patches
gcc/ChangeLog: * config/i386/sse.md (FMAMODEM): extend to handle FP16. (VFH_SF_AVX512VL): Extend to handle HFmode. (VF_SF_AVX512VL): Deleted. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512fp16-fma-1.c: New test. * gcc.target/i386/avx512fp16vl-fma-1.c:

[PATCH 1/7] AVX512FP16: Add expander for rint/nearbyinthf2.

2021-09-22 Thread liuhongt via Gcc-patches
gcc/ChangeLog: * config/i386/i386.md (rinthf2): New expander. (nearbyinthf2): New expander. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512fp16-builtin-round-1.c: Add new testcase. --- gcc/config/i386/i386.md | 22 +++

[PATCH 0/7] AVX512FP16: Support bunch of expanders for HFmode and vector HFmodes

2021-09-22 Thread liuhongt via Gcc-patches
xfail are added for testcases related to truncmn2/extendmn2 expanders since V2HF/V4HFmode are not supported yet, they should be removed later. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Newly added runtime testcases passed on sde{-m32,}. Hongyu Wang (5): AVX512FP16: Add

[PATCH] wwwdocs: [GCC12] Mention Intel AVX512-FP16.

2021-09-22 Thread liuhongt via Gcc-patches
--- htdocs/gcc-12/changes.html | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 81f62fe3..14149212 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -165,8 +165,12 @@ a

Re: [PATCH][Hashtable 6/6] PR 68303 small size optimization

2021-09-22 Thread François Dumont via Gcc-patches
Ping ? On 16/08/21 9:03 pm, François Dumont wrote: On 17/07/20 2:58 pm, Jonathan Wakely wrote: On 17/11/19 22:31 +0100, François Dumont wrote: This is an implementation of PR 68303. I try to use this idea as much as possible to avoid computation of hash codes. Note that tests are not

Re: [RFC] Don't move cold code out of loop by checking bb count

2021-09-22 Thread Xionghu Luo via Gcc-patches
On 2021/9/23 10:13, Xionghu Luo via Gcc-patches wrote: On 2021/9/22 17:14, Richard Biener wrote: On Thu, Sep 9, 2021 at 3:56 AM Xionghu Luo wrote: On 2021/8/26 19:33, Richard Biener wrote: On Tue, Aug 10, 2021 at 4:03 AM Xionghu Luo wrote: Hi, On 2021/8/6 20:15, Richard Biener

Re: [RFC] Don't move cold code out of loop by checking bb count

2021-09-22 Thread Xionghu Luo via Gcc-patches
On 2021/9/22 17:14, Richard Biener wrote: On Thu, Sep 9, 2021 at 3:56 AM Xionghu Luo wrote: On 2021/8/26 19:33, Richard Biener wrote: On Tue, Aug 10, 2021 at 4:03 AM Xionghu Luo wrote: Hi, On 2021/8/6 20:15, Richard Biener wrote: On Mon, Aug 2, 2021 at 7:05 AM Xiong Hu Luo wrote:

[PATCH v4 1/2] Add -f[no-]direct-extern-access

2021-09-22 Thread H.J. Lu via Gcc-patches
Add -f[no-]direct-extern-access and nodirect_extern_access attribute. -fdirect-extern-access is the default and always use GOT to access undefined data and function symbols with nodirect_extern_access attribute, including in PIE and non-PIE. With -fno-direct-extern-access: 1. Always use GOT to

[PATCH v4 2/2] Add TARGET_ASM_EMIT_GNU_PROPERTY_NOTE

2021-09-22 Thread H.J. Lu via Gcc-patches
Generate the marker for -fno-direct-extern-access to indicate that the object file uses GOT to access all external symbols. Access to protected symbols in the resulting shared library is treated as local, which requires canonical function pointers and cannot be used with copy relocation. This

[PATCH v4 0/2] Implement indirect external access

2021-09-22 Thread H.J. Lu via Gcc-patches
Changes in the v4 patch. 1. Add nodirect_extern_access attribute. Changes in the v3 patch. 1. GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS support has been added to GNU binutils 2.38. But the -z indirect-extern-access linker option is only available for Linux/x86. However, the

Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.

2021-09-22 Thread Hongtao Liu via Gcc-patches
On Thu, Sep 23, 2021 at 9:48 AM Hongtao Liu wrote: > > On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor wrote: > > > > On 9/21/21 7:38 PM, Hongtao Liu wrote: > > > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor wrote: > > ... > > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c

Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.

2021-09-22 Thread Hongtao Liu via Gcc-patches
On Wed, Sep 22, 2021 at 10:21 PM Martin Sebor wrote: > > On 9/21/21 7:38 PM, Hongtao Liu wrote: > > On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor wrote: > ... > > diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c > > b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c >

[PATCH] Fix value uninitialization in vn_reference_insert_pieces [PR102400]

2021-09-22 Thread Feng Xue OS via Gcc-patches
Bootstrapped/regtested on x86_64-linux. Thanks, Feng --- 2021-09-23 Feng Xue gcc/ChangeLog PR tree-optimization/102400 * tree-ssa-sccvn.c (vn_reference_insert_pieces): Initialize result_vdef to zero value. --- gcc/tree-ssa-sccvn.c | 1 + 1 file changed, 1 insertion(+)

[PATCH] Fix null-pointer dereference in delete_dead_or_redundant_call [PR102451]

2021-09-22 Thread Feng Xue OS via Gcc-patches
Bootstrapped/regtested on x86_64-linux and aarch64-linux. Thanks, Feng --- 2021-09-23 Feng Xue gcc/ChangeLog: PR tree-optimization/102451 * tree-ssa-dse.c (delete_dead_or_redundant_call): Record bb of stmt before removal. --- gcc/tree-ssa-dse.c | 5 +++-- 1 file

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread Segher Boessenkool
Hi! On Tue, Sep 21, 2021 at 05:35:56PM -0500, Bill Schmidt wrote: > Previously zero-width bit fields were removed from structs, so that > otherwise > homogeneous aggregates were treated as such and passed in FPRs and VSRs. > This was incorrect behavior per the ELFv2 ABI. Now that these fields

Re: [PATCH] c++: fix wrong fixit hints for misspelled typedef [PR77565]

2021-09-22 Thread Michel Morin via Gcc-patches
On Thu, Sep 23, 2021 at 5:09 AM Jason Merrill wrote: > > On 9/21/21 20:53, Michel Morin wrote: > > On Tue, Sep 21, 2021 at 5:24 AM Jason Merrill wrote: > >> > >> On 9/17/21 13:31, Michel Morin wrote: > >>> On Fri, Sep 17, 2021 at 3:23 AM Jason Merrill wrote: > > On 9/16/21 11:50,

Re: [PATCH] rs6000: Modify the way for extra penalized cost

2021-09-22 Thread Segher Boessenkool
Hi! On Tue, Sep 21, 2021 at 11:24:08AM +0800, Kewen.Lin wrote: > on 2021/9/18 上午6:01, Segher Boessenkool wrote: > > On Thu, Sep 16, 2021 at 09:14:15AM +0800, Kewen.Lin wrote: > >> The way with nunits * stmt_cost can get one much exaggerated > >> penalized cost, such as: for V16QI on P8, it's 16 *

Re: [PATCH] Overhaul jump thread state in forward threader.

2021-09-22 Thread Jeff Law via Gcc-patches
On 9/22/2021 12:41 PM, Aldy Hernandez wrote: I've been pulling state from across the forward jump threader into the jt_state class, but it it still didn't feel right. The ultimate goal was to keep track of candidate threading paths so that the simplifier could simplify statements with the

Re: [PATCH] configure: Update --help output for --with-multilib-list

2021-09-22 Thread Jim Wilson
On Fri, Sep 17, 2021 at 4:39 AM Jonathan Wakely via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > The list of architectures that support the option is incomplete. > > gcc/ChangeLog: > > * configure.ac: Fix --with-multilib-list description. > * configure: Regenerate. > > OK for

Fortran: Improve file-reading error diagnostic [PR55534] (was: Re: [Patch] Fortran: Improve -Wmissing-include-dirs warnings [PR55534])

2021-09-22 Thread Tobias Burnus
Hi Harald, On 22.09.21 20:29, Harald Anlauf via Gcc-patches wrote: What I find a bit confusing - from the viewpoint of a user - is the case of using the preprocessor (-cpp), as one gets e.g. : Warning: ./no/such/dir: No such file or directory [-Wmissing-include-dirs] while without -cpp:

Re: [PATCH v3] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/5/21 15:14, Uecker, Martin wrote: Here is the third version of the patch. This also fixes the index zero case. Thus, this should be a complete fix for 91038 and should fix all cases also supported by clang. Still not working is returning a struct of variable size from a statement

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread Bill Schmidt via Gcc-patches
Hi Jakub, On 9/22/21 11:33 AM, Jakub Jelinek wrote: On Wed, Sep 22, 2021 at 05:02:15PM +0200, Jakub Jelinek via Gcc-patches wrote: @@ -6298,7 +6298,8 @@ rs6000_aggregate_candidate (const_tree type, machine_mode *modep, return -1; count = rs6000_aggregate_candidate (TREE_TYPE

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/21/21 20:34, Martin Sebor wrote: On 9/21/21 3:40 PM, Jason Merrill wrote: On 9/17/21 12:02, Martin Sebor wrote: On 9/8/21 2:06 PM, Jason Merrill wrote: On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t

Re: [PATCH] c++: fix wrong fixit hints for misspelled typedef [PR77565]

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/21/21 20:53, Michel Morin wrote: On Tue, Sep 21, 2021 at 5:24 AM Jason Merrill wrote: On 9/17/21 13:31, Michel Morin wrote: On Fri, Sep 17, 2021 at 3:23 AM Jason Merrill wrote: On 9/16/21 11:50, Michel Morin wrote: On Thu, Sep 16, 2021 at 5:44 AM Jason Merrill wrote: On 9/14/21

Re: [PATCH] c++: improve dumping of templated decls

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/22/21 11:56, Patrick Palka wrote: This makes the dumping routines output more information for templated decls, to help streamline debugging. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. gcc/cp/ChangeLog: * ptree.c (cxx_print_decl): Dump the

Re: [PATCH] c++: error message for dependent template members [PR70417]

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/17/21 18:22, Anthony Sharp wrote: And also re-attaching the patch! On Fri, 17 Sept 2021 at 23:17, Anthony Sharp wrote: Re-adding gcc-patches@gcc.gnu.org. -- Forwarded message - From: Anthony Sharp Date: Fri, 17 Sept 2021 at 23:11 Subject: Re: [PATCH] c++: error message

Re: [PATCH V3 0/6] Initial support for AVX512FP16

2021-09-22 Thread Joseph Myers
On Wed, 22 Sep 2021, Iain Sandoe wrote: > However, note that the use of __MACH__ to guard the Mach-O code has been > there for a long time (it is present in all open branches). So it's possible > that has > been silently doing the wrong thing for some time, That's "wrong thing" as in having

Re: [PATCH] Objective-C: fix class_ro layout for non-LP64

2021-09-22 Thread Iain Sandoe
Hi Matt, thanks for the patch. > On 21 Sep 2021, at 23:29, Matt Jacobson via Gcc-patches > wrote: > > Fix class_ro layout for non-LP64. > On LP64, the requisite padding is added at a lower level. However, the behaviour is changed - the existing implementation is explicit about the

[PATCH] Overhaul jump thread state in forward threader.

2021-09-22 Thread Aldy Hernandez via Gcc-patches
I've been pulling state from across the forward jump threader into the jt_state class, but it it still didn't feel right. The ultimate goal was to keep track of candidate threading paths so that the simplifier could simplify statements with the path as context. This patch completes the

Re: [Patch] Fortran: Improve -Wmissing-include-dirs warnings [PR55534]

2021-09-22 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 21.09.21 um 21:22 schrieb Tobias Burnus: While the previous patch fixed -Wno-missing-include-dirs and sorted out some inconsistencies with libcpp warnings, it had two issues: * Some superfluous warnings were printed, e.g. for     gfortran nonexisting/file.f90   there was a

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Antony Polukhin via Gcc-patches
ср, 22 сент. 2021 г. в 20:44, Jonathan Wakely : > > On Wed, 22 Sept 2021 at 18:09, Antony Polukhin wrote: > > > > std::unique_ptr allows construction from std::unique_ptr of derived > > type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If > > std::default_delete is used with

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Ville Voutilainen via Gcc-patches
On Wed, 22 Sept 2021 at 20:49, Antony Polukhin wrote: > > ср, 22 сент. 2021 г. в 20:23, Ville Voutilainen : > > > > On Wed, 22 Sept 2021 at 20:09, Antony Polukhin via Libstdc++ > > wrote: > > > > > > std::unique_ptr allows construction from std::unique_ptr of derived > > > type as per

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-22 Thread Jeff Law via Gcc-patches
On 9/21/2021 6:54 AM, Roger Sayle wrote: That define_insn is making my eyes bleed! I think that's the most convincing argument I've ever read on gcc-patches, and I can see now what Segher is so opposed to. Then you haven't seen enough patterns or your eyes haven't toughened up through the

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Antony Polukhin via Gcc-patches
ср, 22 сент. 2021 г. в 20:23, Ville Voutilainen : > > On Wed, 22 Sept 2021 at 20:09, Antony Polukhin via Libstdc++ > wrote: > > > > std::unique_ptr allows construction from std::unique_ptr of derived > > type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If > > std::default_delete

Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-22 Thread Jeff Law via Gcc-patches
On 9/21/2021 6:01 AM, Richard Sandiford via Gcc-patches wrote: [Using this is a convenient place to reply to the thread as a whole] Richard Biener via Gcc-patches writes: On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool wrote: On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Sept 2021 at 18:09, Antony Polukhin wrote: > > std::unique_ptr allows construction from std::unique_ptr of derived > type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If > std::default_delete is used with std::unique_ptr, then after such > construction a delete is

Re: [PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Ville Voutilainen via Gcc-patches
On Wed, 22 Sept 2021 at 20:09, Antony Polukhin via Libstdc++ wrote: > > std::unique_ptr allows construction from std::unique_ptr of derived > type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If > std::default_delete is used with std::unique_ptr, then after such > construction a

[PATCH] assert that deleting by pointer to base in unique_ptr does not cause UB

2021-09-22 Thread Antony Polukhin via Gcc-patches
std::unique_ptr allows construction from std::unique_ptr of derived type as per [unique.ptr.single.asgn] and [unique.ptr.single.ctor]. If std::default_delete is used with std::unique_ptr, then after such construction a delete is called on a pointer to base. According to [expr.delete] calling a

Re: PING**2 – Re: [Patch] Fortran: Handle allocated() with coindexed scalars [PR93834] (was: [PATCH] PR fortran/93834 - [9/10/11/12 Regression] ICE in trans_caf_is_present, at fortran/trans-intrinsic.

2021-09-22 Thread Tobias Burnus
(1) PING**2 (2) However, as it causes for others test-suite fails,* the https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579965.html [Patch] Fortran: Improve -Wmissing-include-dirs warnings [PR55534] is probably more important. [* I don't see it locally as it probably uses

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 22, 2021 at 05:02:15PM +0200, Jakub Jelinek via Gcc-patches wrote: > > > > @@ -6298,7 +6298,8 @@ rs6000_aggregate_candidate (const_tree type, > > > > machine_mode *modep, > > > > return -1; > > > > count = rs6000_aggregate_candidate (TREE_TYPE (type), modep, > > > >

[PATCH 2/2] arm: implement -mbranch-protection command line option

2021-09-22 Thread Andrea Corallo via Gcc-patches
Hi all, second patch of a series that enables Armv8.1-M in GCC adding Branch Target Identification Mechanism [1]. This patch implements the -mbranch-protection option. Possible values are "none", "bti" and "standard". When the provided value is "bti" o "standard" the bti pass is run. By defaut

[PATCH] c++: improve dumping of templated decls

2021-09-22 Thread Patrick Palka via Gcc-patches
This makes the dumping routines output more information for templated decls, to help streamline debugging. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? gcc/cp/ChangeLog: * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of a TEMPLATE_DECL. Dump the

[PATCH 1/2] arm: add arm bti pass

2021-09-22 Thread Andrea Corallo via Gcc-patches
Hi all, this patch is part of a series that enables Armv8.1-M in GCC and adds Branch Target Identification Mechanism [1]. This patch moves and generalize the Aarch64 "bti" pass so it can be used also by the Arm backend. The pass iterates through the instructions and adds the necessary BTI

[PATCH] top-level configure: setup target_configdirs based on repository

2021-09-22 Thread Andrew Burgess
The top-level configure script is shared between the gcc repository and the binutils-gdb repository. The target_configdirs variable in the configure.ac script, defines sub-directories that contain components that should be built for the target using the target tools. Some components, e.g. zlib,

Re: [PATCH, Fortran] diagnostic for argument w/type parameters for assumed-type dummy

2021-09-22 Thread Tobias Burnus
On 22.09.21 16:58, Sandra Loosemore wrote: This patch is adds the missing diagnostic noted in PR fortran/101319. OK to commit? LGTM. Thanks! For reference, the F2018 wording is: "If the actual argument is of a derived type that has type parameters, type-bound procedures, or final

RE: [PATCH 1/5]AArch64 sve: combine inverted masks into NOTs

2021-09-22 Thread Tamar Christina via Gcc-patches
Hi, Sending a new version of the patch because I noticed the pattern was overriding the nor pattern. A second pattern is needed to capture the nor case as combine will match the longest sequence first. So without this pattern we end up de-optimizing nor and instead emit two nots. I did not

[Ada] Simplify contract of Ada.Strings.Fixed.Trim for proof

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Use of two nested existential quantications makes proof brittle. Use instead explicit values for the bounds given by Index_Non_Blank, like done in Ada.Strings.Bounded. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-strfix.ads (Trim): Simplify contracts. *

[Ada] Reuse routines for detecting attributes Old and Result

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to handling of attribute 'Old in Contract_Cases; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Op_Eq): Reuse Is_Attribute_Result. * exp_prag.adb (Expand_Attributes): Reuse Is_Attribute_Old.diff

[Ada] Spurious error on deferred constant with predicate

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Do not insert a predicate check after a deferred constant declaration, as the constant is not elaborated at this point, but only at the point of its completion. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Do not insert a

[Ada] Fix conformance errors and erroneous code

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes many cases where a formal parameter is declared as Node_Id on the spec, and Entity_Id on the body (and similar), which is illegal according to the conformance rules. It also removes some erroneous pragmas Suppress, and initializes the uninitialized variables that were being read.

[Ada] Clarify parts of Ada.Strings.Unbounded in SPARK or not

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Except for the Free procedure which should not be called in SPARK code (as it could be called on pointers to the stack), the rest of the public API of Ada.Strings.Unbounded is valid in SPARK. Mark the private part not in SPARK as it uses controlled types. Tested on x86_64-pc-linux-gnu, committed

[Ada] Update status of some attributes

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
These attributes are no longer GNAT specific. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * snames.ads-tmpl: Update status of some attributes.diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@

[Ada] VxWorks inconsistent use of return type (STATUS)

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Type STATUS is made a new int with constants OK and ERROR declared. In code where ERROR clashes with an already defined integer value, the clashing variable is renamed to IERR. In other clashes where STATUS is a variable that variable is renamed. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] More flexibility in preprocessor

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
When using -gnatd.M (or in codepeer mode), we want to be more flexible in the preprocessor syntax, to accomodate better legacy toolchains. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * prep.adb (Preprocess): Allow for more flexibility when Relaxed_RM_Semantics is

[Ada] Contracts written for the Ada.Strings.Bounded library

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Written SPARK contracts describing the behaviours of all functions of the Ada.Strings.Bounded library. All contracts are replicated in Ada.Strings.Superbounded, the package that provides the explicit implementation of bounded strings. The contracts (with the exception of Trim, which uses search

[Ada] Add adequate guard before calling First_Rep_Item

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
New contracts on Ada.Strings.Bounded revealed an unprotected call to First_Rep_Item on a possibly empty node. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Build_Predicate_Functions): Add guard.diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb ---

[Ada] VxWorks inconsistent use of return type (BOOL)

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Type BOOL is made a new int to be consistent with the typedef used in the C header files. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-vxwext.ads (BOOL): New int type. (Interrupt_Context): Change return type to BOOL. *

[Ada] Add Package_Body helper routine to be used in GNATprove

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
We already had Subprogram_[Body|Spec|Specification] family of routines; now we also have a symmetrical Package_[Body|Spec|Specification] family. The added Package_Body routine is essentially moved from GNATprove, but for simplicity it doesn't support package body entities. Tested on

[Ada] Fix infinite loop in compilation of illegal code

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
When rewriting a derived type declaration into a subtype declaration, the aspect specifications were shared in a way that made the aspect point to a node outside of the tree as parent node. This could lead to an infinite loop on illegal code using a non-static value for attribute Object_Size of

[Ada] Removal of technical debt

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
This is an iterative patch as part of a greater project to reduce the amount of technical debt present in the frontend of the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * ali.adb, ali.ads (Scan_ALI): Remove use of deprecated parameter Ignore_ED, and all

[Ada] More precise analysis of function renamings in GNATprove

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
When a function renaming has a contract, it is important for GNATprove that it is not treated as a simple wrapper, otherwise the link between the renamed function and its renaming is lost for proof. Instead, it should be treated as an expression function. There is no impact on compilation.

[Ada] Fix access to predicated parent in Itype

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Getter function Predicated_Parent expects to be called on subtypes only, which was not enforced always, possibly leading to assertion failures on compiler built with assertions. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Build_Predicate_Functions): Access

[Ada] Allow more cases of import with Relaxed_RM_Semantics

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Such as importing a package as was accepted by JGNAT, for use in analyzers such as SPARK or CodePeer. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Process_Import_Or_Interface): Relax error when Relaxed_RM_Semantics.diff --git a/gcc/ada/sem_prag.adb

[Ada] Improve performance for case-insensitive regular expressions

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
An existing optimization substantially improves performance in the case of checking for pattern matches where all possible matches are known to start with the same character. Generalize this optimization to also apply in the case of a case-insensitive comparison (so that there are two possible

[Ada] Remove System.Img_Enum_New unit

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
It was still needed only because of bootstrap path considerations that are obsolete after the recent overhaul of the bootstrap process. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-imenne.ads, libgnat/s-imenne.adb: Delete. * gcc-interface/Make-lang.in

[Ada] Fix obsolete comments/name referring to girder discriminants

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
This name was changed in 2002 to stored discriminants, but some comments and variable names were not converted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo.ads: Fix comments. * exp_aggr.adb: Fix variable name. * exp_util.adb: Fix comments.

[Ada] VxWorks inconsistent use of return type (Int_Unlock)

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Int_Unlock/intUnlock is incorrectly declared as a function. In the VxWorks headers intUnlock is type void. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-osinte__vxworks.ads: Make procedure vice function. * libgnarl/s-vxwext.ads: Likewise. *

[Ada] VxWorks inconsistent use of return type (vx_freq_t)

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Several inconsistencies were found. They will be submitted as separate proposed fixes. The approach is to make them "types" rather than "subtypes" in order to catch inconsistencies in their usage, and to declare them in a central package. System.VxWorks.Ext was chosen, the only difficulty with

[Ada] Replace use of 'Image with use of Error_Msg_Uint

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
'Image is too recent for bootstraping and shouldn't be used when emitting error messages in any case. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_case.adb (Composite_Case_Ops): Replace 'Image with Error_Msg_Uint.diff --git a/gcc/ada/sem_case.adb

[Ada] Generate temporary for if-expression with -fpreserve-control-flow

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
When an if-expression is a condition in an outer decision, the compiler may entirely encode the interplay between the two decisions, i.e. the if-expression and the outer one, in the control-flow graph, effectively creating branches that are shared between the two decisions. This makes it very

[Ada] Add -gnatX support for casing on array values

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Improve existing support for the Ada extension feature of casing on composite values to handle casing on array values; in particular, casing on an array value whose subtype is unconstrained (or dynamically constrained) so that choices in the case statement may have differing lengths. This commit

[Ada] Fix imprecise wording for error on scalar storage order

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
The current error message does not distinguish the component clause case from the packed case, which can be confusing in the latter case. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * freeze.adb (Check_Component_Storage_Order): Give a specific error message for

[Ada] Make Ada.Task_Initialization compatible with No_Elaboration_Code_All

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
So that this unit can be used and called even before elaboration has started, to ensure very early registration via e.g. C code. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-tasini.ads, libgnarl/a-tasini.adb: Make compatible with

[Ada] Change message format on missing return

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
To make it compatible with -gnatwE so that this warning is easier to spot when needed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Check_Returns): Change message on missing return.diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb ---

[Ada] Mark gnatfind and gnatxref obsolete

2021-09-22 Thread Pierre-Marie de Rodat via Gcc-patches
Before removing them completely. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gnatfind.adb, gnatxref.adb: Mark these tools as obsolete before removing them completely.diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb --- a/gcc/ada/gnatfind.adb +++

Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.

2021-09-22 Thread Martin Sebor via Gcc-patches
On 9/22/21 8:21 AM, Martin Sebor wrote: On 9/21/21 7:38 PM, Hongtao Liu wrote: On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor wrote: ... diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c index 1d79930cd58..9351f7e7a1a 100644 ---

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 22, 2021 at 09:43:23AM -0500, Bill Schmidt wrote: > > How previously? is this one that will need all the backports? > > No, the change happened recently on trunk. It is actually more complex. Both C and C++ FEs thought they were removing zero bit fields, but neither did that, then

[PATCH, Fortran] diagnostic for argument w/type parameters for assumed-type dummy

2021-09-22 Thread Sandra Loosemore
This patch is adds the missing diagnostic noted in PR fortran/101319. OK to commit? -Sandra commit 9d5b9062d728d1b1bf5acfb914e06d776bdcdb60 Author: Sandra Loosemore Date: Wed Sep 22 07:49:17 2021 -0700 Fortran: diagnostic for argument w/type parameters for assumed-type dummy

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread Bill Schmidt via Gcc-patches
On 9/22/21 9:35 AM, will schmidt wrote: On Tue, 2021-09-21 at 17:35 -0500, Bill Schmidt wrote: Hi! Previously zero-width bit fields were removed from structs, so that otherwise homogeneous aggregates were treated as such and passed in FPRs and VSRs. This was incorrect behavior per the ELFv2

Re: [PATCH] c++: concept-ids and value-dependence [PR102412]

2021-09-22 Thread Patrick Palka via Gcc-patches
On Tue, 21 Sep 2021, Jason Merrill wrote: > On 9/21/21 09:30, Patrick Palka wrote: > > case TEMPLATE_ID_EXPR: > > - return concept_definition_p (TREE_OPERAND (expression, 0)); > > + return concept_definition_p (TREE_OPERAND (expression, 0)) > > + &&

Re: [PATCH] rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change (PR102024)

2021-09-22 Thread will schmidt via Gcc-patches
On Tue, 2021-09-21 at 17:35 -0500, Bill Schmidt wrote: > Hi! > > Previously zero-width bit fields were removed from structs, so that otherwise > homogeneous aggregates were treated as such and passed in FPRs and VSRs. > This was incorrect behavior per the ELFv2 ABI. Now that these fields are no

Re: [PATCH] Enable auto-vectorization at O2 with very-cheap cost model.

2021-09-22 Thread Martin Sebor via Gcc-patches
On 9/21/21 7:38 PM, Hongtao Liu wrote: On Mon, Sep 20, 2021 at 4:13 AM Martin Sebor wrote: ... diff --git a/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c b/gcc/testsuite/c-c++-common/Wstringop-overflow-2.c index 1d79930cd58..9351f7e7a1a 100644 ---

*PING* [PATCH] doc: improve -fsanitize=undefined description

2021-09-22 Thread Diane Meirowitz via Gcc-patches
Please review my patch. It is tiny. Thank you. Diane On 9/15/21, 5:02 PM, "Diane Meirowitz" wrote: doc: improve -fsanitize=undefined description gcc/ChangeLog: * doc/invoke.texi: add link to UndefinedBehaviorSanitizer documentation, mention

Re: [COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-22 Thread Andrew MacLeod via Gcc-patches
On 9/22/21 4:25 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 3:50 PM Andrew MacLeod wrote: On 9/21/21 9:32 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 2:57 PM Andrew MacLeod wrote: On 9/21/21 2:14 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 8:09 AM Richard Biener wrote:

Re: [PATCH] Obsolete hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11*

2021-09-22 Thread Richard Biener via Gcc-patches
On Wed, 22 Sep 2021, John David Anglin wrote: > On 2021-09-20 3:00 a.m., Richard Biener wrote: > > As discussed, I'm going to push this (and a changes.html entry) when > > it was included in a bootstrap/regtest cycle. > GCC 12 still builds on hppa2.0w-hp-hpux11.11 with --enable-obsolete: >

Re: [PATCH] Obsolete hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11*

2021-09-22 Thread John David Anglin
On 2021-09-20 3:00 a.m., Richard Biener wrote: > As discussed, I'm going to push this (and a changes.html entry) when > it was included in a bootstrap/regtest cycle. GCC 12 still builds on hppa2.0w-hp-hpux11.11 with --enable-obsolete:

[COMMITTED] Check for BB before calling register_outgoing_edges.

2021-09-22 Thread Aldy Hernandez via Gcc-patches
We may be asked to fold an artificial statement not in the CFG. Since there are no outgoing edges from those, avoid calling register_outgoing_edges. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-fold.cc (fold_using_range::range_of_range_op): Move check for non-empty BB

[COMMITTED] path solver: Use range_on_path_entry instead of looking at equivalences.

2021-09-22 Thread Aldy Hernandez via Gcc-patches
[Thanks for spotting this Andrew.] Cycling through equivalences to improve a range is nowhere near as efficient as asking the ranger what the range on entry is. Testing on a hybrid VRP threader, shows that this improves our VRP threading benefit from 14.5% to 18.5% and our overall jump threads

Re: [committed] Make test names unique for a couple of goacc tests

2021-09-22 Thread Thomas Schwinge
Hi! On 2021-09-19T11:35:00-0600, Jeff Law via Gcc-patches wrote: > A couple of goacc tests do not have unique names. Thanks for fixing this up, and sorry, largely my "fault", I suppose. ;-| > This causes problems > for the test comparison script when one of the test passes and the other >

Re: [PATCH 59/62] AVX512FP16: Support load/store/abs intrinsics.

2021-09-22 Thread Hongtao Liu via Gcc-patches
I'm going to check in 4 patches. [PATCH 59/62] AVX512FP16: Support load/store/abs intrinsics. [PATCH 60/62] AVX512FP16: Add reduce operators(add/mul/min/max). [PATCH 61/62] AVX512FP16: Add complex conjugation intrinsic instructions. [PATCH 62/62] AVX512FP16: Add permutation and mask blend

[Committed] IBM Z: TPF: Add cc clobber to profiling expanders

2021-09-22 Thread Andreas Krebbel via Gcc-patches
The code sequence emitted uses CC internally. gcc/ChangeLog: * config/s390/tpf.md (prologue_tpf, epilogue_tpf): Add cc clobber. --- gcc/config/s390/tpf.md | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/s390/tpf.md b/gcc/config/s390/tpf.md index

Re: [PATCH 3/N] Come up with casm global state.

2021-09-22 Thread Richard Biener via Gcc-patches
On Thu, Sep 16, 2021 at 3:12 PM Martin Liška wrote: > > This patch comes up with asm_out_state and a new global variable casm. > > Tested on all cross compilers. > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? * output.h (struct

Re: [PATCH][GCC] arm: Add Cortex-R52+ multilib

2021-09-22 Thread Richard Earnshaw via Gcc-patches
I think the RTEMS multilibs are based on the products that RTEMS supports, so this is really the RTEMS maintainers' call. Joel? On 22/09/2021 09:46, Przemyslaw Wirkus via Gcc-patches wrote: Patch is adding multilib entries for `cortex-r52plus` CPU. See:

Re: [PATCH 2/N] Do not hide asm_out_file in ASM_OUTPUT_ASCII.

2021-09-22 Thread Richard Biener via Gcc-patches
On Thu, Sep 16, 2021 at 12:01 PM Martin Liška wrote: > > Again a preparation patch that was tested on all cross compilers. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? I think you want to retain -FILE *_hide_asm_out_file = (MYFILE);

Re: [PATCH Take 2] More NEGATE_EXPR folding in match.pd

2021-09-22 Thread Richard Biener via Gcc-patches
On Fri, Sep 10, 2021 at 11:22 AM Roger Sayle wrote: > > > Hi Richard, > Thanks for suggestion, which cleanly solves the problem I was encountering. > This revised patch adds a Boolean simplify argument to tree-ssa-sccvn.c's > vn_nary_build_or_lookup_1 to control whether to simplification should

  1   2   >