[PATCH] rs6000: Handle unresolved overloaded builtin [PR105485]

2022-05-12 Thread Kewen.Lin via Gcc-patches
Hi, PR105485 exposes that new builtin function framework doesn't handle unresolved overloaded builtin function well. With new builtin function support, we don't have builtin info for any overloaded rs6000_gen_builtins enum, since they are expected to be resolved to one specific instance. So

Re: [PATCH] [Middle-end] Enhance final_value_replacement_loop to handle bitwise induction.

2022-05-12 Thread Hongtao Liu via Gcc-patches
On Wed, May 11, 2022 at 4:45 PM Richard Biener via Gcc-patches wrote: > > On Mon, May 9, 2022 at 7:19 AM liuhongt wrote: > > > > This patch will enable below optimization: > > > > { > > - int bit; > > - long long unsigned int _1; > > - long long unsigned int _2; > > - > > [local count:

Re: [PATCH V2] powerpc: properly check for feenableexcept() on FreeBSD

2022-05-12 Thread Kewen.Lin via Gcc-patches
on 2022/5/13 04:16, Segher Boessenkool wrote: > Hi Piotr, > > On Tue, May 03, 2022 at 12:21:12PM +0200, pku...@freebsd.org wrote: >> FreeBSD/powerpc* has feenableexcept() defined in fenv.h header. > > Declared, not defined. These are required to be real functions (on all > platforms that have

Re: [PATCH v4, rs6000] Add a combine pattern for CA minus one [PR95737]

2022-05-12 Thread Kewen.Lin via Gcc-patches
Hi Haochen, on 2022/5/13 09:07, HAO CHEN GUI wrote: > Hi, >This patch adds a combine pattern for "CA minus one". As CA only has two > values (0 or 1), we could convert following pattern > (sign_extend:DI (plus:SI (reg:SI 98 ca) > (const_int -1 [0x] >

[PATCH] testsuite: opt: Fix const7.C for RISC-V.

2022-05-12 Thread jiawei
Similar to patch 593993, RISC-V needs to limit symbols send in sdata. Thanks for Palmer's help. gcc/testsuite/ChangeLog: * g++.dg/opt/const7.C: Don't use small data on RISC-V. --- gcc/testsuite/g++.dg/opt/const7.C | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v4, rs6000] Add a combine pattern for CA minus one [PR95737]

2022-05-12 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch adds a combine pattern for "CA minus one". As CA only has two values (0 or 1), we could convert following pattern (sign_extend:DI (plus:SI (reg:SI 98 ca) (const_int -1 [0x] to (plus:DI (reg:DI 98 ca) (const_int -1

Re: [PATCH v3 1/2] rs6000: Move g++.dg powerpc PR tests to g++.target

2022-05-12 Thread Iain Sandoe via Gcc-patches
Hi > On 12 May 2022, at 23:38, Segher Boessenkool > wrote: > On Mon, Apr 18, 2022 at 12:15:34PM -0500, Paul A. Clarke wrote: >> -/* { dg-skip-if "" { powerpc*-*-darwin* } } */ >> +/* Never tested on darwin, so skip there. */ >> +/* { dg-skip-if "" { *-*-darwin* } } */ > > That is probably

Re: [PATCH v3 1/2] rs6000: Move g++.dg powerpc PR tests to g++.target

2022-05-12 Thread Segher Boessenkool
Hi! On Mon, Apr 18, 2022 at 12:15:34PM -0500, Paul A. Clarke wrote: > -/* { dg-skip-if "" { powerpc*-*-darwin* } } */ > +/* Never tested on darwin, so skip there. */ > +/* { dg-skip-if "" { *-*-darwin* } } */ That is probably the reason for the skip, but it is a lousy reason, and not a good

Re: [PATCH v2] RISC-V: Implement C[LT]Z_DEFINED_VALUE_AT_ZERO

2022-05-12 Thread Palmer Dabbelt
On Thu, 12 May 2022 11:33:34 PDT (-0700), philipp.toms...@vrull.eu wrote: The Zbb support has introduced ctz and clz to the backend, but some transformations in GCC need to know what the value of c[lt]z at zero is. This affects how the optab is generated and may suppress use of CLZ/CTZ in tree

Re: [PATCH v3 2/2] rs6000: Remove a few needless 'lp64' contraints.

2022-05-12 Thread Segher Boessenkool
Hi! On Mon, Apr 18, 2022 at 12:15:35PM -0500, Paul A. Clarke wrote: > A few tests need not be restricted to 'lp64', so remove the restriction. > > A few of those need a simple change to the DejaGnu directives to suppress > '-mcmodel' flags for '-m32'. Okay for trunk. Thanks! Segher

Re: [PING PATCH v3 0/2] rs6000: Move g++.dg powerpc tests to g++.target

2022-05-12 Thread Paul A. Clarke via Gcc-patches
ping On Mon, Apr 18, 2022 at 12:15:33PM -0500, Paul A. Clarke via Gcc-patches wrote: > v3: moved "not tested on Darwin" changes into 1/2, where they belong. > > v2: > - v1 patches 1/3 and 2/3 have been merged after reviews / approval. > - Previous 3/3 is now 1/2, and new 2/2 is per review from

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-12 Thread Ian Lance Taylor via Gcc-patches
On Thu, May 12, 2022 at 11:23 AM Sören Tempel via Gcc-patches wrote: > > The off64_t type is used for defining Offset_t: > > > https://github.com/golang/gofrontend/blob/4bdff733a0c2a9ddc3eff104b1be03df058a79c4/libgo/mksysinfo.sh#L406-L410 > > On musl, _HAVE_OFF64_T is defined since

Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
On Thu, 12 May 2022, Jason Merrill wrote: > On 5/12/22 14:14, Patrick Palka wrote: > > On Thu, 12 May 2022, Patrick Palka wrote: > > > > > After r13-332-g88459c3965e2a2, it looks like we can safely remove the > > > NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which simplifies its > > >

[PATCH] gdc 9, 10 and 11 bug fix

2022-05-12 Thread Marc Aurèle La France
Greetings. No compiler has any business rejecting files for the sole crime of being symlinked to. The following applies, modulo patch fuzz, to the 9, 10 and 11 series of compilers. Given my use of shadow trees, this bug attempted to prevent me from building 12.1.0. The D-based gdc in 12.1.0

Re: [PATCH V2] powerpc: properly check for feenableexcept() on FreeBSD

2022-05-12 Thread Segher Boessenkool
Hi Piotr, On Tue, May 03, 2022 at 12:21:12PM +0200, pku...@freebsd.org wrote: > FreeBSD/powerpc* has feenableexcept() defined in fenv.h header. Declared, not defined. These are required to be real functions (on all platforms that have these functions), not macros or inlines or whatever. So

Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Jason Merrill via Gcc-patches
On 5/12/22 14:14, Patrick Palka wrote: On Thu, 12 May 2022, Patrick Palka wrote: After r13-332-g88459c3965e2a2, it looks like we can safely remove the NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which simplifies its semantics. And TMPL_ARGS_LEVEL should verify the level argument is sane in

[PATCH v2] RISC-V: Implement C[LT]Z_DEFINED_VALUE_AT_ZERO

2022-05-12 Thread Philipp Tomsich
The Zbb support has introduced ctz and clz to the backend, but some transformations in GCC need to know what the value of c[lt]z at zero is. This affects how the optab is generated and may suppress use of CLZ/CTZ in tree passes. Among other things, this is needed for the transformation of

[committed] libstdc++: Remove whitespace before preprocessor directives

2022-05-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- These are harmless, but also unnecessary and inconsistent (and their removal was requested by PR libstdc++/17632). libstdc++-v3/ChangeLog: * config/locale/dragonfly/numeric_members.cc: Remove whitespace. *

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-12 Thread Sören Tempel via Gcc-patches
Hi Ian, Thanks for following up on this, comments below. Ian Lance Taylor wrote: > I see uses of loff_t but I don't see any uses of off64_t. The off64_t type is used for defining Offset_t:

Re: [PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
On Thu, 12 May 2022, Patrick Palka wrote: > After r13-332-g88459c3965e2a2, it looks like we can safely remove the > NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which simplifies its > semantics. > > And TMPL_ARGS_LEVEL should verify the level argument is sane in the > one-dimensional vector

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-12 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Hi Richard, > >> But even if the costs are too high, the patch seems to be overcompensating. >> It doesn't make logical sense for an ADRP+LDR to be cheaper than an LDR. > > An LDR is not a replacement for ADRP+LDR, you need a store in addition the > original ADRP+LDR.

Re: [PATCH] x86: Document -mno-cet-switch

2022-05-12 Thread H.J. Lu via Gcc-patches
On Thu, May 12, 2022 at 12:15 AM Richard Biener wrote: > > On Wed, May 11, 2022 at 9:03 PM Florian Weimer via Gcc-patches > wrote: > > > > * H. J. Lu: > > > > > On Wed, May 11, 2022 at 11:45 AM Florian Weimer > > > wrote: > > >> > > >> * H. J. Lu: > > >> > > >> >> NOTRACK avoids the need for

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-12 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, > But even if the costs are too high, the patch seems to be overcompensating. > It doesn't make logical sense for an ADRP+LDR to be cheaper than an LDR. An LDR is not a replacement for ADRP+LDR, you need a store in addition the original ADRP+LDR. Basically a simple spill would be

Re: [PATCH] PR tree-optimization/83907: Improved memset handling in strlen pass.

2022-05-12 Thread Jeff Law via Gcc-patches
On 2/20/2022 9:51 AM, Roger Sayle wrote: This patch implements the missed optimization enhancement PR 83907, by handling memset with a constant byte value in tree-ssa's strlen optimization pass. Effectively, this treats memset(dst,'x',3) as it would memcpy(dst,"xxx",3). This patch also

Re: [PATCH] [12/11/10] Fix invalid format warnings on Windows

2022-05-12 Thread Martin Storsjö
On Wed, 11 May 2022, Joseph Myers wrote: I'd also like to check that "if mingw-w64 is configured to target UCRT" is not something that is necessarily known when GCC is built or from the command-line options passed to GCC. Because ideally one might expect the TARGET_OVERRIDES_FORMAT_ATTRIBUTES

Re: [PATCH] AArch64: Cleanup CPU option processing code

2022-05-12 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Hi Richard, > >> Looks like you might have attached the old patch. The aarch64_option_restore >> change is mentioned in the changelog but doesn't appear in the patch itself. > > Indeed, not sure how that happened. Here is the correct v2 anyway. > > Wilco > > > The

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-12 Thread Wilco Dijkstra via Gcc-patches
Hi, >> It's also said that chosen alternatives might be the reason that >> rematerialization >> is not choosen and alternatives are chosen based on reload heuristics, not >> based >> on actual costs. > > Thanks for the pointer.  Yeah, it'd be interesting to know if this > is the same issue,

Re: [PATCH] AArch64: Cleanup CPU option processing code

2022-05-12 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, > Looks like you might have attached the old patch.  The aarch64_option_restore > change is mentioned in the changelog but doesn't appear in the patch itself. Indeed, not sure how that happened. Here is the correct v2 anyway. Wilco The --with-cpu/--with-arch configure option

Re: c++: Support module language-decl semantics

2022-05-12 Thread Jonathan Wakely via Gcc-patches
On Thu, 12 May 2022 at 12:18, Nathan Sidwell wrote: > > In modules purview, one can attach a declaration to the global module > (i.e. not the named module in whence the declaration appears), using a > language declaration: > >export module Foo; >extern "C++" void *operator new

[PATCH] c++: improve a couple of TMPL_ARGS_* accessor macros

2022-05-12 Thread Patrick Palka via Gcc-patches
After r13-332-g88459c3965e2a2, it looks like we can safely remove the NULL test from TMPL_ARGS_HAVE_MULTIPLE_LEVELS, which simplifies its semantics. And TMPL_ARGS_LEVEL should verify the level argument is sane in the one-dimensional vector case. This change uncovered a couple of latent bugs: in

Re: [PATCH] testsuite: Make AArch64 attributes_7.c generate unique report lines.

2022-05-12 Thread Richard Sandiford via Gcc-patches
Christophe Lyon via Gcc-patches writes: > This test is executed in both C and C++ modes, lines 98 and 100 pass > in C++ and are xfail in C. > > This results in similar lines in gcc.sum and g++.sum, differing by the > PASS or XFAIL prefix, which confuses compare_test: it reports these > tests

Re: Refactor '-ldl' handling for libgomp proper and plugins

2022-05-12 Thread Jakub Jelinek via Gcc-patches
On Thu, May 12, 2022 at 02:39:14PM +0200, Thomas Schwinge wrote: > Hi! > > Again, no change in behavior, just refactoring, making things more > explicit, in preparation for other changes. OK to push the attached > "Refactor '-ldl' handling for libgomp proper and plugins"? > > By the way, this

[Ada] Skip postponed validation checks with compilation errors

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
If there are compilation errors then gigi doesn't backannotate the AST with sizes, alignment, etc. The postponed compilation validation checks can then easily crash or give spurious errors. We now just skip them. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gnat1drv.adb

[Ada] Restore double quotes in debug printouts

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
A previous change in "Make debug printouts more robust" accidentally removed double quotes around identifiers in debug printouts. This patch restores those. So for example, we have: Prev_Entity = Node #10 N_Defining_Identifier "foo" (Entity_Id=795) and not: Prev_Entity = Node #10

[Ada] Reuse collective subtype for comparison operators where possible

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Replace membership alternatives with N_Op_Compare. Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_res.adb (Resolve_Actuals): Simplify with N_Op_Compare. * sem_util.adb (Replace_Null_Operand,

[Ada] Remove unreferenced Is_Selector_Name routine

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Function Is_Selector_Name was added in 1995 while experimenting with default expressions in record declarations. This experiment was abandoned after one day and this routine was never used since then. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.ads

[Ada] Add more dummy names in Sem_Warn.Has_Junk_Name

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
To sync the names used in CodePeer (and SPARK) when filtering out warnings on e.g. unused variables. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_warn.adb (Has_Junk_Name): Add more dummy names.diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb ---

[Ada] Fix warning about generic subprograms withed but not referenced

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
For warnings about unreferenced entities and unused WITH clauses we typically exclude references outside of the extended main source unit. However, we include references to variables of formal private types to warn in the instance if the corresponding type is not a fully initialized type. This

[Ada] Fix warning about generic subprograms withed but not instantiated

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler should warn when a generic subprogram unit is withed but not instantiated by the current main unit. This warning relies on flag Is_Instantiated, which was wrongly set when the generic unit was also withed and instantiated by some other unit. This change merely reverts a fix done 20

[Ada] Remove useless pragma Warnings Off from runtime units

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
GNAT does not issue a warning anymore on a postcondition of True (used here to prevent inining inside GNATprove for proof). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-valuei.ads: Remove pragma Warnings Off. * libgnat/s-valueu.ads: Same. *

[Ada] Do not issue a warning on a postcondition of True or False

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Do not issue a warning about the postcondition of a function not mentioning its result when this postcondition is statically True or False, as this is a specification of non-termination (for value False) or a hint to SPARK prover for not inlining an expression function (for value True). In any

[Ada] Make debug printouts more robust

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch improves some debug printouts so that they avoid crashing on invalid data. In addition, the relevant code uses Global_Name_Buffer all over the place. This patch cleans up some of those uses, in particular ones in the same code as the robustness changes, and code called by that code.

[Ada] Remove front-end SJLJ processing

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
We no longer use the so called front-end SJLJ exception mechanism, so get rid of it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * ali.adb, ali.ads, bcheck.adb, exp_ch11.adb, fe.h, gnat1drv.adb, opt.adb, opt.ads, targparm.adb, targparm.ads, lib-writ.adb:

[Ada] Add ghost code to facilitate proof with SPARK

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Proof of generic units for Long_Long_Long_Unsigned instantiations is harder for provers, as they have to deal with larger values. Add ghost code to make the proof easier. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-imageu.adb (Set_Image_Unsigned): Add lemma.

[Ada] Remove use of use-clauses in loaded runtime units

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
The spec of runtime units that may be loaded by the compiler should not contain use-clauses, for visibility to be correctly handled. Remove use-clauses that were introduced for the ghost big integers unit as part of the proof of runtime units. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Fix support for ISO-8859-15 and IBM CP 850 encoding

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
In ISO-8859-15, code for "lower y with diaeresis" is used for the upper case. In IBM CP 850, upper and lower o with stroke were missing. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * csets.adb (Fold_Latin_9): Fix y with diaeresis. (Fold_IBM_PC_850): Fix o with

[Ada] Remove redundant guard against Any_String

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
A sequence of checks for a valid Boolean argument fails when applied to Any_String because its component is not of a Boolean type. The explicit guard was unnecessary; it was only needed when a First_Index applied to Any_String would crash, but this was fixed soon after this guard was added.

[Ada] Accept raise expressions as operands of boolean operators

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch restores the previous behaviour of a recently rewritten routine Sem_Ch4.Find_Boolean_Types for boolean operators where one of the operands is a raise-expression, e.g.: (raise Program_Error or else (X /= Y)) This change is required for the Entity field of the "or else" operator to be

[Ada] Revamp analysis of conditional expressions

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
The current implementation is skewed toward the first dependent expression and does not look into the interpretations of the others if the first one is not overloaded, which can create spurious ambiguities. And more precise error messages are now given if the types of the dependent expressions are

[Ada] Plug loophole in Possible_Type_For_Conditional_Expression

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
We need to check that the designated subprograms of access-to-subprogram types are subtype conformant before registering a common interpretation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Possible_Type_For_Conditional_Expression): Add test for

[Ada] Adapt CodePeer analysis of GNAT to changes in dependencies

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
New dependencies in s-imagei are causing issues for CodePeer analysis of GNAT source and libs. Updating the setup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-imagef.adb: Justify false message from CodePeer.diff --git a/gcc/ada/libgnat/s-imagef.adb

[Ada] Proof of 'Image support for signed integers

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Prove System.Image_I, similarly to the proof done for System.Image_U. The contracts make the connection between the result of Image_Integer, the available space computed with System.Width_U and the result of 'Value as computed by Value_Integer. I/O units that now depend on non-pure units are also

[Ada] Introduce hardbool Machine_Attribute for Ada

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Implement and document hardened booleans, from nonstandard boolean types with representation clauses to the extra validity checking performed on boolean types annotated with the "hardbool" Machine_Attribute pragma. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Rewrite Sem_Ch4.Find_Boolean_Types

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Using a straight implementation like the one in Find_Arithmetic_Types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb (Find_Arithmetic_Types): Use local variables. (Find_Boolean_Types): Rewrite modeled on Find_Arithmetic_Types.diff --git

[Ada] Fix style checking rule for square brackets in Ada 2022 and above

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
The square bracket syntax introduced in Ada 2022 was incorrectly handled by the style checker and incorrect spacing was enforced. The issue was in part caused by the wide character syntax (support removed starting from Ada 2022) that treats the square bracket as a valid identifier character.

[Ada] Fix scope of block in expanded protected entry body

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
We expand protected entry body into procedure with a nested block. The scope of this block is naturally the enclosing procedure. However, the scope field was wrongly set to the entity of the enclosing procedure body (i.e. E_Subprogram_Body); now it is set to the entity of the enclosing procedure

[Ada] Fix typos in syntax for implementation-defined pragmas

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Documentation cleanup. Spotted while looking at description of configuration pragmas. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: (Export_Object, Import_Object, Short_Descriptors): Fix pragma syntax

[Ada] Reuse generic string hash for invocation signatures

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Use a generic string hash routine for hashing of invocation signatures. The System.String_Hash unit was added to GNAT in 2009 and shouldn't cause any bootstrap problems these days. To be safe, we don't use the GNAT.String_Hash renaming, which was added later. Cleanup related to a new restriction

[Ada] Document Aggregate_Individually_Assign as a configuration pragma

2022-05-12 Thread Pierre-Marie de Rodat via Gcc-patches
Pragma Aggregate_Individually_Assign was apparently forgotten to be listed in the GNAT User's Guide as a configuration pragma. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration Pragmas): Add

[PATCH] rtl-optimization/105577 - RTL DSE and non-call EH

2022-05-12 Thread Richard Biener via Gcc-patches
When one of the first two stages of DSE removes a throwing stmt we have to purge dead EH edges before the DF re-analyze fires off a fast DCE since that cannot cope with the situation. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. I'll add a testcase when it has finished reducing

Refactor '-ldl' handling for libgomp proper and plugins

2022-05-12 Thread Thomas Schwinge
Hi! Again, no change in behavior, just refactoring, making things more explicit, in preparation for other changes. OK to push the attached "Refactor '-ldl' handling for libgomp proper and plugins"? By the way, this might also qualify as a first preparational step to support dynamic loading

Re: libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'

2022-05-12 Thread Tom de Vries via Gcc-patches
On 4/28/22 15:45, Thomas Schwinge wrote: Hi Tom! On 2022-04-08T09:35:44+0200, Tom de Vries wrote: On 4/8/22 00:27, Thomas Schwinge wrote: On 2017-01-13T19:11:23+0100, Jakub Jelinek wrote: Especially for distributions it is undesirable to need to have proprietary CUDA libraries and headers

[PING^2] libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'

2022-05-12 Thread Thomas Schwinge
Hi! Another ping -- Jakub maybe? This is a simple refactor; no change in behavior. I'll soon post further patches depending on this. Grüße Thomas On 2022-05-05T21:18:47+0200, I wrote: > Hi! > > Ping. > > > Grüße > Thomas > > > On 2022-04-28T15:45:20+0200, I wrote: >> Hi Tom! >> >> On

libgomp plugins: Don't 'AC_SUBST' and 'AC_DEFINE_UNQUOTED' for 'PLUGIN_GCN', 'PLUGIN_NVPTX' (was: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin)

2022-05-12 Thread Thomas Schwinge
Hi! On 2014-09-23T19:19:31+0100, Julian Brown wrote: > This patch contains the bulk of the OpenACC 2.0 runtime support, > building around, or on top of, the OpenMP 4.0 support (as previously > posted or already extant upstream) where we could. [...] > --- a/libgomp/Makefile.am > +++

[PATCH] tree-optimization/105562 - avoid uninit diagnostic with better FRE

2022-05-12 Thread Richard Biener via Gcc-patches
We can avoid some uninit diagnostics by making FRE disambiguate against CLOBBERs since any aliasing there would invoke undefined behavior for a read we are looking up. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed 2022-05-12 Richard Biener PR tree-optimization/105562

Re: [PATCH v2] Strip of a vector load which is only used partially.

2022-05-12 Thread Richard Biener via Gcc-patches
On Thu, May 12, 2022 at 3:48 AM Hongtao Liu wrote: > > On Tue, May 10, 2022 at 2:54 PM Richard Biener via Gcc-patches > wrote: > > > > On Mon, May 9, 2022 at 7:11 AM liuhongt via Gcc-patches > > wrote: > > > > > > Here's adjused patch. > > > Ok for trunk? > > > > > > Optimize > > > > > > _4 =

c++: Support module language-decl semantics

2022-05-12 Thread Nathan Sidwell
In modules purview, one can attach a declaration to the global module (i.e. not the named module in whence the declaration appears), using a language declaration: export module Foo; extern "C++" void *operator new (std::size_t); This implements those semantics. Jonathan, I guess this might

Re: [1/2] PR96463 - aarch64 specific changes

2022-05-12 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Wed, 11 May 2022 at 12:44, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> > On Fri, 6 May 2022 at 16:00, Richard Sandiford >> > wrote: >> >> >> >> Prathamesh Kulkarni writes: >> >> > diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-12 Thread Mikael Morin
Le 11/05/2022 à 10:17, Martin Liška a écrit : On 5/9/22 14:03, Richard Biener wrote: On Thu, May 5, 2022 at 4:30 PM Martin Liška wrote: On 5/5/22 14:58, Iain Buclaw wrote: This D front-end change doesn't look right to me, besides the slight Hello. Sorry, I've re-read the patch and fixed

[OG11-committed] Fortran: Fix proc pointer as elemental arg handling (was: Fortran: Fix finalization resolution with deep copy (was: [Patch][Stage 1] Fortran/OpenMP: Support mapping of DT with allocat

2022-05-12 Thread Tobias Burnus
Found another issue related to polymorphic deep copy (see description in the commit log). I plan to start submitting the deep-mapping patches in separate pieces to mainline later during Stage 1. Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,

RE: [PATCH] [i386]Add combine splitter to transform pxor/pcmpeqb/pmovmskb/cmp 0xffff to ptest.

2022-05-12 Thread Jiang, Haochen via Gcc-patches
> -Original Message- > From: Uros Bizjak > Sent: Thursday, May 12, 2022 5:12 PM > To: Jiang, Haochen > Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao ; Hongyu > Wang > Subject: Re: [PATCH] [i386]Add combine splitter to transform > pxor/pcmpeqb/pmovmskb/cmp 0x to ptest. > > On Thu, May

Re: [1/2] PR96463 - aarch64 specific changes

2022-05-12 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 11 May 2022 at 12:44, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 6 May 2022 at 16:00, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc > >> >

Re: [PATCH] [i386]Add combine splitter to transform pxor/pcmpeqb/pmovmskb/cmp 0xffff to ptest.

2022-05-12 Thread Uros Bizjak via Gcc-patches
On Thu, May 12, 2022 at 5:01 AM Jiang, Haochen wrote: > > Hi all, > > I just refined this patch with more explanation in commit message. The ChangeLog entry should in fact read as: PR target/104371 * config/i386/sse.md (vi1avx2const): New define_mode_attr. (pxor/pcmpeqb/pmovmskb/cmp

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-12 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, May 11, 2022 at 2:23 PM Richard Sandiford via Gcc-patches > wrote: >> >> Wilco Dijkstra writes: >> > Hi Richard, >> > >> >> Yeah, I'm not disagreeing with any of that. It's just a question of >> >> whether the problem should be fixed by artificially lowering

Re: [PATCH] AArch64: Cleanup CPU option processing code

2022-05-12 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra via Gcc-patches writes: > Hi Richard, > >> Although invoking ./cc1 directly only half-works with --with-arch, >> it half-works well-enough that I'd still like to keep it working. >> But I agree we should apply your change first, then I can follow up >> with a patch to make --with-*

[PATCH] Make gimple_build main workers more flexible

2022-05-12 Thread Richard Biener via Gcc-patches
The following makes the main gimple_build API take a gimple_stmt_iterator, whether to insert before or after and an iterator update argument to make it more convenient to use in certain situations (see the tree-vect-generic.cc hunks for an example). It also makes the case we insert into the IL

Re: [PATCH] [PR105455] Set edge probabilities when hardening conditionals

2022-05-12 Thread Richard Biener via Gcc-patches
On Thu, May 12, 2022 at 3:48 AM Alexandre Oliva via Gcc-patches wrote: > > > When turning unconditional edges into conditional, as in > gimple-harden-conditionals.cc:insert_check_and_trap, the newly-created > edge's probability comes out uninitialized, while the previously > unconditional edge's

Re: [PATCH] Avoid visiting newly-created blocks in harden-conditionals

2022-05-12 Thread Richard Biener via Gcc-patches
On Thu, May 12, 2022 at 3:47 AM Alexandre Oliva via Gcc-patches wrote: > > > Reverse iteration over blocks, in gimple-harden-conditionals.cc, was > supposed to avoid visiting blocks introduced by hardening and > introducing further reversed conditionals and traps for them, but > newly-created

Re: [EXTERNAL] Re: [PATCH] Guard against applying scale with 0 denominator

2022-05-12 Thread Richard Biener via Gcc-patches
On Thu, May 12, 2022 at 3:37 AM Eugene Rozenfeld wrote: > > In my case this is not exactly what the FIXME in the comment above says. The > count is 0 even before > the initial scaling happens. I hit this case with some changes I'm working on > to enable per-instruction discriminators for

Re: [PATCH V2] powerpc: properly check for feenableexcept() on FreeBSD

2022-05-12 Thread Kewen.Lin via Gcc-patches
Hi Piotr, Thanks for doing this, some comments are inlined. on 2022/5/11 07:32, Piotr Kubaj via Gcc-patches wrote: > Is there anything more required? > > On 22-05-03 12:33:43, Piotr Kubaj wrote: >> Here are gmake check-gfortran results requested by FX. >> >> Before patching: >>

Re: [PATCH] x86: Document -mno-cet-switch

2022-05-12 Thread Richard Biener via Gcc-patches
On Wed, May 11, 2022 at 9:03 PM Florian Weimer via Gcc-patches wrote: > > * H. J. Lu: > > > On Wed, May 11, 2022 at 11:45 AM Florian Weimer wrote: > >> > >> * H. J. Lu: > >> > >> >> NOTRACK avoids the need for ENDBR instructions, right? That's a > >> >> hardening improvement, so it should be

RE: [PATCH] PR tree-optimization/83907: Improved memset handling in strlen pass.

2022-05-12 Thread Roger Sayle
Hi Jeff, Any chance you could take a look at this patch, now that we're back in stage1? Thanks in advance, Roger > -Original Message- > From: Jeff Law > Sent: 02 March 2022 19:33 > To: Roger Sayle ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH] PR tree-optimization/83907: Improved

Re: [PATCH] opts: improve option suggestion

2022-05-12 Thread Martin Liška
On 5/11/22 20:49, David Malcolm wrote: > On Wed, 2022-05-11 at 16:49 +0200, Martin Liška wrote: >> In case where we have 2 equally good candidates like >> -ftrivial-auto-var-init= >> -Wtrivial-auto-var-init >> >> for -ftrivial-auto-var-init, we should take the candidate that >> has a difference in

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-12 Thread Richard Biener via Gcc-patches
On Wed, May 11, 2022 at 10:01 PM David Malcolm via Gcc-patches wrote: > > On Wed, 2022-05-11 at 15:04 -0400, Eric Gallager wrote: > > On Wed, May 11, 2022 at 9:53 AM David Malcolm via Gcc-patches > > wrote: > > > > > > On Thu, 2022-05-05 at 14:16 +0200, Martin Liška wrote: > > > > Patch can

Re: [PATCH] opts: improve option suggestion

2022-05-12 Thread Richard Biener via Gcc-patches
On Wed, May 11, 2022 at 8:50 PM David Malcolm via Gcc-patches wrote: > > On Wed, 2022-05-11 at 16:49 +0200, Martin Liška wrote: > > In case where we have 2 equally good candidates like > > -ftrivial-auto-var-init= > > -Wtrivial-auto-var-init > > > > for -ftrivial-auto-var-init, we should take the

Re: [wwwdocs PATCH v2] document zero-width field ABI changes on MIPS

2022-05-12 Thread Gerald Pfeifer
On Wed, 6 Apr 2022, Xi Ruoyao via Gcc-patches wrote: > Document ABI changes in r12-7961, 7962, and 8023. Ok for wwwdocs? Thank you! Note is deprecated, and we generally use id= attributes. I made this change, and also expanded the anchor from just "ABI" which is very generic to more specific

Re: [PATCH] Extend --with-zstd documentation

2022-05-12 Thread Richard Biener via Gcc-patches
On Wed, May 11, 2022 at 5:10 PM Bruno Haible wrote: > > The patch that was so far added for documenting --with-zstd is pretty > minimal: > - it refers to undocumented options --with-zstd-include and > --with-zstd-lib; > - it suggests that --with-zstd can be used without an argument; > -

Re: [PATCH] Add -fcf-check-attribute=[yes|no|none] for Linux kernel

2022-05-12 Thread Richard Biener via Gcc-patches
On Wed, 11 May 2022, H.J. Lu wrote: > On Tue, May 10, 2022 at 11:39 PM Richard Biener wrote: > > > > On Tue, 10 May 2022, H.J. Lu wrote: > > > > > When compiling Linux kernel with -fcf-protection=branch to enable x86 > > > Indiret Branch Tracking (IBT), ENDBR is added to all global functions. >

[committed] openmp: Add omp_all_memory support (C/C++ only so far)

2022-05-12 Thread Jakub Jelinek via Gcc-patches
Hi! The ugly part is that OpenMP 5.1 made omp_all_memory a reserved identifier which isn't allowed to be used anywhere but in the depend clause, this is against how everything else has been handled in OpenMP so far (where some identifiers could have special meaning in some OpenMP clauses or