Re: [PATCH v2] Enable match.pd dumping with -fdump-tree-original

2022-05-09 Thread Richard Biener via Gcc-patches
On Fri, 6 May 2022, Alex Coplan wrote: > This is a respin of: > https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592307.html > that implements Richard's suggestion around the cgraph.cc change. > Otherwise the patch is as before. > > Bootstrapped and regtested on aarch64-linux-gnu, OK for trun

Re: [patch gcc13] middle-end/70090: Dynamic sizes for -fsanitize=object-size

2022-05-09 Thread Siddhesh Poyarekar
On 07/02/2022 17:37, Jakub Jelinek wrote: On Mon, Feb 07, 2022 at 05:31:58PM +0530, Siddhesh Poyarekar wrote: Use __builtin_dynamic_object_size to get object sizes for ubsan. gcc/ChangeLog: middle-end/70090 * ubsan.cc (ubsan_expand_objsize_ifn): Allow non-constant SIZE.

Re: [patch gcc13] middle-end/70090: Dynamic sizes for -fsanitize=object-size

2022-05-09 Thread Jakub Jelinek via Gcc-patches
On Mon, May 09, 2022 at 01:02:07PM +0530, Siddhesh Poyarekar wrote: > On 07/02/2022 17:37, Jakub Jelinek wrote: > > On Mon, Feb 07, 2022 at 05:31:58PM +0530, Siddhesh Poyarekar wrote: > > > Use __builtin_dynamic_object_size to get object sizes for ubsan. > > > > > > gcc/ChangeLog: > > > > > > m

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

2022-05-09 Thread Richard Biener via Gcc-patches
On Fri, May 6, 2022 at 10:32 PM Eugene Rozenfeld via Gcc-patches wrote: > > Calling count.apply_scale with a 0 denominator causes an assert. > This change guards against that. > > Tested on x86_64-pc-linux-gnu. > > gcc/ChangeLog: > * tree-loop-vect-manip.cc (vect_do_peeling): Guard against

Re: [PATCH] Optimize vec_setv8{hi,hf}_0 + pmovzxbq to pmovzxbq.

2022-05-09 Thread Uros Bizjak via Gcc-patches
On Mon, May 9, 2022 at 8:44 AM Hongtao Liu wrote: > > On Mon, May 9, 2022 at 2:43 PM liuhongt via Gcc-patches > wrote: > > > > Clean up of 16-bit uppers is not needed for pmovzxbq/pmovsxbq. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > > Ok for trunk? > > > > gcc/ChangeLog:

Re: [PATCH v2 2/2] [PR100106] Reject unaligned subregs when strict alignment is required

2022-05-09 Thread Richard Sandiford via Gcc-patches
Alexandre Oliva writes: > On May 5, 2022, Segher Boessenkool wrote: > >> On Thu, May 05, 2022 at 08:59:21AM +0100, Richard Sandiford wrote: >>> Alexandre Oliva via Gcc-patches writes: >>> I know this is the best being the enemy of the good, but given >>> that we're at the start of stage 1, woul

Re: [PATCH] [i386] Implement permutation with pslldq + psrldq + por when pshufb is not available.

2022-05-09 Thread Uros Bizjak via Gcc-patches
On Mon, May 9, 2022 at 7:24 AM Hongtao Liu wrote: > > On Mon, May 9, 2022 at 1:22 PM liuhongt via Gcc-patches > wrote: > > > > pand/pandn may be used to clear upper/lower bits of the operands, in > > that case there will be 4-5 instructions for permutation, and it's > > still better than scalar c

Re: [PATCH] [i386] Optimize movzwl + vmovd/vmovq to vmovw.

2022-05-09 Thread Uros Bizjak via Gcc-patches
On Mon, May 9, 2022 at 4:03 AM liuhongt wrote: > > Similarly optimize movl + vmovq to vmovd. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? > > gcc/ChangeLog: > > PR target/104915 > * config/i386/sse.md (*vec_set_0_zero_extendhi): New > pre_re

New French PO file for 'gcc' (version 12.1.0)

2022-05-09 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the French team of translators. The file is available at: https://translationproject.org/latest/gcc/fr.po (This file, 'gcc-12.1.0.fr.po', has jus

Re: [PATCH] Come up with {,UN}LIKELY macros.

2022-05-09 Thread Martin Liška
On 5/6/22 08:19, Richard Biener wrote: > But I would have been fine with LIKELY as well. Ok, so let's go with this version. I'm going to install the patch. Martin

Re: [PATCH] Remove conditional STATIC_ASSERT.

2022-05-09 Thread Martin Liška
On 5/5/22 15:08, Richard Biener wrote: > On Thu, May 5, 2022 at 2:41 PM Martin Liška wrote: >> >> On 5/5/22 14:29, Richard Biener wrote: >>> Can we then use static_assert (...) instead and remove the >>> macro? >> >> Oh yes, we can ;) >> >>> Do we have C compiled code left (I think we might, >>> o

[PATCH] opts: do not allow Separate+Joined ending with =

2022-05-09 Thread Martin Liška
Do not allow strange option format: -msmall-data-limit= 11. For -output-pch we need to use Separate syntax as lang spec rules automatically append a space. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR target/105355 gcc/

[PATCH] limits.h, syslimits.h: do not install to include-fixed

2022-05-09 Thread Martin Liška
Hi. The header files limits.h are syslimits.h are not a product of fix-includes, so let's install it to a proper include location. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: * Makefile.in: Install limits.h

[PATCH] configure: add --disable-fix-includes

2022-05-09 Thread Martin Liška
Right now, fixinclude takes about 11 seconds on my machine, where it reads 130MB of header files. The number of fixed headers is negligible without any significant change. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin fixincludes/Ch

Re: [PATCH] lto-plugin: add support for feature detection

2022-05-09 Thread Martin Liška
CCing mold's author. On 5/6/22 16:46, Alexander Monakov wrote: > > > On Thu, 5 May 2022, Martin Liška wrote: > >> On 5/5/22 12:52, Alexander Monakov wrote: >>> Feels a bit weird to ask, but before entertaining such an API extension, >>> can we step back and understand the v3 variant of get_symb

[Ada] Stabilize exit code on close process

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Call Kill before close input handler in Close routine. Otherwise close input handler can terminate process before Kill and exit code became unpredictable. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-expect.adb (Close): Call Kill before Close_Input.diff --git a

[Ada] Remove doubly-negated tests for empty lists

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Replace "not Is_Non_Empty_List (...)" with "Is_Empty_List (...)". Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch5.adb (Update_Choice_Index): Simplify condition. * sem_ch8.adb (Attribute_Renaming): Likewise.diff --git a/

[Ada] Remove unused parameter from __gnat_kill

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Remove close parameter from __gnat_kill because it is not used in implementation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adaint.c (__gnat_kill): Remove close parameter. (__gnat_killprocesstree): Do not provide close parameter on call to __gnat_kill.

[Ada] Revamp type resolution for comparison and equality operators

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The main goal was to make it symmetrical, but this also moves error handling entirely to the second phase of type resolution. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo.ads (Access Kinds): Reorder and beef up. * sem.adb (Analyze): Call Analyze_Comparison_E

[Ada] Remove redundant call to Set_Etype for attribute Bit_Order

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Node created by a call to New_Occurrence_Of (RTE (...), ...) has its Etype set. There is no need to follow it with a call to Set_Etype. Cleanup of various Analyze/Resolve routines. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Analyze_Attribute): Don't call

[Ada] Remove repeated analysis of attribute prefixes

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
At the beginning of Analyze_Attribute routine we analyze the attribute prefix. There is no need to repeat this analysis in branches for individual attributes. Code cleanup related to various Analyze/Resolve routines. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.

[Ada] vx21.07: stack-checking on ppc

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
On VxWorks >= 7.2 and 653, signal processing code is expected to clear the TCB exception count field when returning control back to user code. This change arranges to do so. It is believed that this is only an issue in Kernel mode, and not RTP because there is no exception count field in RTP mode

[Ada] Add utility to preanalyze assert expression without forcing its type

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
In SPARK loop and subprogram variants we now allow expressions of any discrete type or of Ada.Numerics.Big_Numbers.Big_Integers.Big_Integer type. This requires a variant of Preanalyze_Assert_Expression that doesn't force the expression to be of a particular type, similar to the existing variant of

[Ada] Allow Big_Integer in loop and subprogram variants

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
In SPARK loop and subprogram variants we now allow expressions of any discrete type and of Ada.Numerics.Big_Numbers.Big_Integers.Big_Integer type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_prag.adb (Expand_Pragma_Loop_Variant, Expand_Pragma_Subprogram_Varia

[Ada] Use "aspect" instead of "pragma" in warnings

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
For warnings related to the Unreferenced, Unmodified, and Unused aspects, refer to the "aspect", not the "pragma". Note that the aspect can be set by an aspect_specification or a pragma, so the term "aspect" is correct even in the pragma case. However, messages in sem_prag.adb use Fix_Error, so th

[Ada] Refine description of SPARK with static Boolean expressions

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
A number of SPARK pragmas controlled by an optional Boolean expression require those expressions to be static. This is now clarified in the GNAT RM. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Abstract_State, Async_

[Ada] Fix check for looking for user defined literals

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Recall that Has_Possible_Literal_Aspects only comes in if a given node does not have any visible interpretation. If one operand is a literal we assume that there may be a user-defined literal defined for some type to be determined during the downward pass of resolution, but that depends on the exis

[Ada] Fix visibility inside declare_expression

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The first implementation just created a scope for the analysis of the declarations and the expression, so that visibility would just work as it does for all other constructs. However this led to an annoying bug when one of the declarations or the expression itself creates a transient scope: there m

[Ada] Fix internal error on declaration of derived discriminated record type

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
When the parent type has a variant part and the derived type is also discriminated but statically selects a variant, the initialization routine of the derived type may attempt to access components of other variants that are no longer present. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/

[Ada] Properly handle unprefixed references to components

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
In some cases, the compiler would incorrectly reject unprefixed uses of component names in an aspect specification for the composite type. Correct this error. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch13.adb (Replace_Type_Ref): In the case of an identifier

[Ada] Fix package installation for private array type of private element

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The problem comes from the construction of Stream operations, which happens at the point a tagged type is frozen. Streams need to see the full view of types, so that for example the Read attribute for an array can be expanded into a loop over the Read attribute for the component type. Now if durin

[Ada] Fix missing error on actual for In/Out parameter

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler was failing to give an error on the result of a call to the Input attribute passed as actual for an In/Out parameter. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Is_OK_Variable_For_Out_Formal): Remove test on Comes_From_Source in the co

[Ada] Fix indentation of "Start of processing for ..." labels

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The "Start of processing for ..." labels should be aligned with the BEGIN that follows. Violations found with: $ grep -Pzo "( *) \-\- Start of processing for \w+\n\n\1begin" *.adb and corrected manually, because some of them had to be entirely removed. Also, remove trailing semicolons found w

[Ada] Improve error messages to include full package name

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
This patch improves error messages in the compiler so that missing 'with' error messages show the complete package name instead of a limited number of selectors. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * err_vars.ads: Add new error message names and nodes. * er

[Ada] Remove redundant guards for empty list

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Routine Has_Excluded_Declaration iterates over declarations with First/Present/Next, which is safe when declarations are No_List. Cleanup related to excessive inlining-for-proof by GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * inline.adb (Build_Body_To_Inline):

[Ada] Set Error_Msg_Warn before use of << insertion

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Calls to Error_Msg procedures with a message using the < or << insertions need to set appropriately Error_Msg_Warn. This was not done in one call, which would lead to spurious errors when changing the implementation of a runtime unit. This fixes it so that changes can be applied. Tested on x86_64-

[Ada] Prevent inlining-for-proof for calls inside ELSIF condition

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
In GNATprove we don't want inlining-for-proof to expand subprogram bodies into actions attached to nodes. These actions are attached either to expressions or to statements. For expressions, we prevented inlining by Is_Potentially_Unevaluated. For statements, we prevented inlining by In_While_Loop_

[Ada] Remove CodePeer annotations for pragma Loop_Variant

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Pragma Loop_Variant is now expanded into a null statement in CodePeer mode. Remove annotation related to false positives in runtime units. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-expmod.adb: Remove CodePeer annotation for pragma Loop_Variant.diff --

[Ada] Fully qualify name in JSON representation info

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
The current termination condition of the recursion is wrong. When in JSON mode, names should be fully qualified. This requires to stop not at the first encountered compilation unit but to recurse up to Standard. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * repinfo.adb (L

[Ada] Remove extra space around binary operators

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Style cleanups. Violation initially spotted while reading the code for UI_Expon; other occurrences found with grep (and examined manually, because sometimes the extra space is needed for a code layout). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * bindgen.adb, errout.adb,

[Ada] Simplify conversions from Uint to Char_Code

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Replace "Char_Code (UI_To_Int (...))" with "UI_To_CC (...). Cleanup related to handling characters in GNATprove counterexamples; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-prag.adb (Prag): Simplify conversion of character codes. * s

[Ada] Fix invalid memory access on finalization of class-wide type

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects issues in the compiler whereby finalization of a heap- allocated class-wide type may cause an invalid memory read at runtime when the type in question contains a component whose type has a large alignment. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * e

[Ada] Raise Constraint_Error when converting negative values to Char_Code

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
GNATprove relies on the comment for Get_Enum_Lit_From_Pos, which promises to raise Constraint_Error when its Pos parameter is not among the representation values for enumeration literal. However, this promise was only respected in builds with range checks enabled. The root problem was that a simil

[Ada] Suggest use of First_Valid/Last_Valid on type with static predicate

2022-05-09 Thread Pierre-Marie de Rodat via Gcc-patches
Attributes First_Valid/Last_Valid can be used on types with static predicate, instead of First/Last/Range. Include that suggestion in the corresponding error message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Bad_Predicated_Subtype_Use): Add continuation

Re: [PATCH] configure: add --disable-fix-includes

2022-05-09 Thread Andreas Schwab
On Mai 09 2022, Martin Liška wrote: > +cat >>confdefs.h <<_ACEOF > +#define FIX_INCLUDES $disable_fix_includes > +_ACEOF Where does this come from? Also, nothing uses it. > diff --git a/gcc/configure.ac b/gcc/configure.ac > index 1171c946e6e..6015e403aa9 100644 > --- a/gcc/configure.ac > +++ b/

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

2022-05-09 Thread Christophe Lyon via Gcc-patches
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 twice, as "now fail, but worked before" and "now work, bu

[PATCH] rs6000: avoid peeking eof after __vector

2022-05-09 Thread Jiufu Guo via Gcc-patches
Hi! This patch is based on: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592102.html And update the 'function comment' to make it consistent with code. There is a rare corner case: where vector is followed only by one valid identifer and the ";" which is near the end of the file. Like th

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-09 Thread Arnaud Charlet via Gcc-patches
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/ada/ChangeLog: > > * locales.c (iso_639_1_to_639_3): Use ARRAY_SIZE. > (language_name_to_639_3): Likewise. > (country_name_to_3166): Likewise. Can you

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-09 Thread Martin Liška
On 5/9/22 12:21, Arnaud Charlet wrote: > So I don't see how your patch can work, can you clarify? Sorry for that, fixed in the updated version. Cheers, MartinFrom 5ad8fe059d3419446647eadf8785c768b647d15b Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 13 Jan 2022 18:46:26 +0100 Subject: [

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-09 Thread Arnaud Charlet via Gcc-patches
> > So I don't see how your patch can work, can you clarify? > > Sorry for that, fixed in the updated version. Assuming you're getting a successful Ada build, the Ada part is OK. > From 5ad8fe059d3419446647eadf8785c768b647d15b Mon Sep 17 00:00:00 2001 > From: Martin Liska > Date: Thu, 13 Jan 20

Re: [PATCH V3 2/3] RISC-V:Cache Management Operation instructions

2022-05-09 Thread Kito Cheng via Gcc-patches
Use unspec_volatile instead of unspec for those cache operations, because those operations have side effects, instruction scheduler might reorder those CMO operations if you use unspec. > diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md > index b3c5bce842a..d60843df490 100644 > -

PING: [PATCH v2] eliminate mutex in fast path of __register_frame

2022-05-09 Thread Thomas Neumann via Gcc-patches
Summary: __register_frame and the corresponding _Unwind_Find_FDE use a global mutex for frame registration and unwinding. This can lead to very poor performance on machines with high core counts. This patch organizes the frames in a b-tree with read-optimized synchronization instead, which allo

Re: [2/2] PR96463 -- changes to type checking vec_perm_expr in middle end

2022-05-09 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 3 May 2022 at 18:25, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 4 Jan 2022 at 19:12, Richard Sandiford > > wrote: > >> > >> Richard Biener writes: > >> > On Tue, 4 Jan 2022, Richard Sandiford wrote: > >> > > >> >> Richard Biener writes: > >> >> > On Fri, 17 De

Re: [PATCH v2] PR105169 Fix references to discarded sections

2022-05-09 Thread Richard Biener via Gcc-patches
On Sat, 7 May 2022, Giuliano Belinassi wrote: > When -fpatchable-function-entry= is enabled, certain C++ codes fails to > link because of generated references to discarded sections in > __patchable_function_entry section. This commit fixes this problem by > puting those references in a COMDAT sect

[PATCH] Remove GIMPLE restriction of ! using match.pd patterns

2022-05-09 Thread Richard Biener via Gcc-patches
This removes #if GIMPLE guards around patterns using ! which is now also provided in the GENERIC implementation. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-05-09 Richard Biener * match.pd: Remove #if GIMPLE guards around ! using patterns. --- gcc/match.pd | 12

[PATCH] tree-optimization/105517 - avoid offset truncation during VN

2022-05-09 Thread Richard Biener via Gcc-patches
When value-numbering an address expression like &p_74(D)->a1x[4294967295].a1; we are accumulating the byte offset in an 64bit integer. When later exploiting the duality between that and a POINTER_PLUS_EXPR we should avoid truncating that offset to fit in the target specific sizetype. While such o

Re: [PATCH] Remove non-ANSI C path in ansidecl.h.

2022-05-09 Thread Martin Liška
On 5/5/22 14:27, Richard Biener wrote: > You'd have to ask the sourceware side as well (binutils), but for sure > either the Yes, I've asked and they proved that. > guarding #if should be removed or the #else path should contain an #error. All right, I'm going to install the version w/o #if. Ma

Re: [PATCH] opts: do not allow Separate+Joined ending with =

2022-05-09 Thread Richard Biener via Gcc-patches
On Mon, May 9, 2022 at 10:58 AM Martin Liška wrote: > > Do not allow strange option format: > -msmall-data-limit= 11. > > For -output-pch we need to use Separate syntax as lang spec > rules automatically append a space. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > >

Re: [PATCH] Use more ARRAY_SIZE.

2022-05-09 Thread Richard Biener via Gcc-patches
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 some places where the macro usage > was wrong. > > Patch can bootstrap on x86_6

Re: [PATCH] Remove conditional STATIC_ASSERT.

2022-05-09 Thread Richard Biener via Gcc-patches
On Mon, May 9, 2022 at 10:46 AM Martin Liška wrote: > > On 5/5/22 15:08, Richard Biener wrote: > > On Thu, May 5, 2022 at 2:41 PM Martin Liška wrote: > >> > >> On 5/5/22 14:29, Richard Biener wrote: > >>> Can we then use static_assert (...) instead and remove the > >>> macro? > >> > >> Oh yes, we

Re: [PATCH] opts: do not allow Separate+Joined ending with =

2022-05-09 Thread Martin Liška
On 5/9/22 13:58, Richard Biener wrote: > The patch would have been a lot smaller if you kept it Joined only? Yes, but the langspec rules append a space for some reason: $ ./xgcc -B. /tmp/1.h -ox.h.pch --save-temps --verbose ... ./cc1 -fpreprocessed x.h.pch-1.i ... --output-pch= x.h.pch Martin

[PATCH] MAINTAINERS: Update my email address.

2022-05-09 Thread Clément chigot via Gcc-patches
From 8ba8d5b34473ebd8e8221c0f427b06d4af46f0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Mon, 9 May 2022 14:13:09 +0200 Subject: [PATCH] MAINTAINERS: Update my email address. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upd

Re: [PATCH] opts: do not allow Separate+Joined ending with =

2022-05-09 Thread Richard Biener via Gcc-patches
On Mon, May 9, 2022 at 2:16 PM Martin Liška wrote: > > On 5/9/22 13:58, Richard Biener wrote: > > The patch would have been a lot smaller if you kept it Joined only? > > Yes, but the langspec rules append a space for some reason: > > $ ./xgcc -B. /tmp/1.h -ox.h.pch --save-temps --verbose > ... > .

Re: [PATCH] Replace EVRP in DOM with ranger.

2022-05-09 Thread Andrew MacLeod via Gcc-patches
On 5/2/22 02:30, Richard Biener wrote: On Fri, Apr 29, 2022 at 6:22 PM Aldy Hernandez wrote: Andrew was mumbling something about a fast ranger mode for this release that should be on par with legacy evrp. IIRC it would be purely DOM based, won't visit back edges, and there's no caching. But

[c++][NFC] Rename Attached to Keyed

2022-05-09 Thread Nathan Sidwell
With modules, certain decls are 'scoped' with another decl. I chose the name 'attached', but that has become something specific in the modules context, so is no longer a good name. The alternative name I considered was 'keyed', but we already had the concept of a key virtual function (from the

Re: [PATCH] testsuite: Silence analyzer/pr51628-30.c for default_packed

2022-05-09 Thread David Malcolm via Gcc-patches
On Sun, 2022-05-08 at 10:31 +0300, Dimitar Dimitrov wrote: > On default_packed targets like PRU, a warning in the file included > from > analyzer/pr51628-30.c is reported as spurious one, even though it has > been > annotated there: > >   Excess errors: >   gcc/gcc/testsuite/gcc.dg/analyzer/tortur

Re: [PATCH] Replace EVRP in DOM with ranger.

2022-05-09 Thread Richard Biener via Gcc-patches
On Mon, May 9, 2022 at 2:42 PM Andrew MacLeod wrote: > > On 5/2/22 02:30, Richard Biener wrote: > > On Fri, Apr 29, 2022 at 6:22 PM Aldy Hernandez wrote: > >> > >> Andrew was mumbling something about a fast ranger mode for this > >> release that should be on par with legacy evrp. IIRC it would b

Re: [PATCH] [i386] Implement permutation with pslldq + psrldq + por when pshufb is not available.

2022-05-09 Thread Hongtao Liu via Gcc-patches
On Mon, May 9, 2022 at 4:19 PM Uros Bizjak wrote: > > On Mon, May 9, 2022 at 7:24 AM Hongtao Liu wrote: > > > > On Mon, May 9, 2022 at 1:22 PM liuhongt via Gcc-patches > > wrote: > > > > > > pand/pandn may be used to clear upper/lower bits of the operands, in > > > that case there will be 4-5 in

Re: [2/2] PR96463 -- changes to type checking vec_perm_expr in middle end

2022-05-09 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Tue, 3 May 2022 at 18:25, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> > On Tue, 4 Jan 2022 at 19:12, Richard Sandiford >> > wrote: >> >> >> >> Richard Biener writes: >> >> > On Tue, 4 Jan 2022, Richard Sandiford wrote: >> >> > >> >> >> Richa

Re: [PATCH] rs6000: avoid peeking eof after __vector

2022-05-09 Thread Segher Boessenkool
Hi! On Mon, May 09, 2022 at 06:19:45PM +0800, Jiufu Guo wrote: > There is a rare corner case: where vector is followed only by one > valid identifer and the ";" which is near the end of the file. > > Like the case in PR101168: > using vdbl = __vector double; > #define BREAK 1 > > For this case,

[PATCH v2] PR105169 Fix references to discarded sections

2022-05-09 Thread Giuliano Belinassi via Gcc-patches
When -fpatchable-function-entry= is enabled, certain C++ codes fails to link because of generated references to discarded sections in __patchable_function_entry section. This commit fixes this problem by puting those references in a COMDAT section. On the previous patch, GCC fails to compile with

[PATCH 00/10] Enable Decimal Floating Point (DFP) on AArch64

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch series enables support of DFP on AArch64, using the BID format (Binary Integer Decimal). There is no HW support for DFP on AArch64, and we made a choice similar to x86: BID format using libgcc's libbid for software emulation. This work was done independently from Andrew's patch, which

[PATCH 02/10] aarch64: Add backend support for DFP

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch updates the aarch64 backend as needed to support DFP modes (SD, DD and TD). 2022-03-31 Christophe Lyon gcc/ * config/aarch64/aarch64.cc (aarch64_split_128bit_move): Handle DFP modes. (aarch64_gen_storewb_pair): Likewise. (aarch64_gen_loadwb_pa

[PATCH 08/10] testsuite: Add C++ unwinding tests with Decimal Floating-Point

2022-05-09 Thread Christophe Lyon via Gcc-patches
These tests exercise exception handling with Decimal Floating-Point type. dfp-1.C and dfp-2.C check that thrown objects of such types are properly caught, whether when using C++ classes (decimalXX) or via GCC mode attributes. dfp-saves-aarch64.C checks that such objects are properly restored, and

[PATCH 07/10] testsuite: enable more BID DFP tests for AArch64

2022-05-09 Thread Christophe Lyon via Gcc-patches
Some tests for the BID format are currently restricted to i?86 and x86_64, but they also pass on AArch64, so this patch enables them. Since all these tests are related to the BID format, it seems useful to introduce a new effective-target (dfp_bid) instead of adding aarch64 to the current target l

[PATCH 09/10] libgcc: Add support for HF mode (aka __fp16) in libbid

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch adds support for trunc and extend operations between HF mode (__fp16) and Decimal Floating Point formats (_Decimal32, _Decimal64 and _Decimal128). For simplicity we rely on the implicit conversions inserted by the compiler between HF and SD/DF/TF modes. The existing bid*_to_binary* and

[PATCH 04/10] libgcc: enable DFP for AArch64

2022-05-09 Thread Christophe Lyon via Gcc-patches
DFP support on AArch64 relies on libgcc, so enable its DFP routines for all AArch64 targets. 2022-03-31 Christophe Lyon * libgcc/config.host: Add t-dfprules to AArch64 targets. --- libgcc/config.host | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libgcc/config.host b/libgcc

[PATCH 03/10] libgcc: Enable XF mode conversions to/from DFP modes only if supported

2022-05-09 Thread Christophe Lyon via Gcc-patches
Some targets do not support XF mode (eg AArch64), so don't build the corresponding to/from DFP modes convertion routines if __LIBGCC_HAS_XF_MODE__ is not defined. 2022-03-31 Christophe Lyon libgcc/ * config/libbid/_dd_to_xf.c: Check __LIBGCC_HAS_XF_MODE__. * config/libb

[PATCH 06/10] testsuite: Add new tests for DFP under aarch64/aapcs64

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch copies all existing tests involving float/double/long double types and replaces them with _Decimal32/_Decimal64/_Decimal128. I thought it would be clearer/easier to maintain to do it this way rather than adding tests for DFP types in the existing testcases, except for func-ret-1.c and fu

[PATCH 01/10] aarch64: Enable DFP (Decimal Floating-point) (BID format)

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch enables DFP support on aarch64, by updating config/dfp.m4 and regenerating the involved configure scripts. We enable the BID format. 2022-03-31 Christophe Lyon * config/dfp.m4: Add aarch64 support. * gcc/configure: Regenerate. * libdecnumber/configure: Regene

[PATCH 10/10] libgcc: use __builtin_clz and __builtin_ctz in libbid

2022-05-09 Thread Christophe Lyon via Gcc-patches
This patch replaces libbid's implementations of clz and ctz for 32 and 64 bits inputs which used several masks, and switches to the corresponding builtins. This will provide a better implementation, especially on targets with clz/ctz instructions. 2022-05-06 Christophe Lyon libgcc/config/libbi

[PATCH 05/10] testsuite:: Fix pr39986.c testcase for AArch64

2022-05-09 Thread Christophe Lyon via Gcc-patches
The testcase in c-c++-common/dfp/pr39986.c detects if DFP constants are correctly emitted in the assembly. However, AArch64 uses .word instead of the expected .long directive. With this patch, we now accept both. 2022-03-31 Christophe Lyon gcc/testsuite/ * c-c++-common/dfp/pr39

[PATCH] x86: Add .note.GNU-stack section only for Linux

2022-05-09 Thread H.J. Lu via Gcc-patches
Add .note.GNU-stack section only for Linux since it may not be supported on non-Linux OSes. __ELF__ isn't checked since these tests can only run on Linux/x86 ELF systems. PR target/105472 * gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section only for Linux.

Re: [patch][gcc13][i386][pr101891]Adjust -fzero-call-used-regs to always use XOR

2022-05-09 Thread Qing Zhao via Gcc-patches
> On May 7, 2022, at 4:06 AM, Uros Bizjak wrote: > > On Fri, May 6, 2022 at 6:42 PM Qing Zhao wrote: >> >> >> >>> On May 6, 2022, at 10:58 AM, Uros Bizjak wrote: >>> >>> On Fri, May 6, 2022 at 4:29 PM Qing Zhao wrote: Hi, As Kee’s requested in this PR: https:/

Re: [patch][gcc13][i386][pr101891]Adjust -fzero-call-used-regs to always use XOR

2022-05-09 Thread Qing Zhao via Gcc-patches
Another question: I think that this patch might need to be back ported to Gcc12 and GCC11. What’s your opinion on this? If so, when can I backport it? thanks. Qing > On May 7, 2022, at 4:06 AM, Uros Bizjak wrote: > > On Fri, May 6, 2022 at 6:42 PM Qing Zhao wrote: >> >> >> >>> On May 6,

Re: [2/2] PR96463 -- changes to type checking vec_perm_expr in middle end

2022-05-09 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 9 May 2022 at 19:22, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 3 May 2022 at 18:25, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 4 Jan 2022 at 19:12, Richard Sandiford > >> > wrote: > >> >> > >> >> Richard Biener writes:

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Alexander Monakov
On Mon, 2 May 2022, Alexander Monakov wrote: > > > --- a/gcc/ipa-visibility.cc > > > +++ b/gcc/ipa-visibility.cc > > > @@ -872,6 +872,22 @@ function_and_variable_visibility (bool whole_program) > > > } > > > } > > > } > > > + FOR_EACH_VARIABLE (vnode) > > > +{ > > > + tree de

[PATCH] AArch64: Improve address rematerialization costs

2022-05-09 Thread Wilco Dijkstra via Gcc-patches
Improve rematerialization costs of addresses. The current costs are set too high which results in extra register pressure and spilling. Using lower costs means addresses will be rematerialized more often rather than being spilled or causing spills. This results in significant codesize reduction

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-09 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra writes: > Improve rematerialization costs of addresses. The current costs are set too > high > which results in extra register pressure and spilling. Using lower costs > means > addresses will be rematerialized more often rather than being spilled or > causing > spills. This r

[PATCH] AArch64: Cleanup CPU option processing code

2022-05-09 Thread Wilco Dijkstra via Gcc-patches
The --with-cpu/--with-arch configure option processing not only checks valid arguments but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask. This isn't used however since a --with-cpu is translated into a -mcpu option which is processed as if written on the command-line (so TARGET

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Jan Hubicka via Gcc-patches
> On Mon, 2 May 2022, Alexander Monakov wrote: > > > > --- a/gcc/ipa-visibility.cc > > > > +++ b/gcc/ipa-visibility.cc > > > > @@ -872,6 +872,22 @@ function_and_variable_visibility (bool > > > > whole_program) > > > > } > > > > } > > > > } > > > > + FOR_EACH_VARIABLE (vno

Re: [PATCH] ipa-visibility: Optimize TLS access [PR99619]

2022-05-09 Thread Alexander Monakov
On Mon, 9 May 2022, Jan Hubicka wrote: > > On second thought, it might be better to keep the assert, and place the loop > > under 'if (optimize)'? > > The problem is that at IPA level it does not make sense to check > optimize flag as it is function specific. (shlib is OK to check it > anywhere

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-09 Thread Wilco Dijkstra via Gcc-patches
Hi Richard, > I'm not questioning the results, but I think we need to look in more > detail why rematerialisation requires such low costs.  The point of > comparison should be against a spill and reload, so any constant > that is as cheap as a load should be rematerialised.  If that isn't > happen

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

2022-05-09 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra via Gcc-patches writes: > The --with-cpu/--with-arch configure option processing not only checks valid > arguments > but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask. This > isn't used > however since a --with-cpu is translated into a -mcpu option which is > pro

Re: [PATCH] AArch64: Improve address rematerialization costs

2022-05-09 Thread Richard Sandiford via Gcc-patches
Wilco Dijkstra via Gcc-patches writes: > Hi Richard, > >> I'm not questioning the results, but I think we need to look in more >> detail why rematerialisation requires such low costs.  The point of >> comparison should be against a spill and reload, so any constant >> that is as cheap as a load sh

Re: [PATCH] PR fortran/105501 - check for non-optional spaces between adjacent keywords

2022-05-09 Thread Mikael Morin
Le 08/05/2022 à 22:17, Harald Anlauf via Fortran a écrit : Dear all, the PR correctly notes that a space between keywords 'TYPE' and 'IS' is required in free-form, but we currently accept 'TYPEIS'. We shouldn't. The combinations with non-optional blanks are listed in the standard; in F2018 this

Re: [patch][gcc13][i386][pr101891]Adjust -fzero-call-used-regs to always use XOR

2022-05-09 Thread Uros Bizjak via Gcc-patches
On Mon, May 9, 2022 at 5:44 PM Qing Zhao wrote: > > Another question: > > I think that this patch might need to be back ported to Gcc12 and GCC11. > > What’s your opinion on this? It is not a regression, so following general rules, the patch should not be backported. OTOH, the patch creates funct

Re: [PATCH] c++: Implement P2324R2, labels at the end of compound-stmts [PR103539]

2022-05-09 Thread Jason Merrill via Gcc-patches
On 5/8/22 20:26, Marek Polacek wrote: This patch implements C++23 , which allows labels at the end of a compound statement. Its C FE counterpart was already implemented in r11-4813. In cp_parser_statement I rely on in_compound to determine whether we're in a compound

Re: [PATCH] PR fortran/105501 - check for non-optional spaces between adjacent keywords

2022-05-09 Thread Harald Anlauf via Gcc-patches
Hi Mikael, Am 09.05.22 um 20:24 schrieb Mikael Morin: The fix itself looks good.  Regarding the test, I don’t understand the problem.  Can’t there be multiple subroutines, each having one (or more) problematic statement(s)? that's why I tried but failed. Example: subroutine a errorstop end

[PATCH] PR fortran/105526 - [Coarray] Add missing checks for arguments of type TEAM_TYPE

2022-05-09 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, we were lacking checks for arguments of type TEAM_TYPE to some coarray intrinsics (FORM TEAM, CHANGE TEAM, and SYNC TEAM). The attached patch adds these, and as a bonus verifies that TEAM NUMBER is a scalar integer. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Ha

  1   2   >