Re: [PATCH] Remove more stray returns and gcc_unreachable ()s

2021-12-01 Thread Richard Biener via Gcc-patches
On Tue, 30 Nov 2021, Martin Sebor wrote: > On 11/30/21 12:51 AM, Richard Biener wrote: > > On Mon, 29 Nov 2021, Martin Sebor wrote: > > > >> On 11/29/21 11:53 AM, Martin Sebor wrote: > >>> On 11/29/21 6:09 AM, Richard Biener via Gcc-patches wrote: > This removes more cases that appear when

Re: [PING, PATCH] doc, d: Add note that D front end now requires GDC installed in order to bootstrap.

2021-12-01 Thread Richard Biener via Gcc-patches
On Tue, Nov 30, 2021 at 6:01 PM Iain Buclaw via Gcc-patches wrote: > > Ping. OK. > Excerpts from Iain Buclaw's message of November 18, 2021 2:06 am: > > Hi, > > > > As asked for, this adds the documentation note in install.texi about the > > upcoming bootstrap requirements. > > > > Obviously

[Ada] Improve error messages for dot notation when -gnatX not used

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
With extensions allowed (whether switch -gnatX or pragma Extensions_Allowed is used), dot notation is allowed on untagged types for primitives of the type. Improve the error messages issued when extensions are not allowed, in particular when allowing extensions would make the code legal. Tested

[Ada] Allow formal functions to have a default in the form of an expression function

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
As a language extension, the declaration of a generic formal function is allowed to have a default given by an expression in parentheses, where the expression is of the function's result type and can refer to formal parameters of the function (in direct analogy with expression functions). For

[Ada] Improve messages on incorrect state refinement in SPARK

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
The use of Abstract_State / Refined_State / Part_Of may lead to unclear messages for users. This patch adds continuation messages on common error messages, to explain the problem, or expands the existing error message. As a result of specializing error messages on misplaced pragmas, many error

[Ada] Tidy up freezing code for instantiations

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This cleans up the code implementing freezing for instantiations, in order to clearly separate it from semantic analysis and to make the package and subprogram paths more alike. No functional changes. Note that a couple of subprograms are renamed but not re-alphabetized to avoid making the

[Ada] Fix typo in comment

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
I guess "tnat" means that. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Aggregate): Fix typo in comment.diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -891,7 +891,7 @@ package body

Re: [PATCH] Fix alignment of stack slots for overaligned types [PR103500]

2021-12-01 Thread Alex Coplan via Gcc-patches
On 30/11/2021 19:38, Florian Weimer wrote: > * Alex Coplan via Gcc-patches: > > > Bootstrapped and regtested on aarch64-linux-gnu, x86_64-linux-gnu, and > > arm-linux-gnueabihf: no regressions. > > > > I'd appreciate any feedback. Is it OK for trunk? > > Does this need an ABI warning? That's a

Re: [r12-5612 Regression] FAIL: gcc.target/i386/pr88531-1a.c (test for excess errors) on Linux/x86_64

2021-12-01 Thread Richard Sandiford via Gcc-patches
"sunil.k.pandey" writes: > On Linux/x86_64, > > 10833849b55401a52f2334eb032a70beb688e9fc is the first bad commit > commit 10833849b55401a52f2334eb032a70beb688e9fc > Author: Richard Sandiford > Date: Tue Nov 30 09:52:29 2021 + > > vect: Support gather loads with SLP > > caused > > FAIL:

[Ada] Avoid duplication for Sets functions

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
ARM A.18.7 96.9/3 and 96.12/3 state: > Equivalent to Constant_Reference (Container, Find (Container, Key)). > Equivalent to Reference_Preserving_Key (Container, Find (Container, Key)). Every other procedure and functions noted as "equivalent" for sets in this ARM function use these equivalences.

[Ada] Do not free task for _parent

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
When a task was stored in a record, GNAT would mistakenly generate a call to free_task twice, the first being correct and triggered by the freeing of the record, the second being incorrect and generated from recursing through the record's _parent. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Tidy up freezing code for instantiations (continued)

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This re-alphabetizes local subprograms after the previous change. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch12.adb (Freeze_Package_Instance): Move up. patch.diff.gz Description: application/gzip

[Ada] Tune whitespace of the bounded lists Aggregate aspect

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Whitespace cleanup only. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbdlli.ads (List): Remove extra space in Aggregate aspect.diff --git a/gcc/ada/libgnat/a-cbdlli.ads b/gcc/ada/libgnat/a-cbdlli.ads --- a/gcc/ada/libgnat/a-cbdlli.ads +++

[committed] d: Update documentation of new D language options.

2021-12-01 Thread Iain Buclaw via Gcc-patches
Hi, This patch adds documentation for the following new D options: - New switch that controls what code is generated on a contract failure (throw or abort). - New switch that controls mangling of D types in `extern(C++)` code, as well as setting the compile-time value of

[PATCH] fix spelling of -linker-output-auto-nolto-rel

2021-12-01 Thread Rasmus Villemoes
The transposition nolto -> notlo is confusing and it makes the long name even harder to read than it already is - I kept reading it as "not lo" until I realized it was a simply typo. Fixes: 5269b24605b1 (Silence warning in LTO mode on VxWorks) lto-plugin/ * lto-plugin.c: Fix

[Ada] Replace low-level detection of subprograms with high-level wrapper

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Cleanup related to handling of dispatching equality in GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_aggr.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_elim.adb, sem_util.adb: Replace uses of Subprogram_Kind with

[Ada] Add query for extended precision floating-point types

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This query is used in GNATprove to identify extended precision (80-bits) floating-point types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Is_Extended_Precision_Floating_Point_Type): New function. * sem_util.ads

[Ada] Syntax error on "not null procedure"

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Give an error in the following cases: type T is access not null procedure ...; type T is access not null function ...; type T is access not null protected procedure ...; type T is access not null protected function ...; These are illegal syntax. Note that similar errors on

[PATCH] vect: Tighten check for SLP memory groups [PR103517]

2021-12-01 Thread Richard Sandiford via Gcc-patches
When checking for compatible stmts, vect_build_slp_tree_1 did: && !(STMT_VINFO_GROUPED_ACCESS (stmt_info) && (first_stmt_code == ARRAY_REF || first_stmt_code == BIT_FIELD_REF || first_stmt_code == INDIRECT_REF

Re: [PATCH] tree-optimization/103464 - Also pre-process PHIs in range-of-stmt.

2021-12-01 Thread Richard Biener via Gcc-patches
On Tue, Nov 30, 2021 at 3:35 PM Andrew MacLeod via Gcc-patches wrote: > > When I flatten the call stack for range_of_stmt in PR 103231 ( > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103231 ), I mention that I > was only flattening it for chains of statements with range handlers. If > it turned

[Ada] Spurious warning when using 'Type_Key on generic formal

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an issue in the compiler whereby spurious compile-time warnings get raised when the attribute 'Type_Key is applied to a generic formal type. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Type_Key): Avoid premature use warnings when the

[Ada] Create object file for ignored ghost compilation unit

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
If the compilation unit we're compiling is an ignored ghost, we need to ensure that an object file is generated. This happens automatically for the GCC backend since it always generates the .o file, but for GNAT LLVM, the backend isn't called. So we need to be sure that we explicitly generate the

[Ada] Fix issues with ignored ghost code and unnesting

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Unnesting needs to be run after all ignored ghost code is removed so that it doesn't try to put entities into activation records that will be removed. Also, don't add subprograms that are ignored into the list of inlined subprograms. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[PATCH] Modify combine pattern by a pseudo AND with its nonzero bits [PR93453]

2021-12-01 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch modifies the combine pattern with a helper - change_pseudo_and_mask when recog fails. The helper converts a single pseudo to the pseudo AND with a mask if the outer operator is IOR/XOR/PLUS and the inner operator is ASHIFT/LSHIFTRT/AND. The conversion helps match shift + ior

Re: [PATCH RFA (fold/symtab)] c++: constexpr, fold, weak redecl, fp/0 [PR103310]

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 3:10 AM Jason Merrill via Gcc-patches wrote: > > For PR61825, honza changed tree_single_nonzero_warnv_p to prevent a later > declaration from marking a function as weak after we've determined that it > wasn't weak before. But we shouldn't do that for speculative folding;

[committed] i386: Fix up some minor formatting issues and one inconsistency

2021-12-01 Thread Jakub Jelinek via Gcc-patches
Hi! While looking at a proposed vendor backport, I've noticed some formatting issues in x86-tune.def. Also, in all spots m_GENERIC comes last, except one recently changed, I think it is useful to have m_GENERIC always last for consistency. Bootstrapped/regtested on x86_64-linux and i686-linux,

Re: [PATCH v7 2/2] Don't move cold code out of loop by checking bb count

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Nov 10, 2021 at 4:08 AM Xionghu Luo wrote: > > > > On 2021/11/4 21:00, Richard Biener wrote: > > On Wed, Nov 3, 2021 at 2:29 PM Xionghu Luo wrote: > >> > >> > >>> + while (outmost_loop != loop) > >>> +{ > >>> + if (bb_colder_than_loop_preheader (loop_preheader_edge > >>>

[Ada] Cleanup listing of representation info

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * repinfo.adb (List_Entities): Simplify detection of entries; refactor potentially redundant comparison.diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb ---

[Ada] Sync whitespace between variants of Indefinite_Holders unit

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Remove insignificant whitespace diffs between atomic and non-atomic variants of Ada.Containers.Indefinite_Holders. This will simplify review and modification of both variants in the future. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-coinho.ads: Sync

[Ada] Fix crash on pragma Compile_Time_Warning/Error

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes a compiler crash that occurs in the following situation: The file being compiled with's a generic package. The body of that generic package contains a procedure that does not have a separate spec (i.e. the procedure body acts as the spec). The procedure body instantiates another

[COMMITTED] tree-optimization/103456 - Record only successes from object_sizes_set

2021-12-01 Thread Siddhesh Poyarekar
Avoid overwriting osi->changed if object_sizes_set does not update the size, so that a previous success in the same pass is not overwritten. This fixes the bootstrap-ubsan build config, which was failing due to incorrect object size. gcc/ChangeLog: PR tree-optimization/103456 *

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Richard Biener via Gcc-patches
On Tue, Nov 30, 2021 at 11:35 PM Peter Bergner wrote: > > On 11/30/21 2:44 PM, Qing Zhao via Gcc-patches wrote: > > Sorry for the confusing… > > My major question is: > > > > for a variable of type __vector_pair, could it be in a register? > > Yes. To be pedantic, it will live in a vector

[Ada] Simplify building of inequality function body

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup related to expansion of equality for GNATprove. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch3.adb (Make_Eq_Body): Refactor to avoid appending to an empty list; also, when exiting early we will not create any list; fix style in

[Ada] Document System.Atomic_Counters as supported on ARM and AARCH64

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Unit System.Atomic_Counters on ARM and AARCH64 is supported via GCC builtins. This patch makes the documentation consistent with Makefile.rtl and with comments in s-atocou.ads. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/the_gnat_library.rst

[Ada] Sort list of Ada runtime units in Makefile.rtl

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
Sort to simplify review and insertion of future units. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (GNATRTL_TASKING_OBJS): Sort. (GNATRTL_NONTASKING_OBJS): Sort.diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl --- a/gcc/ada/Makefile.rtl +++

[Ada] Improve support for casing on types with controlled parts

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
INOX allows casing on composite values. In some cases of bindings for subcomponents, the compiler introduced copying which led to compiler failures associated with finalizing those copies. In such cases a bound object now provides a constant view of the appropriate subcomponent of the selector

Re: [PATCH] c++, v2: Allow indeterminate unsigned char or std::byte in bit_cast - P1272R4

2021-12-01 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 30, 2021 at 03:19:19PM -0500, Jason Merrill wrote: > On 11/30/21 07:17, Jakub Jelinek wrote: > > On Mon, Nov 29, 2021 at 10:25:58PM -0500, Jason Merrill wrote: > > > It's a DR. Really, it was intended to be part of C++20; at the Cologne > > > meeting in 2019 CWG thought byteswap was

i386 patch ping

2021-12-01 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585125.html "x86: Speed up target attribute handling by using a cache" patch. IMHO the .2s speedup on #include is worth it. Thanks Jakub

[Ada] Storage error on untagged prefixed subprogram calls with -gnatX

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
The compiler can crash when compiling the prefixed form of subprogram calls for untagged types when extensions are enabled. Problems can also manifest in cases where such calls occur in the absence of extensions being enabled. The source of this is that the Direct_Primitive_Operations lists were

[Ada] Fix small discrepancy between -gnatG and -gnatD[G] outputs

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
The outputs generated for the same compilation by -gnatG and -gnatD[G] are not strictly identical: the former lacks a few freeze nodes, which can be quite confusing. So this change aligns the former with the latter. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Do not return freeze nodes for start of early call regions

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This makes sure that the Early Call Region Processor in Sem_Elab does not return a region starting with a construct that is not suitable for being included into it, for example a freeze node. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_elab.adb

[Ada] Fix incorrect fixed-point computation in expression function

2021-12-01 Thread Pierre-Marie de Rodat via Gcc-patches
This fixes a couple of issues pertaining to (ordinary) fixed-point types declared with a Small aspect whose value is not equal to the default one. The processing of this aspect is delayed until the freeze point of the type, which means that the Small_Value of the entity for the type does not have

Re: [PATCH v2] rs6000: Fix a handful of 32-bit built-in function problems

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi! I'd like to ping this patch. By the way, the diagnostics are improved [1] since I sent it, so that we now inform the user that the overloaded function is implemented by the instantiated function. Thanks! Bill [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585250.html On

[PATCH, PING] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi!  I'd like to ping this patch. Thanks! Bill On 11/18/21 10:36 AM, Bill Schmidt wrote: > Hi! This is the last patch broken out of the previous test suite patch > for the new builtins support. > > One advantage of the new builtins support is uniform error messages for > arguments with

[PATCH] c++: Fix bogus error with __integer_pack [PR94490]

2021-12-01 Thread Marek Polacek via Gcc-patches
Here we issue a bogus: error: '(0 ? fake_tuple_size_v : fake_tuple_size_v)' is not a constant expression because cxx_constant_value in expand_integer_pack gets *(0 ? VIEW_CONVERT_EXPR(fake_tuple_size_v) : VIEW_CONVERT_EXPR(fake_tuple_size_v)) which is a REFERENCE_REF_P and we evaluate its

Re: [PATCH] rs6000: Mirror fix for PR102347 into the new builtins support

2021-12-01 Thread Segher Boessenkool
Hi! On Wed, Dec 01, 2021 at 09:29:42AM -0600, Bill Schmidt wrote: > Recently Kewen fixed a problem in the old builtins support where > rs6000_builtin_decl prematurely indicated that a target builtin is > unavailable. This also needs to be done for the new builtins support, but in > this case we

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Peter Bergner via Gcc-patches
On 12/1/21 3:01 AM, Richard Biener wrote: > Given all this I suggest to exempt OPAQUE_TYPE from is_var_need_auto_init > instead of fixing up things at expansion time. The following fixes the ICE. The bootstrap/regtesting is still running though. Peter diff --git a/gcc/gimplify.c

[PATCH, PING] rs6000: Builtins test changes for BFP scalar tests

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi! I'd like to ping this patch. Segher had objected to the change in diagnostics, but I hope we've solved that now with the better informational message [1]. Thanks! Bill [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585250.html On 11/17/21 2:58 PM, Bill Schmidt wrote: > Hi!

Re: [PATCH] path solver: Minimize exported ranges to subsequent blocks.

2021-12-01 Thread Jeff Law via Gcc-patches
On 12/1/2021 9:18 AM, Aldy Hernandez via Gcc-patches wrote: I'm going to hold off pushing this until I hear from the global maintainers and/or release managers. This patch fixes a pathological performance case, but it may also be handled by Andrew's fixes in this area. It's up to y'all to

Re: [PATCH] ipa-sra: Check also ECF_LOOPING_CONST_OR_PURE when evaluating calls

2021-12-01 Thread Martin Jambor
On Tue, Nov 30 2021, Richard Biener wrote: > On Tue, Nov 30, 2021 at 3:24 PM Martin Jambor wrote: >> >> Hi, >> >> in PR 103267 Honza found out that IPA-SRA does not look at >> ECF_LOOPING_CONST_OR_PURE when evaluating if a call can have side >> effects. Fixed with this patch. The testcase

Re: [PATCH] rs6000: Mirror fix for PR102347 into the new builtins support

2021-12-01 Thread Bill Schmidt via Gcc-patches
On 12/1/21 11:21 AM, Segher Boessenkool wrote: > Hi! > > On Wed, Dec 01, 2021 at 09:29:42AM -0600, Bill Schmidt wrote: >> Recently Kewen fixed a problem in the old builtins support where >> rs6000_builtin_decl prematurely indicated that a target builtin is >> unavailable. This also needs to be

Re: [committed] libstdc++: Optimize ref-count updates in COW std::string

2021-12-01 Thread Florian Weimer via Gcc-patches
* Jonathan Wakely via Libstdc: > diff --git a/libstdc++-v3/include/bits/cow_string.h > b/libstdc++-v3/include/bits/cow_string.h > index ced395b80b8..4fae1d02981 100644 > --- a/libstdc++-v3/include/bits/cow_string.h > +++ b/libstdc++-v3/include/bits/cow_string.h > @@ -105,7 +105,7 @@

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-01 Thread Andrew MacLeod via Gcc-patches
On 12/1/21 09:48, Martin Liška wrote: On 12/1/21 15:34, Richard Biener wrote: On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: On 12/1/21 15:19, Richard Biener wrote: which is compute the range of 'lhs' on edge_true into predicate->true_range, assign that same range to ->false_range and

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Peter Bergner via Gcc-patches
On 12/1/21 1:07 PM, Richard Biener wrote: > On December 1, 2021 6:42:21 PM GMT+01:00, Peter Bergner > wrote: >> On 12/1/21 3:01 AM, Richard Biener wrote: >>> Given all this I suggest to exempt OPAQUE_TYPE from is_var_need_auto_init >>> instead of fixing up things at expansion time. >> >> The

Patch ping related to OpenMP

2021-12-01 Thread Tobias Burnus
Patch ping - lightly sorted by priority, simplicity and dependency: * [PATCH, v5, OpenMP 5.0] Improve OpenMP target support for C++ [PR92120 v5] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584602.html * [PATCH, v2, OpenMP 5.0] Remove array section base-pointer mapping semantics,

Re: [PATCH] c++: ICE with auto(0) in requires-expression [PR103408]

2021-12-01 Thread Patrick Palka via Gcc-patches
On Wed, Dec 1, 2021 at 10:26 AM Marek Polacek via Gcc-patches wrote: > > Here we ICE on > > int f() requires (auto(0)); > > in do_auto_deduction when handling the auto: we're in a non-templated > requires-expression which are parsed under processing_template_decl == 1 > and empty

[PATCH, PING] rs6000: Builtins test changes for pr80315-*.c, pr88100.c

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi!  I'd like to ping this patch. Thanks! Bill On 11/18/21 10:15 AM, Bill Schmidt wrote: > Hi! This patch is broken out from the test case patch for the new > builtins support. > > One advantage of the new builtins support is uniform error messages for > arguments with restricted values.

[PATCH, PING] rs6000: Builtins test changes for pragma_misc9.c

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi!  I'd like to ping this patch. Thanks! Bill On 11/18/21 10:18 AM, Bill Schmidt wrote: > Hi! This patch is broken out from the test suite patch for the new > builtins support. This one is just a minor adjustment for the error > message wording. > > Tested on powerpc64le-linux-gnu and

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Richard Biener via Gcc-patches
On December 1, 2021 6:42:21 PM GMT+01:00, Peter Bergner wrote: >On 12/1/21 3:01 AM, Richard Biener wrote: >> Given all this I suggest to exempt OPAQUE_TYPE from is_var_need_auto_init >> instead of fixing up things at expansion time. > >The following fixes the ICE. The bootstrap/regtesting is

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 3:10 PM Martin Liška wrote: > > On 11/30/21 12:17, Richard Biener wrote: > > On Mon, Nov 29, 2021 at 1:45 PM Martin Liška wrote: > >> > >> On 11/26/21 09:12, Richard Biener wrote: > >>> On Wed, Nov 24, 2021 at 3:32 PM Martin Liška wrote: > > On 11/24/21 15:14,

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: > > On 12/1/21 15:19, Richard Biener wrote: > > which is compute the range of 'lhs' on edge_true into predicate->true_range, > > assign that same range to ->false_range and then invert it to get the > > range on the false_edge. What I am saying

Re: [PATCH] x86: Speed up target attribute handling by using a cache

2021-12-01 Thread Uros Bizjak via Gcc-patches
On Mon, Nov 22, 2021 at 10:36 AM Jakub Jelinek wrote: > > Hi! > > The target attribute handling is very expensive and for the common case > from x86intrin.h where many functions get implicitly the same target > attribute, we can speed up compilation a lot by caching it. > > The following patches

[committed] libstdc++: Clear RB tree after moving elements [PR103501]

2021-12-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. If the allocator-extended move constructor move-constructs each element into the new container, the contents of the old container are left in moved-from states. We cannot know if those states preserve the container's ordering and uniqueness guarantees, so

Re: [PATCH] dwarf: Multi-register CFI address support.

2021-12-01 Thread Jakub Jelinek via Gcc-patches
On Thu, Nov 11, 2021 at 06:12:50PM +, Hafiz Abid Qadeer wrote: > * dwarf2cfi.c (dw_stack_pointer_regnum): Change type to struct cfa_reg. > (dw_frame_pointer_regnum): Likewise. > (new_cfi_row): Use set_by_dwreg. > (get_cfa_from_loc_descr): Use set_by_dwreg. Support

[PATCH, PING] rs6000: Builtins test changes for compare-bytes tests

2021-12-01 Thread Bill Schmidt via Gcc-patches
Hi!  I'd like to ping this patch. Thanks! Bill On 11/18/21 7:47 AM, Bill Schmidt wrote: > Hi! This patch is broken out from the patch with test suite changes for the > new builtins support. > > With the old builtins support, cmpb-2.c produces: > warning: implicit declaration of function

Re: [PATCH][wwwdocs] Update section on enormous source files in htdocs/projects/beginner.html

2021-12-01 Thread Eric Gallager via Gcc-patches
On Wed, Dec 1, 2021 at 10:54 AM Gerald Pfeifer wrote: > > Hi Eric, > > On Wed, 24 Nov 2021, Eric Gallager wrote: > > This next patch does more than just removing old stuff: it adds an > > extra sentence to describe a shell command used to generate a list, so > > to verify that I've got the shell

Re: [committed] libstdc++: Optimize ref-count updates in COW std::string

2021-12-01 Thread Jonathan Wakely via Gcc-patches
On Wed, 1 Dec 2021 at 18:16, Florian Weimer wrote: > > * Jonathan Wakely via Libstdc: > > > diff --git a/libstdc++-v3/include/bits/cow_string.h > > b/libstdc++-v3/include/bits/cow_string.h > > index ced395b80b8..4fae1d02981 100644 > > --- a/libstdc++-v3/include/bits/cow_string.h > > +++

Re: [RFC/PATCH] C++ constexpr vs. floating point exceptions.

2021-12-01 Thread Jason Merrill via Gcc-patches
On Tue, Sep 21, 2021 at 5:19 PM Jason Merrill wrote: > On Tue, Sep 21, 2021 at 4:30 PM Joseph Myers > wrote: > >> On Tue, 21 Sep 2021, Jakub Jelinek via Gcc-patches wrote: >> >> > On Tue, Sep 21, 2021 at 02:15:59PM +0100, Roger Sayle wrote: >> > > Can you double check? Integer division by zero

RE: [PATCH] Final value replacement improvements for until-wrap loops.

2021-12-01 Thread Roger Sayle
Hi Richard, Many thanks for the review. Here's the final version that I've committed, including your suggested improvements, following another make bootstrap and make -k check on x86_64-pc-linux-gnu with no new failures. Thanks again. 2021-12-01 Roger Sayle Richard Biener

Re: [PATCH] vect: Tighten check for SLP memory groups [PR103517]

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 2:25 PM Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > On Wed, Dec 1, 2021 at 11:56 AM Richard Sandiford via Gcc-patches > > wrote: > >> > >> When checking for compatible stmts, vect_build_slp_tree_1 did: > >> > >>&&

Patch ping

2021-12-01 Thread Jakub Jelinek via Gcc-patches
Hi! I'd like to ping following patches: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583289.html c++, dyninit: Optimize C++ dynamic initialization by constants into DECL_INITIAL adjustment [PR102876] While Jason has added -fimplicit-constexpr which can fix up some cases, it

Re: [PATCH RFA (fold/symtab)] c++: constexpr, fold, weak redecl, fp/0 [PR103310]

2021-12-01 Thread Marek Polacek via Gcc-patches
On Tue, Nov 30, 2021 at 09:09:41PM -0500, Jason Merrill via Gcc-patches wrote: > For PR61825, honza changed tree_single_nonzero_warnv_p to prevent a later > declaration from marking a function as weak after we've determined that it > wasn't weak before. But we shouldn't do that for speculative

[PATCH v4 2/6] __builtin_dynamic_object_size: Recognize builtin

2021-12-01 Thread Siddhesh Poyarekar
Recognize the __builtin_dynamic_object_size builtin and add paths in the object size path to deal with it, but treat it like __builtin_object_size for now. Also add tests to provide the same testing coverage for the new builtin name. gcc/ChangeLog: * builtins.def

[PATCH v4 0/6] __builtin_dynamic_object_size

2021-12-01 Thread Siddhesh Poyarekar
This patchset implements the __builtin_dynamic_object_size builtin for gcc. The primary motivation to have this builtin in gcc is to enable _FORTIFY_SOURCE=3 support with gcc, thus allowing greater fortification in use cases where the potential performance tradeoff is acceptable. Semantics:

[PATCH v4 4/6] tree-object-size: Handle function parameters

2021-12-01 Thread Siddhesh Poyarekar
Handle hints provided by __attribute__ ((access (...))) to compute dynamic sizes for objects. gcc/ChangeLog: * tree-object-size.c: Include tree-dfa.h. (parm_object_size): New function. (collect_object_sizes_for): Call it. gcc/testsuite/ChangeLog: *

[committed] libstdc++: Avoid unwanted allocations in filesystem::path

2021-12-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. When using COW strings, accessing _M_pathname[0] and similar non-const accessors can cause the string to "leak", meaning it reallocates itself if it shares ownership with another string object. This causes test failures for --enable-fully-dynamic-string

[PATCH] c++: ICE with unnamed tparm and concept [PR103408]

2021-12-01 Thread Marek Polacek via Gcc-patches
Here we crash when issuing the "constraint C has type T, not bool" error, because pp_cxx_parameter_mapping wasn't prepared to see an anonymous template parameter. With this patch we print error: constraint 'auto() [with = 0]' has type '', not 'bool' The "" is what this patch adds.

Re: [PATCH] path solver: Minimize exported ranges to subsequent blocks.

2021-12-01 Thread Aldy Hernandez via Gcc-patches
I'm going to hold off pushing this until I hear from the global maintainers and/or release managers. This patch fixes a pathological performance case, but it may also be handled by Andrew's fixes in this area. It's up to y'all to decide if it's something we want in this release. An alternative

Re: [PATCH] Allow loop crossing paths in back threader copier.

2021-12-01 Thread Richard Biener via Gcc-patches
On Tue, Nov 30, 2021 at 4:48 PM Aldy Hernandez via Gcc-patches wrote: > > We are currently restricting loop crossing paths in the generic copier > used by the back threader, but we should be able to handle them after > loop_done has completed. But this isn't a cost thing but a correctness (as

[committed] testsuite: Fix typo in comment in aapcs64 test

2021-12-01 Thread Alex Coplan via Gcc-patches
Committed as obvious. Thanks, Alex gcc/testsuite/ChangeLog: * gcc.target/aarch64/aapcs64/macro-def.h (PTR): Fix typo in comment. diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/macro-def.h b/gcc/testsuite/gcc.target/aarch64/aapcs64/macro-def.h index

Re: [PATCH] fix spelling of -linker-output-auto-nolto-rel

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 3:18 PM Rasmus Villemoes wrote: > > On 01/12/2021 14.17, Richard Biener wrote: > > On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes > > wrote: > >> > >> The transposition nolto -> notlo is confusing and it makes the long > >> name even harder to read than it already is -

[PATCH v4 1/6] tree-object-size: Use trees and support negative offsets

2021-12-01 Thread Siddhesh Poyarekar
Transform tree-object-size to operate on tree objects instead of host wide integers. This makes it easier to extend to dynamic expressions for object sizes. The compute_builtin_object_size interface also now returns a tree expression instead of HOST_WIDE_INT, so callers have been adjusted to

[PATCH v4 5/6] tree-object-size: Handle GIMPLE_CALL

2021-12-01 Thread Siddhesh Poyarekar
Handle non-constant expressions in GIMPLE_CALL arguments. Also handle alloca. gcc/ChangeLog: * tree-object-size.c (alloc_object_size): Make and return non-constant size expression. (call_object_size): Return expression or unknown based on whether dynamic object

[PATCH] c++: Fix for decltype(auto) and parenthesized expr [PR103403]

2021-12-01 Thread Marek Polacek via Gcc-patches
In r11-4758, I tried to fix this problem: int & = 0; decltype(auto) j = i; // should behave like int & = i; error wherein do_auto_deduction was getting confused with a REFERENCE_REF_P and it didn't realize its operand was a name, not an expression, and deduced the wrong type. Unfortunately

Re: [PATCH] vect: Tighten check for SLP memory groups [PR103517]

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 11:56 AM Richard Sandiford via Gcc-patches wrote: > > When checking for compatible stmts, vect_build_slp_tree_1 did: > >&& !(STMT_VINFO_GROUPED_ACCESS (stmt_info) > && (first_stmt_code == ARRAY_REF > ||

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-01 Thread Martin Liška
On 11/30/21 12:17, Richard Biener wrote: On Mon, Nov 29, 2021 at 1:45 PM Martin Liška wrote: On 11/26/21 09:12, Richard Biener wrote: On Wed, Nov 24, 2021 at 3:32 PM Martin Liška wrote: On 11/24/21 15:14, Martin Liška wrote: It likely miscompiles gcc.dg/loop-unswitch-5.c, working on

[committed] libstdc++: Optimize ref-count updates in COW std::string

2021-12-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. Most ref-count updates in the COW string are done via the functions in , which will use non-atomic ops when the program is known to be single-threaded. The _M_is_leaked() and _M_is_shared() functions use __atomic_load_n directly, because doesn't provide a

[PATCH] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-01 Thread Marek Polacek via Gcc-patches
In C++23, auto(x) is valid, so decltype(auto(x)) should also be valid, so void f(decltype(auto(0))); should be just as void f(int); but currently, everytime we see 'auto' in a parameter-declaration-clause, we try to synthesize_implicit_template_parm for it, creating a new template

Re: [PATCH] path solver: Use only one ssa_global_cache.

2021-12-01 Thread Aldy Hernandez via Gcc-patches
No one has said anything in 48 hours. By the power vested in me, I declare it approved. Pushed. On Mon, Nov 29, 2021 at 5:21 PM Aldy Hernandez wrote: > > We're using a temporary range cache while computing ranges for PHIs to > make sure the real cache doesn't get set until all PHIs are

[PATCH v4 6/6] tree-object-size: Dynamic sizes for ADDR_EXPR

2021-12-01 Thread Siddhesh Poyarekar
Allow returning dynamic expressions from ADDR_EXPR for __builtin_dynamic_object_size and also allow offsets to be dynamic. gcc/ChangeLog: * tree-object-size.c (size_valid_p): New function. (size_for_offset): Remove OFFSET constness assertion. (addr_object_size): Build

[PATCH v4 3/6] tree-object-size: Support dynamic sizes in conditions

2021-12-01 Thread Siddhesh Poyarekar
Handle GIMPLE_PHI and conditionals specially for dynamic objects, returning PHI/conditional expressions instead of just a MIN/MAX estimate. This makes the returned object size variable for loops and conditionals, so tests need to be adjusted to look for precise size in some cases.

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-12-01 Thread Martin Liška
On 12/1/21 15:34, Richard Biener wrote: On Wed, Dec 1, 2021 at 3:25 PM Martin Liška wrote: On 12/1/21 15:19, Richard Biener wrote: which is compute the range of 'lhs' on edge_true into predicate->true_range, assign that same range to ->false_range and then invert it to get the range on the

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Qing Zhao via Gcc-patches
> On Dec 1, 2021, at 3:01 AM, Richard Biener wrote: > > On Tue, Nov 30, 2021 at 11:35 PM Peter Bergner wrote: >> >> On 11/30/21 2:44 PM, Qing Zhao via Gcc-patches wrote: >>> Sorry for the confusing… >>> My major question is: >>> >>> for a variable of type __vector_pair, could it be in a

Re: [PATCH][wwwdocs] Update section on enormous source files in htdocs/projects/beginner.html

2021-12-01 Thread Gerald Pfeifer
Hi Eric, On Wed, 24 Nov 2021, Eric Gallager wrote: > This next patch does more than just removing old stuff: it adds an > extra sentence to describe a shell command used to generate a list, so > to verify that I've got the shell command right, I'm asking for a > review. -There are several other

Re: [PATCH] Allow loop crossing paths in back threader copier.

2021-12-01 Thread Aldy Hernandez via Gcc-patches
On Wed, Dec 1, 2021 at 2:36 PM Richard Biener wrote: > > On Tue, Nov 30, 2021 at 4:48 PM Aldy Hernandez via Gcc-patches > wrote: > > > > We are currently restricting loop crossing paths in the generic copier > > used by the back threader, but we should be able to handle them after > > loop_done

Re: [PATCH] middle-end: Skip initialization of opaque type register variables [PR103127]

2021-12-01 Thread Peter Bergner via Gcc-patches
On 12/1/21 9:06 AM, Qing Zhao wrote: >> On Dec 1, 2021, at 3:01 AM, Richard Biener >> wrote: >> Given all this I suggest to exempt OPAQUE_TYPE from is_var_need_auto_init >> instead of fixing up things at expansion time. > > Agreed. > > So, Peter, will you update the routine

Re: [PATCH] fix spelling of -linker-output-auto-nolto-rel

2021-12-01 Thread Richard Biener via Gcc-patches
On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes wrote: > > The transposition nolto -> notlo is confusing and it makes the long > name even harder to read than it already is - I kept reading it as > "not lo" until I realized it was a simply typo. > > Fixes: 5269b24605b1 (Silence warning in LTO

Re: [PATCH] vect: Tighten check for SLP memory groups [PR103517]

2021-12-01 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Wed, Dec 1, 2021 at 11:56 AM Richard Sandiford via Gcc-patches > wrote: >> >> When checking for compatible stmts, vect_build_slp_tree_1 did: >> >>&& !(STMT_VINFO_GROUPED_ACCESS (stmt_info) >> && (first_stmt_code ==

Re: [PATCH] fix spelling of -linker-output-auto-nolto-rel

2021-12-01 Thread Rasmus Villemoes via Gcc-patches
On 01/12/2021 14.17, Richard Biener wrote: > On Wed, Dec 1, 2021 at 12:08 PM Rasmus Villemoes > wrote: >> >> The transposition nolto -> notlo is confusing and it makes the long >> name even harder to read than it already is - I kept reading it as >> "not lo" until I realized it was a simply

[committed] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-12-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This adds std::__is_constant_evaluated() as a C++11 wrapper for __builtin_is_constant_evaluated, but just returning false if the built-in isn't supported by the compiler. This allows us to use it throughout the library without checking __has_builtin every

  1   2   >