Re: [PATCH] ipa-cp: Fix assert triggering with -fno-toplevel-reorder (PR 106260)

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 11:06 PM Martin Jambor wrote: > > Hi, > > with -fno-toplevel-reorder (and -fwhole-program), there apparently can > be local functions without any callers. Did you check why? Can't we fix that? > This is something that IPA-CP > does not like because its propagation verif

Re: [PATCH] match.pd: Add new abs pattern [PR94290]

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 9:36 PM Andrew Pinski via Gcc-patches wrote: > > On Wed, Jul 13, 2022 at 12:26 PM Sam Feifer via Gcc-patches > wrote: > > > > This patch is intended to fix a missed optimization in match.pd. It > > optimizes (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). I had to >

Re: [PATCH v3] Simplify memchr with small constant strings

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 6:50 PM H.J. Lu wrote: > > When memchr is applied on a constant string of no more than the bytes of > a word, simplify memchr by checking each byte in the constant string. > > int f (int a) > { >return __builtin_memchr ("AE", a, 2) != 0; > } > > is simplified to > > in

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 4:57 PM Alexander Monakov wrote: > > On Wed, 13 Jul 2022, Richard Biener wrote: > > > > > The thing to check would be incoming abnormal edges in > > > > can_duplicate_block_p, not (only) returns twice functions? > > > > > > Unfortunately not, abnormal edges are also used fo

[PATCH] i386: Fix _mm_[u]comixx_{ss,sd} codegen and add PF result. [PR106113]

2022-07-13 Thread Kong, Lingling via Gcc-patches
Hi, The patch is to fix _mm_[u]comixx_{ss,sd} codegen and add PF result. These intrinsics have changed over time, like `_mm_comieq_ss ` old operation is `RETURN ( a[31:0] == b[31:0] ) ? 1 : 0`, and new operation update is `RETURN ( a[31:0] != NaN AND b[31:0] != NaN AND a[31:0] == b[31:0] ) ? 1

[PATCH] Extend 64-bit vector bit_op patterns with ?r alternative

2022-07-13 Thread liuhongt via Gcc-patches
And split it to GPR-version instruction after reload. > ?r was introduced under the assumption that we want vector values > mostly in vector registers. Currently there are no instructions with > memory or immediate operand, so that made sense at the time. Let's > keep ?r until logic instructions w

RE: [x86_64 PATCH] Improved Scalar-To-Vector (STV) support for TImode to V1TImode.

2022-07-13 Thread Roger Sayle
On Mon, Jul 11, 2022, H.J. Lu wrote: > On Sun, Jul 10, 2022 at 2:38 PM Roger Sayle > wrote: > > Hi HJ, > > > > I believe this should now be handled by the post-reload (CSE) pass. > > Consider the simple test case: > > > > __int128 a, b, c; > > void foo() > > { > > a = 0; > > b = 0; > > c

Re: [PATCH v3] RISC-V/testsuite: constraint some of tests to hard_float

2022-07-13 Thread Vineet Gupta
On 5/29/22 20:50, Kito Cheng via Gcc-patches wrote: Committed, thanks! Can this be backported to gcc-12 please. Thx, -Vineet On Fri, May 27, 2022 at 10:37 AM Vineet Gupta wrote: Commit 9ddd44b58649d1d ("RISC-V: Provide `fmin'/`fmax' RTL pattern") added tests which check for hard float in

Re: [PATCH] testsuite: constraint some of fp tests to hard_float

2022-07-13 Thread Vineet Gupta
Hi Jeff, On 6/26/22 12:05, Jeff Law via Gcc-patches wrote: On 5/29/2022 9:53 PM, Vineet Gupta wrote: These tests validate fp conversions with various rounding modes which would not work on soft-float ABIs. On -march=rv64imac/-mabi=lp64 this reduces 5 unique failures (overall 35 due to multi

Re: [PATCH, rs6000] Additional cleanup of rs6000_builtin_mask

2022-07-13 Thread Kewen.Lin via Gcc-patches
Hi Will, Thanks for the cleanup! Some comments are inlined. on 2022/7/14 05:39, will schmidt wrote: > [PATCH, rs6000] Additional cleanup of rs6000_builtin_mask > > Hi, > Post the rs6000 builtins rewrite, some of the leftover builtin > code is redundant and can be removed. > This replace

Re: [PATCH] HIGH part of symbol ref is invalid for constant pool

2022-07-13 Thread Kewen.Lin via Gcc-patches
Hi Jeff, Thanks for the patch, one question is inlined below. on 2022/7/4 14:58, Jiufu Guo wrote: > The high part of the symbol address is invalid for the constant pool. In > function rs6000_cannot_force_const_mem, we already return true for > "HIGH with UNSPEC" rtx. During debug GCC, I found tha

Re: XFAIL 'offloading_enabled' diagnostics issue in 'libgomp.oacc-c-c++-common/reduction-5.c' [PR101551] (was: Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases)

2022-07-13 Thread Lewis Hyatt via Gcc-patches
On Tue, Jul 12, 2022 at 9:10 AM Tobias Burnus wrote: > On 12.07.22 13:50, Lewis Hyatt via Gcc-patches wrote: > > On Tue, Jul 12, 2022 at 2:33 AM Thomas Schwinge > > wrote: > >> On 2022-07-11T11:27:12+0200, I wrote: > >>> Oh my, PR101551 "[offloading] Differences in diagnostics etc." > >>> strike

[PATCH, rs6000] Additional cleanup of rs6000_builtin_mask

2022-07-13 Thread will schmidt via Gcc-patches
[PATCH, rs6000] Additional cleanup of rs6000_builtin_mask Hi, Post the rs6000 builtins rewrite, some of the leftover builtin code is redundant and can be removed. This replaces the remaining usage of bu_mask in rs6000_target_modify_macros() with checks against the rs6000_cpu directly. Thus

Re: [PATCH, rs6000] Cleanup some vstrir define_expand naming inconsistencies

2022-07-13 Thread Segher Boessenkool
On Wed, Jul 13, 2022 at 04:14:11PM -0500, will schmidt wrote: > On Wed, 2022-07-13 at 14:39 -0500, Segher Boessenkool wrote: > > I'm not a fan of "internal" either, it doesn't say anything. At > > least > > put it at the very end of the names please? > I'm easily convinced. ;-) I wonder if I shou

Re: [PATCH, rs6000] Cleanup some vstrir define_expand naming inconsistencies

2022-07-13 Thread will schmidt via Gcc-patches
On Wed, 2022-07-13 at 14:39 -0500, Segher Boessenkool wrote: > Hi! > > On Wed, Jul 13, 2022 at 01:18:29PM -0500, will schmidt wrote: > > This cleans up some of the naming around the vstrir and vstril > > instruction definitions, with some cosmetic changes for > > consistency. > > gcc/ > > *

[PATCH] ipa-cp: Fix assert triggering with -fno-toplevel-reorder (PR 106260)

2022-07-13 Thread Martin Jambor
Hi, with -fno-toplevel-reorder (and -fwhole-program), there apparently can be local functions without any callers. This is something that IPA-CP does not like because its propagation verifier checks that local functions do not end up with TOP in their lattices. Therefore there is an assert check

Re: [PATCH, rs6000] Cleanup some vstrir define_expand naming inconsistencies

2022-07-13 Thread Segher Boessenkool
Hi! On Wed, Jul 13, 2022 at 01:18:29PM -0500, will schmidt wrote: > This cleans up some of the naming around the vstrir and vstril > instruction definitions, with some cosmetic changes for consistency. > gcc/ > * config/rs6000/altivec.md (vstrir_code_): Rename > to vstrir_internal_.

Re: [PATCH] match.pd: Add new abs pattern [PR94290]

2022-07-13 Thread Andrew Pinski via Gcc-patches
On Wed, Jul 13, 2022 at 12:26 PM Sam Feifer via Gcc-patches wrote: > > This patch is intended to fix a missed optimization in match.pd. It optimizes > (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). I had to write a second > simplification in match.pd to handle the commutative property as t

C++: add -std={c,gnu}++{current,future}

2022-07-13 Thread Nathan Sidwell via Gcc-patches
Inspired by a user question. Jason, thoughts? Since C++ is such a moving target, Microsoft have /std:c++latest (AFAICT clang does not), to select the currently implemented version of the working paper. But the use of 'std:latest' is somewhat ambiguous -- the current std is C++20 -- that's the l

[PATCH] match.pd: Add new abs pattern [PR94290]

2022-07-13 Thread Sam Feifer via Gcc-patches
This patch is intended to fix a missed optimization in match.pd. It optimizes (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). I had to write a second simplification in match.pd to handle the commutative property as the match was not ocurring otherwise. Additionally, the pattern (x <= 0 ? -x

[pushed] libcpp: Avoid pessimizing std::move [PR106272]

2022-07-13 Thread Marek Polacek via Gcc-patches
std::move in a return statement can prevent the NRVO: PR106272 reports that we have two such cases in class label_text's member functions. We have -Wpessimizing-move that's supposed to detect problematic std::m

[PATCH, rs6000] Cleanup some vstrir define_expand naming inconsistencies

2022-07-13 Thread will schmidt via Gcc-patches
[PATCH, rs6000] Cleanup some vstrir define_expand naming inconsistencies Hi, This cleans up some of the naming around the vstrir and vstril instruction definitions, with some cosmetic changes for consistency. No functional changes. Regtested just in case, no regressions. :-) OK for trunk? Than

[PATCH] Add _GLIBCXX_DEBUG backtrace generation

2022-07-13 Thread François Dumont via Gcc-patches
libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation on demand Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace generation on _GLIBCXX_DEBUG assertions. Prerequisite is to have configure the lib with: --enable-libstdcxx-backtrace=yes libstdc++-v3/ChangeLog: * include/debug/f

Re: [PATCH v2] Simplify memchr with small constant strings

2022-07-13 Thread H.J. Lu via Gcc-patches
On Wed, Jul 13, 2022 at 5:35 AM Richard Biener wrote: > > On Tue, Jul 12, 2022 at 6:59 PM H.J. Lu wrote: > > > > On Fri, Jul 8, 2022 at 5:54 AM Richard Biener > > wrote: > > > > > > On Thu, Jul 7, 2022 at 6:45 PM H.J. Lu wrote: > > > > > > > > When memchr is applied on a constant string of no m

[PATCH v3] Simplify memchr with small constant strings

2022-07-13 Thread H.J. Lu via Gcc-patches
When memchr is applied on a constant string of no more than the bytes of a word, simplify memchr by checking each byte in the constant string. int f (int a) { return __builtin_memchr ("AE", a, 2) != 0; } is simplified to int f (int a) { return ((char) a == 'A' || (char) a == 'E') != 0; }

Re: [PATCH v2 4/4] aarch64: Move vreinterpret definitions into the compiler

2022-07-13 Thread Richard Sandiford via Gcc-patches
Andrew Carlotti writes: > This removes a significant number of intrinsic definitions from the arm_neon.h > header file, and reduces the amount of code duplication. The new macros and > data structures are intended to also facilitate moving other intrinsic > definitions out of the header file in fu

Re: [PATCH v2 3/4] aarch64: Consolidate simd type lookup functions

2022-07-13 Thread Richard Sandiford via Gcc-patches
Andrew Carlotti writes: > There were several similarly-named functions, which each built or looked up a > type using a different subset of valid modes or qualifiers. > > This change combines these all into a single function, which can additionally > handle const and pointer qualifiers. I like the

Re: [PATCH v2 2/4] aarch64: Remove qualifier_internal

2022-07-13 Thread Richard Sandiford via Gcc-patches
Andrew Carlotti writes: > This has been unused since 2014, so there's no reason to retain it. > > gcc/ChangeLog: > > * config/aarch64/aarch64-builtins.cc > (enum aarch64_type_qualifiers): Remove qualifier_internal. > (aarch64_init_simd_builtin_functions): Remove qualifier_interna

Re: [PATCH v2 1/4] aarch64: Add V1DI mode

2022-07-13 Thread Richard Sandiford via Gcc-patches
Andrew Carlotti writes: > We already have a V1DF mode, so this makes the vector modes more consistent. > > Additionally, this allows us to recognise uint64x1_t and int64x1_t types given > only the mode and type qualifiers (e.g. in aarch64_lookup_simd_builtin_type). > > gcc/ChangeLog: > > * c

libgo patch committed: Don't include in sysinfo.c

2022-07-13 Thread Ian Lance Taylor via Gcc-patches
This libgo patch stops including when building gen-sysinfo.go. Removing this doesn't change anything at least with glibc 2.33. The include was added in https://go.dev/cl/6100049 but it's not clear why. This should fix GCC PR 106266. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Co

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-13 Thread Jeff Law via Gcc-patches
On 7/13/2022 1:13 AM, Richard Biener via Gcc-patches wrote: On Tue, Jul 12, 2022 at 10:10 PM Alexander Monakov wrote: Apologies for the prolonged silence Richard, it is a bit of an obscure topic, and I was unsure I'd be able to handle any complications in a timely manner. I'm ready to revis

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-13 Thread Alexander Monakov via Gcc-patches
On Wed, 13 Jul 2022, Richard Biener wrote: > > > The thing to check would be incoming abnormal edges in > > > can_duplicate_block_p, not (only) returns twice functions? > > > > Unfortunately not, abnormal edges are also used for computed gotos, which > > are > > less magic than returns_twice edge

[COMMITTED] Use nonzero bits in range-ops to determine if < 0 is false.

2022-07-13 Thread Aldy Hernandez via Gcc-patches
For a signed integer, x < 0 is false if the sign bit in the nonzero bits of X is clear. Both CCP and ipa-cp can set the global nonzero bits in a range, which means we can now use some of that information in evrp and subsequent passes. I've adjusted two tests which now fold things earlier because

[COMMITTED] Clear nonzero mask when inverting ranges.

2022-07-13 Thread Aldy Hernandez via Gcc-patches
Every time we set a range we should take into account the nonzero mask. This happens automatically for the set() methods, plus all the other assignment, intersect, and union methods. Unfortunately I forgot about the invert code. Also, for good measure I audited the rest of the setters in value_r

[PATCH v2 4/4] aarch64: Move vreinterpret definitions into the compiler

2022-07-13 Thread Andrew Carlotti via Gcc-patches
This removes a significant number of intrinsic definitions from the arm_neon.h header file, and reduces the amount of code duplication. The new macros and data structures are intended to also facilitate moving other intrinsic definitions out of the header file in future. There is a a slight change

[PATCH v2 2/4] aarch64: Remove qualifier_internal

2022-07-13 Thread Andrew Carlotti via Gcc-patches
This has been unused since 2014, so there's no reason to retain it. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (enum aarch64_type_qualifiers): Remove qualifier_internal. (aarch64_init_simd_builtin_functions): Remove qualifier_internal check. --- diff --git a/gcc

[PATCH v2 3/4] aarch64: Consolidate simd type lookup functions

2022-07-13 Thread Andrew Carlotti via Gcc-patches
There were several similarly-named functions, which each built or looked up a type using a different subset of valid modes or qualifiers. This change combines these all into a single function, which can additionally handle const and pointer qualifiers. gcc/ChangeLog: * config/aarch64/aar

[PATCH v2 1/4] aarch64: Add V1DI mode

2022-07-13 Thread Andrew Carlotti via Gcc-patches
We already have a V1DF mode, so this makes the vector modes more consistent. Additionally, this allows us to recognise uint64x1_t and int64x1_t types given only the mode and type qualifiers (e.g. in aarch64_lookup_simd_builtin_type). gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc

[PATCH] Speed up DOM record_temporary_equivalences

2022-07-13 Thread Richard Biener via Gcc-patches
The following gets away computing a dominance bitmap when fast queries are not available and we are doing back_propagate_equivalences. The comuted bitmap can be cheaply kept up-to-date during the domwalk since it is simply the set of blocks on the domwalk stack. Abstraction of the threading makes

Re: [PATCH] c++: coroutines - Overlap variables in frame [PR105989]

2022-07-13 Thread Michal Jankovic via Gcc-patches
Hi Iain, thanks for the info. I have some follow-up questions. On Jul 12 2022, at 7:11 pm, Iain Sandoe wrote: > Hi Michal, > >> On 12 Jul 2022, at 16:14, Michal Jankovič >> wrote: > >> One other related thing I would like to investigate is reducing the >> number of compiler generated varia

Re: [PATCH v2] Simplify memchr with small constant strings

2022-07-13 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 6:59 PM H.J. Lu wrote: > > On Fri, Jul 8, 2022 at 5:54 AM Richard Biener > wrote: > > > > On Thu, Jul 7, 2022 at 6:45 PM H.J. Lu wrote: > > > > > > When memchr is applied on a constant string of no more than the bytes of > > > a word, simplify memchr by checking each byte

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 12:50 PM Andrew Carlotti wrote: > > On Wed, Jul 13, 2022 at 09:10:25AM +0100, Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > > > wrote: > > >> > > >> aarch64_general_gimple_fold_builtin doesn't

Re: [PATCH] lto-plugin: use -pthread only for detected targets

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 10:24 AM Martin Liška wrote: > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? Didn't we have it that way and not work? IIRC LDFLAGS is only used during configure link tests and _not_ substituted? > Thanks, > Martin > >

[PATCH] xtensa: Minor fix for FP constant synthesis

2022-07-13 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch fixes an non-fatal issue about negative constant values derived from FP constant synthesis on hosts whose 'long' is wider than 'int32_t'. And also replaces the dedicated code in FP constant synthesis split pattern with the appropriate existing function call. gcc/ChangeLog: * c

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Andrew Carlotti via Gcc-patches
On Wed, Jul 13, 2022 at 09:10:25AM +0100, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > > wrote: > >> > >> aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a > >> function call is null before converting

[Ada] Use actual types instead of formal types consistently in debug info

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
This makes sure that the objects present in instantiations always have the actual type instead of a local variant of the formal type in the debugging information generated by the compiler (this was already the case when the actual type is a record, a protected or a task type). Tested on x86_64-pc-

[Ada] Fix internal error on instance of Ada.Task_Attributes at -O

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
This happens when there is a size mismatch, but this must be accepted. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/utils.cc (unchecked_convert): Also pad in most cases if the source is not a scalar type but the destination is.diff --git a/gcc/ada/gc

[Ada] Handle bodies-to-inline just like generic templates

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
Originally bodies-to-inline created for the frontend inlining were analyzed with expansion disabled. Then, to facilitate inlining in GNATprove mode, the analysis was changed to preanalysis. However, preanalysis in this context works badly for calls in prefix notation, because preanalysis assigns e

[Ada] Extend No_Dependence restriction to code generation

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
This reports violations for 4 units from gigi. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/trans.cc (gigi): Report a violation of No_Dependence on System.Stack_Checking if Stack_Check_Probes_On_Target is not set and -fstack-check is specifie

[Ada] Fix internal error on comparison with access function parameter

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
It comes from an overzealous assertion. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/utils2.cc (build_binary_op) : Also accept pointer-to-function types that are not variant of each other.diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-int

[Ada] Fix wrong access check with access-to-unconstrained-array

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
The current implementation may create dangling references from a superset of the alias set of the dummy pointer-to-array type when it exists. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : Save and restore the alias set o

[Ada] Generate debug info entry for user-defined access subtype

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
This is consistent with the other kinds of subtypes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : Do not reuse the TYPE_DECL of the base type.diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc --

[Ada] Revert recent change in debug info for vector array types

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
It lost too much useful information. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Do not set the debug type for vector types.diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc --- a/gcc/ada/gcc-in

[Ada] Fix for visibility of aspect expressions inside generic units

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
When a generic unit contains references to global entities (i.e. entities declared outside of this generic unit), those references are saved: from the analyzed copy of a generic unit (which is then discarded) into a generic template (which is then instantiated, possibly many times). To save those r

[Ada] Fix incorrect handling of Ghost aspect

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
When a formal generic type is marked as Ghost, the instantiation of that generic will contain a generic subtype for the actual with the Ghost pragma. Recognize this case. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Analyze_Pragma): Recognize a generated sub

[Ada] Add support for defaulted Storage_Model_Type aspect and subaspects

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler currently rejects a Storage_Model_Type aspect that is not specified with an aggregate, or that has an aggregate that does not specify all defined "subaspects" (Address_Type, Null_Address, Allocate, etc.). The RFC for this feature defines the aspect to fully default to the native memory

[Ada] Do not generate DW_TAG_typedef for constrained array types

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
It no longer serves any useful purpose at this point. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/utils.cc (gnat_pushdecl): Build DECL_ORIGINAL_TYPE only for pointer types.diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc

[Ada] Plug legality loophole for equality operator of untagged record types

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
In Ada 2012, the RM 4.5.2(9.8) clause prevents an equality operator for an untagged record type from being declared after the type is frozen. While the clause is implemented in GNAT, the implementation has a loophole which lets subprogram bodies that are not the completion of a declaration pass th

[Ada] Fix crash on frontend inlining of functions with single returns

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
When examining expression of the first declaration of the inlined body make sure that this declaration is in fact an object declaration. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * inline.adb (Has_Single_Return): Add guard for the subsequent call to Expression.di

[Ada] Clarify hardening command-line options that require explicit choices

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
Prefixes -fzero-call-used-regs and -fstrub could be mistaken for full command-line options with the references to them in the GNAT RM. Make it clearer that they require explicit choices. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/security_hardening_features

[Ada] Fix internal error on untagged record type with equality operator

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
After the binding interpretation issued under AI12-0413, a user-defined primitive equality operator of an untagged record type hides the predefined equality operator in an instantiation, but this does not apply if the instantiation appears in the same declarative region as the type and before the d

[Ada] Fix if expression returning slice

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler incorrectly assumed the prefix for a slice returned in one branch of an if expression has its bounds known at compile time and would crash when this is not true. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_If_Expression): Test for compi

[Ada] Fix proof of runtime unit System.Arith_64

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
After changes in provers and Why3, changes are needed to recover automatic proof of System.Arith_64. This is the first part of it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-aridou.adb (Lemma_Mult_Div, Lemma_Powers): New lemmas. (Prove_Sign_Quo

[Ada] Fix CodePeer warnings in GNAT sources

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes various redundant constructs or uninitialized variables identified by CodePeer in the GNAT frontend and runtime sources. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch6.adb (Expand_N_Extended_Return_Statement): Add default initialization for

[Ada] Refine type for checking number of pragma arguments

2022-07-13 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-prag.adb (Check_Arg_Count): Change parameter type from Int to Nat, because this parameter is compared to Arg_Count variable which is of type Nat. Also, it wouldn't make sense to check for

Re: PING^2: [PATCH] Add --enable-first-stage-cross configure option

2022-07-13 Thread Serge Belyshev via Gcc-patches
Jeff Law via Gcc-patches writes: > I'm not really sure we need a patch for this.  Isn't it sufficient to > "make all-gcc && make all-target-libgcc"?  Folks have been doing that > for decades. > > Jeff Oh, I did not know that "make install-gcc install-target-libgcc" works in this case. So in th

[PATCH 7/12 V2] arm: Emit build attributes for PACBTI target feature

2022-07-13 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 28/04/2022 10:45, Andrea Corallo via Gcc-patches wrote: >> This patch emits assembler directives for PACBTI build attributes as >> defined by the >> ABI. >> >> gcc/ChangeLog: >> * co

[PING^2] nvptx: Allow '--with-arch' to override the default '-misa' (was: nvptx multilib setup)

2022-07-13 Thread Thomas Schwinge
Hi Tom! Ping. Grüße Thomas On 2022-07-05T16:59:23+0200, I wrote: > Hi Tom! > > Ping. > > > Grüße > Thomas > > > On 2022-06-15T23:18:10+0200, I wrote: >> Hi Tom! >> >> On 2022-05-13T16:20:14+0200, I wrote: >>> On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc wrote: On 2/4/22 08:21, Tho

[PING^3] nvptx: forward '-v' command-line option to assembler, linker

2022-07-13 Thread Thomas Schwinge
Hi Tom! Ping. Grüße Thomas On 2022-07-05T16:58:54+0200, I wrote: > Hi Tom! > > Ping. > > > Grüße > Thomas > > > On 2022-06-07T17:41:16+0200, I wrote: >> Hi! >> >> On 2022-05-30T09:06:21+0200, Tobias Burnus wrote: >>> On 29.05.22 22:49, Thomas Schwinge wrote: Not sure if that's what you

Re: [PATCH v2 2/2] aarch64: Lower vcombine to GIMPLE

2022-07-13 Thread Richard Sandiford via Gcc-patches
Andrew Carlotti writes: > This lowers vcombine intrinsics to a GIMPLE vector constructor, which enables > better optimisation during GIMPLE passes. > > gcc/ > > * config/aarch64/aarch64-builtins.c > (aarch64_general_gimple_fold_builtin): Add combine. > > gcc/testsuite/ > > * gcc.

[PATCH] lto-plugin: use -pthread only for detected targets

2022-07-13 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin Use -pthread only if we are going to use pthread functionality. PR bootstrap/106156 lto-plugin/ChangeLog: * configure: Regenerate. * configure.ac: Use -pthread o

[PATCH] arm: Replace arm_builtin_vectorized_function [PR106253]

2022-07-13 Thread Richard Sandiford via Gcc-patches
This patch extends the fix for PR106253 to AArch32. As with AArch64, we were using ACLE intrinsics to vectorise scalar built-ins, even though the two sometimes have different ECF_* flags. (That in turn is because the ACLE intrinsics should follow the instruction semantics as closely as possible,

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > wrote: >> >> aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a >> function call is null before converting it to an assign statement. To avoid >> returning an invalid GIMPLE statement i

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-13 Thread Rui Ueyama via Gcc-patches
On Tue, Jul 12, 2022 at 9:31 PM Martin Liška wrote: > > On 7/12/22 13:50, Rui Ueyama wrote: > > I'm fine, though I don't think I have a right to sign off. > > I've just pushed that. > > @Rui: Can you please merge the mold counter-part? I merged the mold counter-part as https://github.com/rui314/m

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti wrote: > > aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a > function call is null before converting it to an assign statement. To avoid > returning an invalid GIMPLE statement in this case, we instead assign the > expression r

[PATCH] tree-optimization/106249 - unroll-and-jam and LC SSA upate

2022-07-13 Thread Richard Biener via Gcc-patches
When I delayed the LC SSA update in unroll-and-jam this exposed an issue that tree_transform_and_unroll_loop does a full function LC SSA verification when new_loop is NULL (when it doesn't need to do versioning). That wasn't intended. I also took the chance to make the versioning in tree_transfor

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 6:47 AM Hongtao Liu wrote: > > On Tue, Jul 12, 2022 at 10:12 PM Richard Biener > wrote: > > > > On Tue, Jul 12, 2022 at 6:11 AM Hongtao Liu wrote: > > > > > > On Mon, Jul 11, 2022 at 7:47 PM Richard Biener via Gcc-patches > > > wrote: > > > > > > > > On Mon, Jul 11, 2022

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-13 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 10:10 PM Alexander Monakov wrote: > > > Apologies for the prolonged silence Richard, it is a bit of an obscure topic, > and I was unsure I'd be able to handle any complications in a timely manner. > I'm ready to revisit it now, please see below. > > On Mon, 17 Jan 2022, Ric