[gimple-isel] Remove redundant if condition

2021-10-05 Thread Prathamesh Kulkarni via Gcc-patches
Hi, In gimple_expand_vec_cond_expr: icode = get_vcond_icode (mode, cmp_op_mode, unsignedp); if (icode == CODE_FOR_nothing) { if (tcode == LT_EXPR && op0a == op0) { /* A VEC_COND_EXPR condition could be folded from EQ_EXPR/NE_EXPR into a consta

[PATCH] c++: Fix apply_identity_attributes [PR102548]

2021-10-05 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs on x86_64-linux with -m32 due to a bug in apply_identity_attributes. The function is being smart and attempts not to duplicate the chain unnecessarily, if either there are no attributes that affect type identity or there is possibly empty set of attributes that do

Re: [committed] d: gdc driver ignores -static-libstdc++ when automatically linking libstdc++ library

2021-10-05 Thread ibuclaw--- via Gcc-patches
> On 04/10/2021 18:48 Iain Sandoe wrote: > > For targets that don’t support HAVE_LD_STATIC_DYNAMIC it would be useful > to push the option back out, so that they can use that to substitute a static > version > of the library using %:replace-outfile(-lx libx+.a%s) [ see darwin.h > for >

Re: [patch][middle-end/PR102359]Not add initialization for DECL_VALUE_EXPR variables with -ftrivial-auto-var-init

2021-10-05 Thread Richard Biener via Gcc-patches
On Tue, 5 Oct 2021, Qing Zhao wrote: > Hi, > > This is the patch to fix this issue based on our discussion. > > I have tested it on aarch64 with bootstrap and regtests. X86 bootstrap was > done, regtests is ongoing. > > Okay for trunk? > > Thanks. > > Qing > > == > From

[Ada] Improve error message on missing all/for in quantified expression

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
When "for" or "some" keyword is missing from a quantified expression, it is interpreted as an iterated component association by GNAT, leading to misleading error messages such as: badquant.ads:4:07: error: expected type "Standard.Boolean" badquant.ads:4:07: error: found a composite type Recognize

[Ada] Proof of Ada.Strings.Maps

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Nearly complete functional specification of this unit based on the Ada RM requirements in Ada RM A.4.2. The small differences are noted in comments. Also add comments from the Ada RM text. GNATprove proves both absence of runtime errors and that the code correctly implements the specified contrac

[Ada] Proof of Ada.Characters.Handling

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Complete functional specification of this unit based on the Ada RM requirements in Ada RM A.3.2. This includes also obsolete subprograms moved to Ada.Characters.Conversions in Ada 2005. GNATprove proves both absence of runtime errors and that the code correctly implements the specified contracts.

[Ada] Improve message on missing all/for in pre-Ada-2022 modes

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
A previous change improves an error message to "missing ALL or SOME in quantified expression", but this was effective only -gnat2022 mode. This change allows the better error message to be printed in older language modes. It also treats the relevant features identically, except for the "...is an A

[Ada] Disable contract cases on formal containers

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Just like postconditions, contract cases on formal containers use functional containers which might leak memory. Disable them. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cfdlli.ads: Use pragma Assertion_Policy to disable contract cases at execution.

[Ada] Add Default_Initial_Condition to type Unbounded_String

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
SPARK emitted spurious checks on Unbounded_String variables that were not initialized. This patch adds a default initial condition to the type Unbounded_String so that they disappear. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-strunb.ads, libgnat/a-strunb__sha

[Ada] Propagate Ghost status from parent to derived subprograms

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
When creating the entity of a derived subprogram we copy all kinds of properties from the parent, but we failed to copy the ghost status of the entity. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Derive_Subprogram): Copy ghost status from parent to d

[Ada] Rewrite operator entity in derived class-wide expressions

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
When building a derived class-wide pre- or postcondition we are mapping references to inherited formals and to the inherited subprogram itself. We now do the same for references to the inherited operator. Such references might appear as prefixes of the Result attribute, e.g. "="'Result. Tested on

[Ada] Front-end support for Storage_Model feature

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
This set of changes implements the GNAT front end's support for the new aspects Storage_Model_Type and Designated_Storage_Model. It also defines a set of functions intended to provide an interface for back ends to call to retrieve operations and other entities associated with types that specify the

[Ada] Improve error message on array aggregates

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Contrary to record aggregates, array aggregate cannot mix named and positional associations. Make it clear in the error message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Improve error message.diff --git a/gcc/ada/sem_aggr.adb b/

[Ada] Add missing functions to Wide_Wide_Characters Handling

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
See RM A.3.6 and AI12-0260. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-zchhan.ads, libgnat/a-zchhan.adb (Character_Set_Version, Is_Basic, To_Basic): New. * libgnat/a-zchuni.ads, libgnat/a-zchuni.adb (Is_Basic, To_Basic): New.diff --git

[Ada] Add sys/time.h #include for QNX

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
As part of an improvement to the precision of Ada.Directories.Modification_Time, we use the type `struct timespec` when we can (if _POSIX_C_SOURCE is greater than 200809L). For QNX, we need to include the system header `sys/time.h` to get the type declaration, `time.h` does not have it. Tested on

[Ada] Remove left-overs of Unaligned_Valid attribute

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
The support for the attribute itself was removed a long time ago. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_attr.adb (Expand_Fpt_Attribute): Likewise. * snames.ads-tmpl (Name_Unaligned_Valid): Delete.diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb

[Ada] Include errno.h in QNX specific part of the signal handling

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
To get access to the errno variable, we need to include errno.h. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * init.c (QNX): Add #include errno.h.diff --git a/gcc/ada/init.c b/gcc/ada/init.c --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -2551,6 +2551,7 @@ __gnat_install_han

[Ada] Mark private component renaming as coming from source

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
This marks the local renaming generated for private components of protected types as coming from source, so that the components are displayed when the 'info locals' command is used in GDB. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch9.adb (Install_Private_Data_Decl

[Ada] introduce stack scrub (strub) feature

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
This is the GNAT part of the patch that adds the strub attribute for function and variable types, command-line options, passes and adjustments to implement it, documentation, and tests. Besides documentation, the bulk of the patch adds strub(callable) to subprograms that the compiler may call impl

[Ada] Fix latent bug in set_end_locus_from_node

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Avoid calling End_Label on the Empty node. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/trans.c (set_end_locus_from_node): Check that Handled_Statement_Sequence is not Empty before calling End_Label, because the Empty node has no End_Label, a

[Ada] Add case to consider ENODEV a "file not found error"

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Starting with VxWorks 21.03, a call to fopen() can now set errno to ENODEV if a prefix of the path does not match any known device. This led the runtime to raise the wrong exception type when trying to a file for which the parent directory did not exist and caused the acats testsuite to fail. This

[Ada] Do not unconditionally inline expression functions with -gnatd.8

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
This is necessary when expression functions are really too large. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/trans.c (Subprogram_Body_to_gnu): Do not set the DECL_DISREGARD_INLINE_LIMITS flag if -gnatd.8 is specified.diff --git a/gcc/ada/gcc-interf

Re: [PATCH] middle-end/102587 - avoid auto-init for VLA vectors

2021-10-05 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Mon, 4 Oct 2021, Qing Zhao wrote: > >> >> >> > On Oct 4, 2021, at 12:19 PM, Richard Biener wrote: >> > >> > On October 4, 2021 7:00:10 PM GMT+02:00, Qing Zhao >> > wrote: >> >> I have several questions on this fix: >> >> >> >> 1. This fix avoided

[PATCH] c++: Implement C++23 P2334R1 - #elifdef/#elifndef

2021-10-05 Thread Jakub Jelinek via Gcc-patches
Hi! This patch implements C++23 P2334R1, which is easy because Joseph has done all the hard work for C2X already. Unlike the C N2645 paper, the C++ P2334R1 contains one important addition (but not in the normative text): "While this is a new preprocessor feature and cannot be treated as a defect r

Re: [PATCH] middle-end/102587 - avoid auto-init for VLA vectors

2021-10-05 Thread Richard Biener via Gcc-patches
On Tue, 5 Oct 2021, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > On Mon, 4 Oct 2021, Qing Zhao wrote: > > > >> > >> > >> > On Oct 4, 2021, at 12:19 PM, Richard Biener wrote: > >> > > >> > On October 4, 2021 7:00:10 PM GMT+02:00, Qing Zhao > >> > wrote: > >> >> I hav

[Ada] Forbids use of Compile_Time_(Error|Warning) as configuration pragma

2021-10-05 Thread Pierre-Marie de Rodat via Gcc-patches
Before this commit, in case these pragmas were used inside adc file, gnat1 would fail with a `constraint_error` as it tries to get the context of the pragma. This commit induces a regression on dubious uses of these pragmas as configuration pragmas in ads/adb files. Review documentation on config

[committed] libstdc++: Update __cpp_lib_adaptor_iterator_pair_constructor value

2021-10-05 Thread Jonathan Wakely via Gcc-patches
On 01/10/21 20:43 +0100, Jonathan Wakely wrote: This adds a feature that was recently added to the C++23 working draft. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_queue.h (__cpp_lib_adaptor_iterator_pair_constructor): Define for C++23, as

[committed] libstdc++: Support printing volatile pointers (P1147R1)

2021-10-05 Thread Jonathan Wakely via Gcc-patches
To avoid needing to export a new symbol from the library (for now) the new member function uses __attribute__((always_inline)). libstdc++-v3/ChangeLog: * include/std/ostream (operator<<(const volatile void*)): Add new overload, as per P1147R1. * testsuite/27_io/basic_ostre

[committed] libstdc++: Add noexcept to some std::function internals

2021-10-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/std_function.h (_Any_data::_M_access): Add noexcept. (_Function_base::_Base_manager::_M_get_pointer): Likewise. (_Function_base::_Base_manager::_M_not_empty_function): Likewise. Tested powerpc64le-linux. Committed to t

[committed] libstdc++: Fix testcase for newly-implemented C++20 semantics [PR102535]

2021-10-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: PR c++/102535 * testsuite/20_util/is_trivially_constructible/value.cc: Adjust expected value for C++20. Tested powerpc64le-linux. Committed to trunk. commit 7646847df71e57edca5ec5b8c3c3dc4550dcb49d Author: Jonathan Wakely Date: Tue Oct 5 09:32:1

Re: [committed] libstdc++: Support printing volatile pointers (P1147R1)

2021-10-05 Thread Daniel Krügler via Gcc-patches
Am Di., 5. Okt. 2021 um 10:55 Uhr schrieb Jonathan Wakely via Libstdc++ : > > To avoid needing to export a new symbol from the library (for now) the > new member function uses __attribute__((always_inline)). > > libstdc++-v3/ChangeLog: > > * include/std/ostream (operator<<(const volatile vo

Re: [PATCH] gcov: make profile merging smarter

2021-10-05 Thread Richard Biener via Gcc-patches
On Mon, Oct 4, 2021 at 1:32 PM Martin Liška wrote: > > On 10/4/21 13:16, Richard Biener wrote: > > I meant in merge_one_data do not check ->stamp or ->checksum but instead > > rely > > on the counter merging code to detect mismatches (there's read_mismatch and > > read_error). There's multiple t

Re: [PATCH] Improve integer bit test on atomic builtin return

2021-10-05 Thread Richard Biener via Gcc-patches
On Mon, 4 Oct 2021, H.J. Lu wrote: > commit adedd5c173388ae505470df152b9cb3947339566 > Author: Jakub Jelinek > Date: Tue May 3 13:37:25 2016 +0200 > > re PR target/49244 (__sync or __atomic builtins will not emit 'lock > bts/btr/btc') > > optimized bit test on atomic builtin return with

[PATCH] Amend function names with UID when dumping with TDF_UID

2021-10-05 Thread Richard Biener via Gcc-patches
The following makes sure to amend more function names with the associated DECL_UID when dumping with TDF_UID, in particular function names printed as part of calls and in the function header. That allows one to more easily follow the call flow of PR102528 where coroutines cause three clones of the

[Aarch64] Do not define DONT_USE_BUILTIN_SETJMP

2021-10-05 Thread Eric Botcazou via Gcc-patches
Hi, we have been using an Ada compiler for the Aarch64 architecture configured with SJLJ exceptions as for the other architectures for some time, and have not run into any problems up to now so the setting looks obsolete. OK for the mainline? 2021-10-05 Eric Botcazou * config/aarc

[PATCH] Make flow of option processing more readily visible

2021-10-05 Thread Richard Biener via Gcc-patches
This moves calls to various option processing stages to one place, toplev::main. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu. 2021-10-05 Richard Biener * toplev.c (no_backend): Remove global var. (process_options): Pass in no_backend, move post_options la

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Richard Biener via Gcc-patches
On Mon, Oct 4, 2021 at 6:29 PM Michael Matz wrote: > > Hello, > > On Mon, 4 Oct 2021, Jeff Law wrote: > > > And just in case it got lost. Here's the analysis on 960218-1 on visium: > > > > We've got this going into ethread: > > > > int f (int x) > > { > > int D.1420; > > int a; > > > > ;; b

Re: [PATCH RFA] vec: Fix --enable-gather-detailed-mem-stats

2021-10-05 Thread Richard Biener via Gcc-patches
On Mon, Oct 4, 2021 at 8:28 PM Jason Merrill via Gcc-patches wrote: > > When r12-4038 introduced the global auto_vec save_opt_decoded_options, > it broke compilers configured with --enable-gather-detailed-mem-stats, > due to the memory descriptors getting discarded before the auto_vec was > destro

Re: [PATCH RFA] vec: Fix --enable-gather-detailed-mem-stats

2021-10-05 Thread Richard Biener via Gcc-patches
On Tue, Oct 5, 2021 at 1:27 PM Richard Biener wrote: > > On Mon, Oct 4, 2021 at 8:28 PM Jason Merrill via Gcc-patches > wrote: > > > > When r12-4038 introduced the global auto_vec save_opt_decoded_options, > > it broke compilers configured with --enable-gather-detailed-mem-stats, > > due to the m

Re: [gimple-isel] Remove redundant if condition

2021-10-05 Thread Richard Biener via Gcc-patches
On Tue, Oct 5, 2021 at 9:11 AM Prathamesh Kulkarni via Gcc-patches wrote: > > Hi, > In gimple_expand_vec_cond_expr: > > icode = get_vcond_icode (mode, cmp_op_mode, unsignedp); > if (icode == CODE_FOR_nothing) > { > if (tcode == LT_EXPR > && op0a == op0) > { >

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

2021-10-05 Thread Richard Biener via Gcc-patches
On Mon, Oct 4, 2021 at 1:13 PM Martin Liška wrote: > > On 9/22/21 11:59, Richard Biener wrote: > > On Thu, Sep 16, 2021 at 3:12 PM Martin Liška wrote: > >> > >> This patch comes up with asm_out_state and a new global variable casm. > >> > >> Tested on all cross compilers. > >> Patch can bootstrap

[committed] gfortran.dg/gomp/pr43711.f90: Change dg-* for XFAIL->PASS

2021-10-05 Thread Tobias Burnus
Adapt testcase to better catch the current message and expected follow-up messages + use the proper dg-*. — Result: XFAIL changed to PASS. Committed as r12-4185. Probably some other testcases could be checked as well. Maybe we also find some real & unfixed bugs that way. Tobias ---

[PATCH] c++: Implement C++23 P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions

2021-10-05 Thread Jakub Jelinek via Gcc-patches
Hi! The following patch implements C++23 P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions. I think it is mostly straightforward, don't diagnose certain statements/declarations just because of their presence in constexpr/consteval functions, but (except for the non-lite

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Michael Matz via Gcc-patches
Hello, On Tue, 5 Oct 2021, Richard Biener wrote: > > First notice that this doesn't have an empty latch block to start with > > (in fact, there is no separate latch block at all), so the loop > > optimizers haven't been initialized for simple latches at this point. > > Still, I would say that

[PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
Hi All, This turns an inversion of the sign bit + arithmetic right shift into a comparison with 0. i.e. void fun1(int32_t *x, int n) { for (int i = 0; i < (n & -16); i++) x[i] = (-x[i]) >> 31; } now generates: .L3: ldr q0, [x0] cmgtv0.4s, v0.4s, #0 str

[PATCH] More consistently dump GIMPLE FE consumable stmts

2021-10-05 Thread Richard Biener via Gcc-patches
The following makes more stmts consumable with the GIMPLE FE when dumping with -gimple. In particular addresses in GIMPLE operand position require wrapping with _Literal. The TDF_ flag space is now exhausted and I've removed overlaps and re-ordered things as to how it is supposed to work. Bootst

[PATCH] Allow more kinds of invariant addresses in GIMPLE FE

2021-10-05 Thread Richard Biener via Gcc-patches
The gimple FE is too restrictive in what it accepts as literals, the following makes it also accept &a[10] for example. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2021-10-05 Richard Biener PR c/102605 gcc/c/ * gimple-parser.c (c_parser_gimple_post

RE: [PATCH 5/7]middle-end Convert bitclear + cmp #0 into cm

2021-10-05 Thread Tamar Christina via Gcc-patches
Hi All, Here's a new version of the patch handling both scalar and vector modes and non-uniform constant vectors. Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no regressions. In order to not break IVopts and CSE I have added a requirement for the scalar version to be

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 13:50, Tamar Christina via Gcc-patches wrote: Hi All, This turns an inversion of the sign bit + arithmetic right shift into a comparison with 0. i.e. void fun1(int32_t *x, int n) { for (int i = 0; i < (n & -16); i++) x[i] = (-x[i]) >> 31; } Notwithstanding that I

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 1:56 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > > > On 05/10/2021 13:50, Tamar

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Aldy Hernandez via Gcc-patches
On Mon, Oct 4, 2021 at 6:29 PM Michael Matz wrote: > > Hello, > > On Mon, 4 Oct 2021, Jeff Law wrote: > > > And just in case it got lost. Here's the analysis on 960218-1 on visium: > > > > We've got this going into ethread: > > > > int f (int x) > > { > > int D.1420; > > int a; > > > > ;; b

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 14:30, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Tuesday, October 5, 2021 1:56 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; rguent...@suse.de Subject: Re: [PATCH]middle-end convert negate + right shift into compare greater.

[PATCH] loop: Fix profile updates after unrolling [PR102385]

2021-10-05 Thread Richard Sandiford via Gcc-patches
In g:62acc72a957b5614 I'd stopped the unroller from using an epilogue loop in cases where the iteration count was known to be a multiple of the unroll factor. The epilogue and non-epilogue cases still shared this (preexisting) code to update the edge frequencies: basic_block exit_bb = single_pr

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 2:34 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > > > On 05/10/2021 14:30, Tamar Ch

Re: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Richard Earnshaw via Gcc-patches
On 05/10/2021 14:49, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Tuesday, October 5, 2021 2:34 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; rguent...@suse.de Subject: Re: [PATCH]middle-end convert negate + right shift into compare greater. On

RE: [PATCH]middle-end convert negate + right shift into compare greater.

2021-10-05 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Earnshaw > Sent: Tuesday, October 5, 2021 2:52 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end convert negate + right shift into compare > greater. > > > > On 05/10/2021 14:49, Tamar

Re: [patch][middle-end/PR102359]Not add initialization for DECL_VALUE_EXPR variables with -ftrivial-auto-var-init

2021-10-05 Thread Qing Zhao via Gcc-patches
> On Oct 5, 2021, at 3:19 AM, Richard Biener wrote: > > On Tue, 5 Oct 2021, Qing Zhao wrote: > >> Hi, >> >> This is the patch to fix this issue based on our discussion. >> >> I have tested it on aarch64 with bootstrap and regtests. X86 bootstrap was >> done, regtests is ongoing. >> >> Oka

[PATCH] Fix check C99 TR1 support

2021-10-05 Thread Petr Mikhalicin
From: Petr Mikhalicin Autotools tests for libstdc++ check only declaration of required symbols, but some symbols may not be defined. This patch adds trying to link "C99 TR1" tests, not only compile them. Signed-off-by: Petr Mikhalicin --- libstdc++-v3/acinclude.m4 | 16 1 fil

PING: [AVR] Fix unused argument warning

2021-10-05 Thread Jan-Benedict Glaw
Hi, On Thu, 2021-09-30 21:27:23 +0200, Jan-Benedict Glaw wrote: > gcc/ChangeLog: > > * common/config/avr/avr-common.c (avr_handle_option): Mark > argument as ATTRIBUTE_UNUSED. > > diff --git a/gcc/common/config/avr/avr-common.c > b/gcc/common/config/avr/avr-common.c > index 6486659

PING: [LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning

2021-10-05 Thread Jan-Benedict Glaw
Hi, On Thu, 2021-09-30 21:34:51 +0200, Jan-Benedict Glaw wrote: > gcc/ChangeLog: > > * config/lm32/uclinux-elf.h (LINK_GCC_C_SEQUENCE_SPEC): > Undefine before redefinition. > > diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h > index 370df4c55dd..5b638fa5db

Re: PING: [AVR] Fix unused argument warning

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 8:46 AM, Jan-Benedict Glaw wrote: Hi, On Thu, 2021-09-30 21:27:23 +0200, Jan-Benedict Glaw wrote: gcc/ChangeLog: * common/config/avr/avr-common.c (avr_handle_option): Mark argument as ATTRIBUTE_UNUSED. diff --git a/gcc/common/config/avr/avr-common.c b/gcc/com

Re: PING: [LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 8:46 AM, Jan-Benedict Glaw wrote: Hi, On Thu, 2021-09-30 21:34:51 +0200, Jan-Benedict Glaw wrote: gcc/ChangeLog: * config/lm32/uclinux-elf.h (LINK_GCC_C_SEQUENCE_SPEC): Undefine before redefinition. diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 5:22 AM, Richard Biener wrote: On Mon, Oct 4, 2021 at 6:29 PM Michael Matz wrote: Hello, On Mon, 4 Oct 2021, Jeff Law wrote: And just in case it got lost. Here's the analysis on 960218-1 on visium: We've got this going into ethread: int f (int x) { int D.1420; int a;

[committed] libstdc++: Simplify constraints for std::any construction

2021-10-05 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/utility.h (__is_in_place_type_v): Define variable template to detect in_place_type_t specializations. (__is_in_place_type): Replace class template with alias template using __is_in_place_type_v. * include/std/any (any(T

[committed] libstdc++: Add test for std::cmp_greater

2021-10-05 Thread Jonathan Wakely via Gcc-patches
This was omitted from the commit that added these comparisons. libstdc++-v3/ChangeLog: * testsuite/20_util/integer_comparisons/greater.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit 824e0855732c601e0866d0e8a9264a85f758213e Author: Jonathan Wakely Date: Tue Oct 5 1

Re: [PATCH] libiberty: prevent buffer overflow when decoding user input

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/4/2021 10:52 AM, Luís Ferreira wrote: On Thu, 2021-09-23 at 09:50 -0600, Jeff Law wrote: On 9/23/2021 4:16 AM, ibuclaw--- via Gcc-patches wrote: On 22/09/2021 03:10 Luís Ferreira wrote: Currently a stack/heap overflow may happen if a crafted mangle is maliciously used to cause

Re: PING: [AVR] Fix unused argument warning

2021-10-05 Thread Jan-Benedict Glaw
Hi Jeff, On Tue, 2021-10-05 08:53:00 -0600, Jeff Law wrote: > On 10/5/2021 8:46 AM, Jan-Benedict Glaw wrote: > > On Thu, 2021-09-30 21:27:23 +0200, Jan-Benedict Glaw > > wrote: > > > gcc/ChangeLog: > > > > > > * common/config/avr/avr-common.c (avr_handle_option): Mark > > > argument as ATT

Re: PING: [AVR] Fix unused argument warning

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 9:03 AM, Jan-Benedict Glaw wrote: Hi Jeff, On Tue, 2021-10-05 08:53:00 -0600, Jeff Law wrote: On 10/5/2021 8:46 AM, Jan-Benedict Glaw wrote: On Thu, 2021-09-30 21:27:23 +0200, Jan-Benedict Glaw wrote: gcc/ChangeLog: * common/config/avr/avr-common.c (avr_handle_optio

Re: [committed] libstdc++: Support printing volatile pointers (P1147R1)

2021-10-05 Thread Jonathan Wakely via Gcc-patches
On Tue, 5 Oct 2021 at 10:29, Daniel Krügler wrote: > > Am Di., 5. Okt. 2021 um 10:55 Uhr schrieb Jonathan Wakely via > Libstdc++ : > > > > To avoid needing to export a new symbol from the library (for now) the > > new member function uses __attribute__((always_inline)). > > > > libstdc++-v3/ChangeL

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 7:33 AM, Aldy Hernandez wrote: On Mon, Oct 4, 2021 at 6:29 PM Michael Matz wrote: Hello, On Mon, 4 Oct 2021, Jeff Law wrote: And just in case it got lost. Here's the analysis on 960218-1 on visium: We've got this going into ethread: int f (int x) { int D.1420; int a;

Re: [PATCH] c++: Implement C++23 P2334R1 - #elifdef/#elifndef

2021-10-05 Thread Marek Polacek via Gcc-patches
On Tue, Oct 05, 2021 at 10:35:12AM +0200, Jakub Jelinek wrote: > Hi! > > This patch implements C++23 P2334R1, which is easy because Joseph has done > all the hard work for C2X already. > Unlike the C N2645 paper, the C++ P2334R1 contains one important addition > (but not in the normative text): >

[committed] Fix s390 test to have pointer type for computed goto

2021-10-05 Thread Jeff Law via Gcc-patches
More minor fallout from Andrew's work. Committed to the trunk. Jeff commit f9e6f20f280daf74763cf3fe21f3c211d3d04620 Author: Jeff Law Date: Tue Oct 5 11:15:02 2021 -0400 Fix s390 test to have pointer type for computed goto gcc/testsuite * gcc.target/s390/pr80725.c: En

Re: [PATCH] middle-end/102587 - avoid auto-init for VLA vectors

2021-10-05 Thread Qing Zhao via Gcc-patches
> On Oct 5, 2021, at 1:25 AM, Richard Biener wrote: > > On Mon, 4 Oct 2021, Qing Zhao wrote: > >> >> >>> On Oct 4, 2021, at 12:19 PM, Richard Biener wrote: >>> >>> On October 4, 2021 7:00:10 PM GMT+02:00, Qing Zhao >>> wrote: I have several questions on this fix: 1. This

Re: [patch][middle-end/PR102359]Not add initialization for DECL_VALUE_EXPR variables with -ftrivial-auto-var-init

2021-10-05 Thread Qing Zhao via Gcc-patches
This is the updated patch, I will push it after done with testing. Let me know if you see any issue. Thanks. Qing. >From 1f07c20ecdc9a015369c8bb472ebbd3bcaabdf17 Mon Sep 17 00:00:00 2001 From: qing zhao Date: Tue, 5 Oct 2021 08:10:02 -0700 Subject: [PATCH] middle-

[committed] libstdc++: Ensure std::span and std::string_view are trivially copyable (P2251R1)

2021-10-05 Thread Jonathan Wakely via Gcc-patches
The recently approved P2251R1 paper requires these types to be trivially copyable. They always have been in libstdc++, but add tests to check it. libstdc++-v3/ChangeLog: * testsuite/21_strings/basic_string_view/requirements/trivially_copyable.cc: New test. * testsuite/23_

[i386] Fix couple of issues in large PIC model on x86-64/VxWorks

2021-10-05 Thread Eric Botcazou via Gcc-patches
Hi, the first issue is that the !gotoff_operand path of legitimize_pic_address in large PIC model does not make use of REG when it is available, which breaks for thunks because new pseudo-registers can no longer be created. And the second issue is that the system compiler (LLVM) generates @GOT

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Jeff Law via Gcc-patches
On 10/5/2021 7:33 AM, Aldy Hernandez wrote: OK? BTW Jeff, this fixes all the regressions you mention except: 1. pr68911.c The path not being threaded here is 7->10->11->12. It crosses loops multiple times, so I believe the restriction code is correct. 7, 10, 12 are in loop1. 11 is in loo

Re: *PING* [PATCH] libiberty: allow comments in option file

2021-10-05 Thread Hans-Peter Nilsson
On Sat, 25 Sep 2021, Hu Jialun wrote: > Hello, > > Sorry for bumping it again but I guess it was getting overlooked. > > I am very junior with mailing list open source contributions so please feel > free to point out if I have inadvertantly done something in an incorrect way. > > The archive of the

Re: [RFC] More jump threading restrictions in the presence of loops.

2021-10-05 Thread Aldy Hernandez via Gcc-patches
On Tue, Oct 5, 2021 at 6:08 PM Jeff Law wrote: > OK. I think there may still be some concern if the latch is marked as a > joiner.I think we should always reject those before the loop optimizers > run as the joiner's clone would introduce a second latch. I think that can > be handled in

Re: [PATCH] Improve integer bit test on atomic builtin return

2021-10-05 Thread H.J. Lu via Gcc-patches
On Tue, Oct 5, 2021 at 3:07 AM Richard Biener wrote: > > On Mon, 4 Oct 2021, H.J. Lu wrote: > > > commit adedd5c173388ae505470df152b9cb3947339566 > > Author: Jakub Jelinek > > Date: Tue May 3 13:37:25 2016 +0200 > > > > re PR target/49244 (__sync or __atomic builtins will not emit 'lock >

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

2021-10-05 Thread Andrew MacLeod via Gcc-patches
On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: Hello. The patch extends the loop unswitching pass so that gswitch statements are supported. The pass now uses ranger which marks switch edges that are known to be unreachable in a versioned loop. P

[PATCH] d-demangle: properly skip anonymous symbols

2021-10-05 Thread Luís Ferreira
This patch fixes a bug on the D demangler by parsing and skip anonymous symbols correctly, according the ABI specification. Furthermore, it also includes tests to cover anonymous symbols. The spec specifies [1] that a symbol name can be anonymous and multiple anonymous symbols are allowed. [1]: h

[wwwdocs] Update cxx-status with October 2021 WG21 plenary

2021-10-05 Thread Marek Polacek via Gcc-patches
Pushed. Jakub already added the feature test macros. commit 78f03a4a633950743a416f5b9e7f721db7892090 Author: Marek Polacek Date: Tue Oct 5 12:57:19 2021 -0400 cxx-status: Add papers from the October 2021 WG21 plenary diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-stat

Re: [PATCH] c++: Implement C++23 P2334R1 - #elifdef/#elifndef

2021-10-05 Thread Joseph Myers
On Tue, 5 Oct 2021, Jakub Jelinek via Gcc-patches wrote: > One is in the patch below, ignores that sentence and only implements it > for -std=c++23/-std=gnu++23 like it is only implemented for -std=c23. > Another option would be to implement it also in the older GNU modes but > not in the C/CXX mo

Re: [PATCH] libiberty: prevent buffer overflow when decoding user input

2021-10-05 Thread Luís Ferreira
On Tue, 2021-10-05 at 09:00 -0600, Jeff Law wrote: > > > On 10/4/2021 10:52 AM, Luís Ferreira wrote: > > On Thu, 2021-09-23 at 09:50 -0600, Jeff Law wrote: > > > > > > On 9/23/2021 4:16 AM, ibuclaw--- via Gcc-patches wrote: > > > > > On 22/09/2021 03:10 Luís Ferreira > > > > > wrote: > > > > >

Re: [PATCH] d-demangle: properly skip anonymous symbols

2021-10-05 Thread Luís Ferreira
On Tue, 2021-10-05 at 18:13 +0100, Luís Ferreira wrote: > This patch fixes a bug on the D demangler by parsing and skip > anonymous symbols > correctly, according the ABI specification. Furthermore, it also > includes tests > to cover anonymous symbols. > > The spec specifies [1] that a symbol nam

[PATCH] Transition nvptx backend to STORE_FLAG_VALUE = 1

2021-10-05 Thread Roger Sayle
This patch to the nvptx backend changes the backend's STORE_FLAG_VALUE from -1 to 1, by using BImode predicates and selp instructions, instead of set instructions (almost always followed by integer negation). Historically, it was reasonable (through rare) for backends to use -1 for representing t

Re: [PATCH] d-demangle: properly skip anonymous symbols

2021-10-05 Thread Luís Ferreira
On Tue, 2021-10-05 at 18:13 +0100, Luís Ferreira wrote: > This patch fixes a bug on the D demangler by parsing and skip anonymous > symbols > correctly, according the ABI specification. Furthermore, it also > includes tests > to cover anonymous symbols. > > The spec specifies [1] that a symbol nam

[Patch] Fortran: Fix deprecate warning with parameter

2021-10-05 Thread Tobias Burnus
Played around with the warning in the 'omp_lib' module (needs tweaking as for the current version, no warning is done). Turned out that already use omp_lib outputs a warning even when not used. That's fixed by the attached patch - even if the location is not perfect. OK for GCC 12 + GCC 11 bac

Re: [patch][middle-end/PR102359]Not add initialization for DECL_VALUE_EXPR variables with -ftrivial-auto-var-init

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/5/21 10:32, Qing Zhao wrote: On Oct 5, 2021, at 3:19 AM, Richard Biener wrote: On Tue, 5 Oct 2021, Qing Zhao wrote: Hi, This is the patch to fix this issue based on our discussion. I have tested it on aarch64 with bootstrap and regtests. X86 bootstrap was done, regtests is ongoing

[PATCH v3] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-10-05 Thread Raphael Moreira Zinsly via Gcc-patches
Without dwarf2 unwind tables available _Unwind_Backtrace() is not able to return the full backtrace. This patch adds a fallback function on powerpc to get the backtrace by doing a backchain, this code was originally at glibc. libgcc/ChangeLog: * config/rs6000/linux-unwind.h (struct rt_sig

Re: [PATCH RFA] vec: Fix --enable-gather-detailed-mem-stats

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/5/21 07:27, Richard Biener wrote: On Mon, Oct 4, 2021 at 8:28 PM Jason Merrill via Gcc-patches wrote: When r12-4038 introduced the global auto_vec save_opt_decoded_options, it broke compilers configured with --enable-gather-detailed-mem-stats, due to the memory descriptors getting discar

Re: [PATCH] c++: Fix apply_identity_attributes [PR102548]

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/5/21 03:50, Jakub Jelinek wrote: Hi! The following testcase ICEs on x86_64-linux with -m32 due to a bug in apply_identity_attributes. The function is being smart and attempts not to duplicate the chain unnecessarily, if either there are no attributes that affect type identity or there is

Re: [PATCH] c++: unifying equal NONTYPE_ARGUMENT_PACKs [PR102547]

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/1/21 13:29, Patrick Palka wrote: On Fri, 1 Oct 2021, Jason Merrill wrote: On 10/1/21 10:26, Patrick Palka wrote: On Fri, 1 Oct 2021, Jason Merrill wrote: On 10/1/21 09:46, Patrick Palka wrote: Here during partial ordering of the two partial specializations we end up in unify with parm

Re: [PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573]

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/1/21 16:14, Marek Polacek wrote: On Fri, Oct 01, 2021 at 09:30:41AM -0400, Jason Merrill wrote: On 9/30/21 17:56, Marek Polacek wrote: On Thu, Sep 30, 2021 at 03:34:24PM -0400, Jason Merrill wrote: On 9/30/21 10:50, Marek Polacek wrote: This patch addresses one of my leftovers from GCC

Re: [Patch] Fortran: Fix deprecate warning with parameter

2021-10-05 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 05.10.21 um 20:03 schrieb Tobias Burnus: Played around with the warning in the 'omp_lib' module (needs tweaking as for the current version, no warning is done). Turned out that already   use omp_lib outputs a warning even when not used. that must have been a non-trivial example;

Re: [PATCH] c++: odr-use argument to a function NTTP [PR53164]

2021-10-05 Thread Patrick Palka via Gcc-patches
On Mon, 4 Oct 2021, Patrick Palka wrote: > When passing a function template as the argument to a function NTTP > inside a template, we resolve it to the right specialization ahead of > time via resolve_address_of_overloaded_function, though the call to > mark_used within defers odr-using it until

Re: [PATCH] c++: Suppress error when cv-qualified reference is introduced by typedef [PR101783]

2021-10-05 Thread Jason Merrill via Gcc-patches
On 10/1/21 15:52, Nick Huang wrote: ...the subject line for the commit should be the first line of the commit message, followed by a blank line, followed by the description of the patch; without the subject line, git format-patch thought your whole description was the subject of the patch. oh,

[pushed] Darwin, D: Fix bootstrap when target does not support -Bstatic/dynamic.

2021-10-05 Thread Iain Sandoe via Gcc-patches
This fixes a bootstrap fail because saw_static_libcxx was unused for targets without support for -Bstatic/dynamic. The fix applied pushes the -static-libstdc++ back onto the command line, which allows a target to substitute a static version of the c++ standard library using specs. tested on x86_6

  1   2   >