Re: [PATCH] c++tools: Fix up c++tools for --with-gcc-major-version-only

2020-12-17 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 17, 2020 at 12:10:14AM +0100, Jakub Jelinek via Gcc-patches wrote: > The following patch should fix that, ok for trunk if it passes testing? Tested successfully with build both without and with --with-gcc-major-version-only and make install for both. > 2020-12-17 Jakub Jelinek > >

Re: [PATCH] PR fortran/98307 - Dependency check fails when using "allocatable"

2020-12-17 Thread Thomas Koenig via Gcc-patches
Hi Harald, OK for master? Since we generate wrong code under the given circumstances, what do people think about backports? OK for master. The patch is also simple enough that the risk of regressions is almost nil, so backports are also OK. Best regards Thomas

Re: [Patch] Fortran: Delay vtab generation until after parsing [PR92587]

2020-12-17 Thread Thomas Koenig via Gcc-patches
Hi Tobias, Calling gfc_find_vtab during resolution during parsing comes too early for finalizers. This patch just moves it to the resolution, which seems to be the simplest solution. Ah, finalizers - one area where we still are deficient WRT Fortran 2003. Thanks for doing things in this area!

Re: [Patch] Fortran: Delay vtab generation until after parsing [PR92587]

2020-12-17 Thread Tobias Burnus
Hi Thomas, hi all, On 17.12.20 10:02, Thomas Koenig via Fortran wrote: OK. Just one remark: Could you make the test into a run-time test to check that the finalizers are called correctly? Done – see attachment. Thanks for the quick review! Tobias - Mentor Graphics (Deutschla

Re: Add libcody

2020-12-17 Thread Andreas Schwab
On Dez 15 2020, Nathan Sidwell wrote: > diff --git c/libcody/fatal.cc w/libcody/fatal.cc > new file mode 100644 > index 000..b35094e6b19 > --- /dev/null > +++ w/libcody/fatal.cc > @@ -0,0 +1,78 @@ > +// CODYlib -*- mode:c++ -*- > +// Copyright (C) 2019-2020 Nathan Sidwell, nat...

Re: Add libcody

2020-12-17 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 17, 2020 at 11:01:40AM +0100, Andreas Schwab wrote: > On Dez 15 2020, Nathan Sidwell wrote: > > > diff --git c/libcody/fatal.cc w/libcody/fatal.cc > > new file mode 100644 > > index 000..b35094e6b19 > > --- /dev/null > > +++ w/libcody/fatal.cc > > @@ -0,0 +1,78 @@ > > +// CODYl

[PATCH] rtl-ssa: Include memmodel.h before tm_p.h

2020-12-17 Thread Rainer Orth
The RTL SSA merge broke SPARC bootstrap: In file included from ./tm_p.h:4, from /vol/gcc/src/hg/master/local/gcc/rtl-ssa.h:54, from /vol/gcc/src/hg/master/local/gcc/fwprop.c:29: /vol/gcc/src/hg/master/local/gcc/config/sparc/sparc-protos.h:45:47: error: use of enu

[COMMITTED] MAINTAINERS: Add myself for write after approval.

2020-12-17 Thread Marius Hillenbrand via Gcc-patches
ChangeLog: 2020-12-17 Marius Hillenbrand * MAINTAINERS (Write After Approval): Add myself. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 32f8a2b7292..48335cc7920 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -428,6 +428,7 @@ George

[Ada] Assert failure on b38105a in -gnat95 mode

2020-12-17 Thread Pierre-Marie de Rodat
A cascaded error leads to some confusion in this case, fixed by making Inherit_Predicate_Flags a no-op pre Ada 2012. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Inherit_Predicate_Flags): No-op before Ada 2012.diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_

[Ada] Spurious error on Type'Access and <>

2020-12-17 Thread Pierre-Marie de Rodat
When mixing the <> in an aggregrate and the default initialization of the Type involved by the box references Type'Access, GNAT may generate a spurious error of the form: "Access" attribute cannot be applied to type Fixed by only considering nodes that come from source in this legality check:

[Ada] Fixes for GNAT error/warning messages

2020-12-17 Thread Pierre-Marie de Rodat
These fixes aim at making GNAT messages more readable and uniform, just by following the current rules generally followed for messages: - start with a lowercase character - use ALL CAPITAL for keywords (so that they are properly quoted in the final message), Capitalized attribute/pragma names - u

[Ada] Compiler crash on protected component of controlled type

2020-12-17 Thread Pierre-Marie de Rodat
When declaring a component of a protected type as part of a controlled type, the compiler may crash trying to generate the finalize routine. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch7.adb (Make_Final_Call, Make_Init_Call): Take protected types into accou

[Ada] Spurious discriminant check on bounded synchronized queue

2020-12-17 Thread Pierre-Marie de Rodat
An improper run-time error is raised on a bounded synchronized queue when the container element is a discriminated type that is itself a bounded container. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbsyqu.ads (Implementation): Provide a box initializa

[Ada] Do not generate encodings for fixed-point types by default

2020-12-17 Thread Pierre-Marie de Rodat
This flips the default for the generation of encodings for fixed-point types in the debugging information generated by the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_dbug.adb (Get_Encoded_Name): Generate encodings for fixed point types only if -fgn

[Ada] Crash on discriminant check with current instance

2020-12-17 Thread Pierre-Marie de Rodat
This patch fixes an issue in the compiler whereby a reference to the current instance of the type occurring within a subtype contraint causes a crash during backend expansion of associated discriminant checks. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb (Build

[Ada] Do not use exponentiation for common bases in floating-point Value

2020-12-17 Thread Pierre-Marie de Rodat
This changes the implementation of the Value attribute for floating-point types not to use exponentiation to compute the final value, at least for the common bases 2, 4, 8, 10 and 16. The powers of two use the Scaling attribute instead, while a precomputed table of powers is used for 10. The first

[Ada] Move folding of unchecked conversions from expansion to evaluation

2020-12-17 Thread Pierre-Marie de Rodat
Discrete values in unchecked conversions were only folded when compiling. Now they are also folded in GNATprove and semantics checking modes (-gnatc). This is particularly important for calls to static functions, since unchecked conversions are likely to appear for their actual parameters or resu

[Ada] Consistent wording for missing -gnat2020 switch

2020-12-17 Thread Pierre-Marie de Rodat
Reuse Error_Msg_Ada_2020_Feature to complain about a missing -gnat2020 switch when code that would be legal in Ada 2020 is compiled in an earlier language version. Also, refer to language construct and not to syntactic category of the missing feature, i.e. "declare expression" and not "declare_exp

[Ada] Ada2020: AI12-0400 Ambiguities associated with Vector

2020-12-17 Thread Pierre-Marie de Rodat
...Append and container aggregates. This patch implements the above AI, except we do not yet remove the Append procedures that append vectors (for compatibility reasons). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbdlli.ads, lib

[Ada] Prevent In_Check_Node routine from going too far in the parent chain

2020-12-17 Thread Pierre-Marie de Rodat
Routines that examine the parent chain of a subexpression don't need to cross the subprogram or package boundaries and go until the very root of the compilation unit. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (In_Check_Node): Add guard and rename Node to

[Ada] Better diagnostic for new language features

2020-12-17 Thread Pierre-Marie de Rodat
Complain about missing -gnat20xx switches when the code would be accepted in a newer version of Ada rather than silently rejecting it. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * par-ch12.adb (P_Formal_Derived_Type_Definition): Complain about formal type with asp

[Ada] Prevent early exits without restoring a global variable

2020-12-17 Thread Pierre-Marie de Rodat
In Analyze_Case_Statement we save the current value of Unblocked_Exit_Count with the intention to restore it on exit. However, when returning early due to errors we failed to restore the previous value. It seems cleaner to only modify this variable after the possible early exits. Mainly just a cle

[Ada] Remove unused subprograms in validsw

2020-12-17 Thread Pierre-Marie de Rodat
Spotted by running GNATcoverage on GNAT sources, some subprograms are no longer used. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * checks.adb: Remove, not used. * checks.ads: Likewise. * exp_ch6.adb: Likewise. * exp_ch7.adb: Likewise. * ex

[Ada] Code cleanup: remove Old_Requires_Transient_Scope

2020-12-17 Thread Pierre-Marie de Rodat
This temporary code kept 3+ years ago can now be removed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (New_Requires_Transient_Scope): Renamed Requires_Transient_Scope. (Requires_Transient_Scope, Old_Requires_Transient_Scope, Results_D

[Ada] Remove unused files

2020-12-17 Thread Pierre-Marie de Rodat
Spotted by running GNATcoverage on GNAT sources, some files are no longer used. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * symbols.ads, symbols.adb: Removed no longer used.diff --git a/gcc/ada/symbols.adb /dev/null deleted file mode 100644 --- a/gcc/ada/symbols.adb +++

[Ada] Crash on if expression inside declare expression

2020-12-17 Thread Pierre-Marie de Rodat
Combining an N_Expression_With_Actions within another N_Expression_With_Actions is causing inconsistencies and leads to dropping some actions on the floor. Fixed by creating a transient scope for declare expressions when needed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Remove discriminant checks processing in gigi

2020-12-17 Thread Pierre-Marie de Rodat
There is a fallback code in gigi in case the front-end constructs trees referencing non existing record fields. At this stage, it's safer and cleaner to ensure that the front-end never generates such references, and eventually replace the code in gigi by a gcc_unreachable(). We are not quite there

[Ada] Performance of CW_Membership

2020-12-17 Thread Pierre-Marie de Rodat
CM_Membership is used implicitly by some tagged related constructs, and having it never inlined may cause performance issues, so move it to the spec by taking advantage of the recently added declare expressions. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-tags.

[Ada] Refine type of a multi unit index number

2020-12-17 Thread Pierre-Marie de Rodat
With multi unit naming scheme (e.g. "unit.1.ada" and "unit.2.ada" instead of "unit.ads" and "unit.adb") the Multiple_Unit_Index global variable keeps the current index number. It is only assigned by routines that return non-negative numbers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/a

Re: [Patch] Fortran: Delay vtab generation until after parsing [PR92587]

2020-12-17 Thread Thomas Koenig via Gcc-patches
Hi Tobias, Thanks for the quick review! It helps when I'm on holiday :-) Best regards Thomas

Re: [PATCH] avr: cc0 to mode_cc conversion

2020-12-17 Thread Segher Boessenkool
Hi! On Thu, Dec 17, 2020 at 02:15:51PM +0530, Senthil Kumar Selvaraj via Gcc-patches wrote: > The work on my github branch was not complete - I'd blindly followed > whatever the CC0 Transition wiki mentioned (the first three steps of > case #2), and fixed any regression fallout (for ATmega128). >

[PATCH] build: libcody: Link with -lsocket -lnsl if necessary [PR98316]

2020-12-17 Thread Rainer Orth
With the introduction of C++20 modules and libcody, cc1plus and cc1objplus gained a dependency on the socket functions. Before those were merged into libc in Solaris 11.4, one needed to link with -lsocket -lnsl on Solaris, so that merge broke the Solaris 11.3 build. While we already have 4 differ

Re: [PATCH] Correct -fdump-go-spec's handling of incomplete types

2020-12-17 Thread Rainer Orth
Hi Nikhil, >> I suspect what is happening here is that godump sees "typedef ucontext_t >> struct >> ucontext" and outputs the typedef immediately. Only later does it observe >> that >> "struct ucontext" is invalid. At that point it is too late to comment out the >> typedef for _ucontext_t. > > O

Re: [PATCH] Add simd testsuite

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 16/12/20 12:58 +0100, Matthias Kretz wrote: --- /dev/null +++ b/libstdc++-v3/scripts/check_simd @@ -0,0 +1,76 @@ +#!/bin/sh + +# check_simd +# Read config from $CHECK_SIMD_CONFIG file or $target_list + +scriptdir="$(cd "${0%/*}" && pwd)" The ${0%/*} substitution is required by POSIX sh si

Re: [PATCH] c++tools: Fix up c++tools for --with-gcc-major-version-only

2020-12-17 Thread Nathan Sidwell
On 12/16/20 6:10 PM, Jakub Jelinek wrote: Hi! Seems c++tools doesn't honor --with-gcc-major-version-only. Our distro uses that flag and so everything is installed in /usr/lib/gcc//11/... /usr/libexec/gcc//11/... except /usr/libexec/gcc//11.0.0/g++-mapper-server The following patch should fix th

Re: Add libcody

2020-12-17 Thread Nathan Sidwell
On 12/17/20 5:07 AM, Jakub Jelinek wrote: On Thu, Dec 17, 2020 at 11:01:40AM +0100, Andreas Schwab wrote: On Dez 15 2020, Nathan Sidwell wrote: diff --git c/libcody/fatal.cc w/libcody/fatal.cc new file mode 100644 index 000..b35094e6b19 --- /dev/null +++ w/libcody/fatal.cc @@ -0,0 +1,7

Re: [PATCH] build: libcody: Link with -lsocket -lnsl if necessary [PR98316]

2020-12-17 Thread Nathan Sidwell
On 12/17/20 7:21 AM, Rainer Orth wrote: With the introduction of C++20 modules and libcody, cc1plus and cc1objplus gained a dependency on the socket functions. Before those were merged into libc in Solaris 11.4, one needed to link with -lsocket -lnsl on Solaris, so that merge broke the Solaris 1

Re: Add libcody

2020-12-17 Thread Nathan Sidwell
On 12/17/20 8:25 AM, Nathan Sidwell wrote: On 12/17/20 5:07 AM, Jakub Jelinek wrote: On Thu, Dec 17, 2020 at 11:01:40AM +0100, Andreas Schwab wrote: /tmp/ccabCPZ7.s: Assembler messages: /tmp/ccabCPZ7.s:28: Error: Wrong number of input operands Yeah.  If it is meant as an optimization barrie

Re: Add libcody

2020-12-17 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 17, 2020 at 08:25:12AM -0500, Nathan Sidwell wrote: > > Yeah. If it is meant as an optimization barrier, shouldn't it be just > >__asm__ volatile (""); > > or > >__asm__ volatile ("" : : : "memory"); > > ? That said, shouldn't that be guarded on the compiler being GCC > > (or

RE: [PATCH] rtl-ssa: Include memmodel.h before tm_p.h

2020-12-17 Thread Kyrylo Tkachov via Gcc-patches
Hi Rainer, > -Original Message- > From: Gcc-patches On Behalf Of > Rainer Orth > Sent: 17 December 2020 10:36 > To: gcc-patches@gcc.gnu.org > Cc: Richard Sandiford > Subject: [PATCH] rtl-ssa: Include memmodel.h before tm_p.h > > The RTL SSA merge broke SPARC bootstrap: > > In file incl

[PATCH] vect, aarch64: Extend SVE vs Advanced SIMD costing decisions in vect_better_loop_vinfo_p

2020-12-17 Thread Kyrylo Tkachov via Gcc-patches
Hi all, While experimenting with some backend costs for Advanced SIMD and SVE I hit many cases where GCC would pick SVE for VLA auto-vectorisation even when the backend very clearly presented cheaper costs for Advanced SIMD. For a simple float addition loop the SVE costs were: vec.c:9:21: note:

Re: Add libcody

2020-12-17 Thread H.J. Lu via Gcc-patches
On Thu, Dec 17, 2020 at 5:36 AM Jakub Jelinek via Gcc-patches wrote: > > On Thu, Dec 17, 2020 at 08:25:12AM -0500, Nathan Sidwell wrote: > > > Yeah. If it is meant as an optimization barrier, shouldn't it be just > > >__asm__ volatile (""); > > > or > > >__asm__ volatile ("" : : : "memory

Re: [PATCH] rtl-ssa: Include memmodel.h before tm_p.h

2020-12-17 Thread Rainer Orth
Hi Kyryll, >> Fixed by moving the memmove.h include in rtl-ssa.h before tm_p.h. >> >> Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (both into stage >> 3 now, so the compilation error is gone). >> >> Ok for master? > > AFAIK simple patches like this that fix build/bootstrap are viewed

Re: [PATCH 4/1] c++: More precise tracking of potentially unstable satisfaction

2020-12-17 Thread Jason Merrill via Gcc-patches
On 12/16/20 6:24 PM, Patrick Palka wrote: On Wed, 16 Dec 2020, Jason Merrill wrote: On 12/14/20 3:29 PM, Patrick Palka wrote: On Mon, 14 Dec 2020, Jason Merrill wrote: On 12/14/20 1:07 PM, Patrick Palka wrote: This makes tracking of potentially unstable satisfaction results more precise by

RE: [PATCH][GCC] arm: Add support for Cortex-A78C

2020-12-17 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Przemyslaw Wirkus > Sent: 08 December 2020 14:05 > To: gcc-patches@gcc.gnu.org > Cc: ni...@redhat.com; Richard Earnshaw ; > Ramana Radhakrishnan ; Kyrylo > Tkachov > Subject: [PATCH][GCC] arm: Add support for Cortex-A78C > > This patch adds support for -mc

bootstrap: Fix some windows issues [PR 98300]

2020-12-17 Thread Nathan Sidwell
this addresses the first tranch of windows build problems, pushing to trunk. When breaking out the sample server from the gcc/cp directory, it lost its check for mmap, and the sample resolver just assumed it was there. Fixed thusly. The non-mapping paths in module.cc weren't (recently) excercise

Re: [PATCH] rtl-ssa: Include memmodel.h before tm_p.h

2020-12-17 Thread Richard Sandiford via Gcc-patches
Rainer Orth writes: > Hi Kyryll, > >>> Fixed by moving the memmove.h include in rtl-ssa.h before tm_p.h. >>> >>> Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (both into stage >>> 3 now, so the compilation error is gone). >>> >>> Ok for master? >> >> AFAIK simple patches like this that

Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 16/12/20 13:38 +, Jonathan Wakely wrote: This fixes a bug caused by a mismatch between the macros defined by when GCC is built and the macros defined by when users include . If the user code is compiled with _XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the ENOTRECOVERABLE and E

Re: [PATCH] libstdc++: Add support for C++20 barriers

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 27/11/20 17:46 +, Jonathan Wakely wrote: On 20/11/20 16:30 -0800, Thomas Rodgers wrote: From: Thomas Rodgers Should include all discussion on and off list to date. Most of the comments in https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558090.html still apply to this version.

[committed] libstdc++: Fix preprocessor condition [PR 98344]

2020-12-17 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: PR libstdc++/98344 * include/bits/semaphore_base.h: Fix preprocessor condition. Tested powerpc64le-linux. Committed to trunk. commit 8dc63f13f03facc49b777195c9068432477b5dcd Author: Jonathan Wakely Date: Thu Dec 17 12:09:20 2020 libstdc++: Fix prep

bootstrap: Don't use strsignal [PR 98300]

2020-12-17 Thread Nathan Sidwell
Sadly strsignal is nonportable, so signal numbers it is then. c++tools/ * server.cc (crash_signal): Don't use strsignal. pushing to trunk -- Nathan Sidwell diff --git i/c++tools/server.cc w/c++tools/server.cc index 6457dc5b878..8514ef6293b 100644 --- i/c++tools/server.cc +++ w/c

[committed] libstdc++: Fix -Wunused warning

2020-12-17 Thread Jonathan Wakely via Gcc-patches
As noted in PR 66146 comment 35, there is a new warning in the new std::call_once implementation. libstdc++-v3/ChangeLog: * src/c++11/mutex.cc (std::once_flag::_M_finish): Add maybe_unused attribute to variable used in assertion. Tested powerpc64le-linux. Committed to trunk. com

Re: [PATCH] vect, aarch64: Extend SVE vs Advanced SIMD costing decisions in vect_better_loop_vinfo_p

2020-12-17 Thread Richard Sandiford via Gcc-patches
Kyrylo Tkachov via Gcc-patches writes: > Hi all, > > While experimenting with some backend costs for Advanced SIMD and SVE I hit > many cases where GCC would pick SVE for VLA auto-vectorisation even when the > backend very clearly presented cheaper costs for Advanced SIMD. > For a simple float add

Re: [07/23] Add a class that multiplexes two pointer types

2020-12-17 Thread Tom Tromey
> "Richard" == Richard Sandiford via Gcc-patches > writes: Richard> +// A class that stores a choice "A or B", where A has type T1 * and B has Richard> +// type T2 *. Both T1 and T2 must have an alignment greater than 1, since Richard> +// the low bit is used to identify B over A. T1

libcody: Allow PIC [PR 98324]

2020-12-17 Thread Nathan Sidwell
While this doesn't fix 98324, it was an omission. Cribbed code from libcpp to build libcody as PIC. libcody/ * configure.ac: Add --enable-host-shared. * Makefile.in: Add FLAGPIC. * configure: Regenerated. pushing to trunk -- Nathan Sidwell diff --git i/libcody/M

Re: [PATCH 3/4] libstdc++: Add floating-point std::to_chars implementation

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 19/08/20 17:57 -0400, Patrick Palka via Libstdc++ wrote: On Wed, 22 Jul 2020, Patrick Palka wrote: On Mon, 20 Jul 2020, Patrick Palka wrote: > On Mon, 20 Jul 2020, Jonathan Wakely wrote: > > > On 20/07/20 08:53 -0400, Patrick Palka via Libstdc++ wrote: > > > On Mon, 20 Jul 2020, Jonathan Wa

Re: [PATCH 1/4] libstdc++: Import parts of the Ryu library

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 14/07/20 15:41 -0400, Patrick Palka via Libstdc++ wrote: This imports the source files from the Ryu library that define d2s_buffered_n, f2s_buffered_n, d2fixed_buffered_n and d2exp_buffered_n and generic_binary_to_decimal, which we're going to need as part of our std::to_chars implementation.

Re: [PATCH 2/4] libstdc++: Apply modifications to our local copy of Ryu

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 15/07/20 14:12 -0400, Patrick Palka via Libstdc++ wrote: On Tue, 14 Jul 2020, Patrick Palka wrote: This performs the following modifications to our local copy of Ryu in order to make it more easily usable for our std::to_chars implementation: * Remove all #includes * Remove copy_special

Re: [PATCH 4/4] libstdc++: Import MSVC floating-point std::to_chars testcases

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 14/07/20 15:41 -0400, Patrick Palka via Libstdc++ wrote: libstdc++-v3/ChangeLog: * testsuite/20_util/to_chars/double.cc: New test, consisting of testcases imported from the MSVC STL testsuite. * testsuite/20_util/to_chars/float.cc: Likewise. OK, thanks.

[PATCH] [PR tree-optimization/97750] Fix trap in pointer conversion in op1_range.

2020-12-17 Thread Andrew MacLeod via Gcc-patches
operator_cast::op1_range() does some masking and calculations when a higher precision value is cast to a lower precision one. ie,  it fills in the ranges for the upper bits and trys to produce more usable results for the wind-back process.  Part of that calculation involved using PLUS_EXPR to th

[PATCH] store-merging: Handle vector CONSTRUCTORs using bswap [PR96239]

2020-12-17 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 16, 2020 at 09:29:31AM +0100, Richard Biener wrote: > I think it probably makes sense to have some helper split out that > collects & classifies vector constructor components we can use from > both forwprop (where matching the V_C_E from integer could be done > as well IMHO) and bswap (

[PATCH] simplify-rtx: Optimize (x - 1) * y + y [PR98334]

2020-12-17 Thread Jakub Jelinek via Gcc-patches
Hi! We don't try to optimize for signed x, y (int) (x - 1U) * y + y into x * y, we can't do that with signed x * y, because the former is well defined for INT_MIN and -1, while the latter is not. We could perhaps optimize it during isel or some very late optimization where we'd turn magically flag

[PATCH] arm: Fix bootstrap

2020-12-17 Thread Andrea Corallo via Gcc-patches
Hi all, I'd like to submit the following simple patch to fix bootstrap on arm. Apparently 'cff6dac28a0 arm: Replace calls to __builtin_vcreate* in arm_neon.h [PR66791]' forgot to remove one call to '__builtin_neon_vcreatedi'. Bootstraped arm-linux-gnu, regression ongoing. Okay for trunk? Than

RE: [PATCH] arm: Fix bootstrap

2020-12-17 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Andrea Corallo > Sent: 17 December 2020 14:56 > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ; Richard Earnshaw > ; nd ; Prathamesh Kulkarni > > Subject: [PATCH] arm: Fix bootstrap > > Hi all, > > I'd like to submit the following simple patch to fix b

[PATCH] c++: Fix PCH ICE with __builtin_source_location [PR98343]

2020-12-17 Thread Jakub Jelinek via Gcc-patches
Hi! Seems the ggc_remove ppc_nx 3 operand member relies on the hash tables to contain pointers in the first element, which is not the case for source_location_table* hash table, which has location_t and unsigned as first two members and pointer somewhere else. I've tried to change: static void

Re: [PATCH] avr: cc0 to mode_cc conversion

2020-12-17 Thread Paul Koning via Gcc-patches
> On Dec 17, 2020, at 6:21 AM, Segher Boessenkool > wrote: > > Hi! > > On Thu, Dec 17, 2020 at 02:15:51PM +0530, Senthil Kumar Selvaraj via > Gcc-patches wrote: >> The work on my github branch was not complete - I'd blindly followed >> whatever the CC0 Transition wiki mentioned (the first t

Re: bootstrap: Don't use strsignal [PR 98300]

2020-12-17 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 17, 2020 at 09:06:57AM -0500, Nathan Sidwell wrote: > > Sadly strsignal is nonportable, so signal numbers it is then. > > c++tools/ > * server.cc (crash_signal): Don't use strsignal. Strange. It is portable, we even have a fallback implementation for it in libibe

Re: [PATCH] arm: Fix bootstrap

2020-12-17 Thread Andrea Corallo via Gcc-patches
Kyrylo Tkachov writes: >> -Original Message- >> From: Andrea Corallo >> Sent: 17 December 2020 14:56 >> To: gcc-patches@gcc.gnu.org >> Cc: Kyrylo Tkachov ; Richard Earnshaw >> ; nd ; Prathamesh Kulkarni >> >> Subject: [PATCH] arm: Fix bootstrap >> >> Hi all, >> >> I'd like to submit t

Re: [07/23] Add a class that multiplexes two pointer types

2020-12-17 Thread Richard Sandiford via Gcc-patches
Tom Tromey writes: >> "Richard" == Richard Sandiford via Gcc-patches >> writes: > > Richard> +// A class that stores a choice "A or B", where A has type T1 * and > B has > Richard> +// type T2 *. Both T1 and T2 must have an alignment greater than > 1, since > Richard> +// the low bit

Re: [07/23] Add a class that multiplexes two pointer types

2020-12-17 Thread Nathan Sidwell
On 12/17/20 10:38 AM, Richard Sandiford via Gcc-patches wrote: Tom Tromey writes: "Richard" == Richard Sandiford via Gcc-patches writes: Richard> +// A class that stores a choice "A or B", where A has type T1 * and B has Richard> +// type T2 *. Both T1 and T2 must have an alignment greater

Re: [PATCH 3/3] Support the PGO build for binutils+gdb

2020-12-17 Thread Matthias Klose
On 10/29/20 8:11 PM, H.J. Lu via Binutils wrote: > diff --git a/Makefile.tpl b/Makefile.tpl > index a280a1498c..38f0b021f4 100644 > --- a/Makefile.tpl > +++ b/Makefile.tpl > +@if pgo-build > + && $(MAKE) $(RECURSE_FLAGS_TO_PASS) \ shouldn't make called with -i here? you're not interested lett

[committed] libstdc++: Fix condition for gthreads-timed effective-target

2020-12-17 Thread Jonathan Wakely via Gcc-patches
The refactoring in r11-5500 altered the condition for the gthreads-timed test from #if to #ifdef. For some reason that macro is always defined, rather than being defined to 1 or undefined like most of our autoconf macros. That means the test always passes now, even for targets where the macro is de

Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]

2020-12-17 Thread Jonathan Wakely via Gcc-patches
On 17/12/20 14:05 +, Jonathan Wakely wrote: On 16/12/20 13:38 +, Jonathan Wakely wrote: This fixes a bug caused by a mismatch between the macros defined by when GCC is built and the macros defined by when users include . If the user code is compiled with _XOPEN_SOURCE defined to 500 or

Re: [PATCH] Correct -fdump-go-spec's handling of incomplete types

2020-12-17 Thread Nikhil Benesch via Gcc-patches
On 12/17/20 7:28 AM, Rainer Orth wrote: I first tried with the new version included, but that broke badly: cc1 -fpreprocessed sysinfo.i -quiet -O -std=gnu99 -fdump-go-spec=tmp-gen-sysinfo.go -o sysinfo.s now SEGVs with either infinite or very deep recursion: Thread 2 received signal SIGSEGV,

Re: [PATCH] arm: Fix bootstrap

2020-12-17 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 17 Dec 2020 at 21:04, Andrea Corallo wrote: > > Kyrylo Tkachov writes: > > >> -Original Message- > >> From: Andrea Corallo > >> Sent: 17 December 2020 14:56 > >> To: gcc-patches@gcc.gnu.org > >> Cc: Kyrylo Tkachov ; Richard Earnshaw > >> ; nd ; Prathamesh Kulkarni > >> > >> Subj

[PING^2][PATCH][omp, simt] Handle alternative IV

2020-12-17 Thread Tom de Vries
On 10/15/20 5:05 PM, Tom de Vries wrote: > On 10/2/20 3:21 PM, Tom de Vries wrote: >> Hi, >> >> Consider the test-case libgomp.c/pr81778.c added in this commit, with >> this core loop (note: CANARY_SIZE set to 0 for simplicity): >> ... >> int s = 1; >> #pragma omp target simd >> for (int i =

[OG10] Fortran: delinearize multi-dimensional array accesses

2020-12-17 Thread Sandra Loosemore
The attached patch implements delinearization of array accesses in the Fortran front end, something that has been discussed for a long time. I've been asked to try to get this patch committed on the OG10 branch since it is blocking some further optimization work with Graphite for OpenACC kerne

Re: [PATCH] c++: Diagnose unstable satisfaction results

2020-12-17 Thread Patrick Palka via Gcc-patches
On Fri, Dec 11, 2020 at 4:55 PM Patrick Palka wrote: > > On Fri, 11 Dec 2020, Jason Merrill wrote: > > > On 12/11/20 10:31 AM, Patrick Palka wrote: > > > On Thu, 10 Dec 2020, Patrick Palka wrote: > > > > > > > On Thu, 10 Dec 2020, Jason Merrill wrote: > > > > > > > > > On 12/10/20 11:21 AM, Patric

Re: [PATCH 3/3] Support the PGO build for binutils+gdb

2020-12-17 Thread Matthias Klose
On 10/29/20 8:11 PM, H.J. Lu via Binutils wrote: > diff --git a/configure.ac b/configure.ac > index 7c4bdff0fa..eea9a21099 100644 > --- a/configure.ac > +++ b/configure.ac > + if test "$enable_pgo_build" = "lto"; then > +AC_MSG_CHECKING([whether the compiler supports -flto=jobserver]) > +o

Re: [PATCH] c++: Diagnose unstable satisfaction results

2020-12-17 Thread Patrick Palka via Gcc-patches
On Thu, 17 Dec 2020, Patrick Palka wrote: > On Fri, Dec 11, 2020 at 4:55 PM Patrick Palka wrote: > > > > On Fri, 11 Dec 2020, Jason Merrill wrote: > > > > > On 12/11/20 10:31 AM, Patrick Palka wrote: > > > > On Thu, 10 Dec 2020, Patrick Palka wrote: > > > > > > > > > On Thu, 10 Dec 2020, Jason Me

[PATCH 1/3] arm: Add movmisalign patterns for MVE (PR target/97875)

2020-12-17 Thread Christophe Lyon via Gcc-patches
This patch adds new movmisalign_mve_load and store patterns for MVE to help vectorization. They are very similar to their Neon counterparts, but use different iterators and instructions. Indeed MVE supports less vectors modes than Neon, so we use the MVE_VLD_ST iterator where Neon uses VQX. Since

[PATCH 2/3] arm: Auto-vectorization for MVE: vshl

2020-12-17 Thread Christophe Lyon via Gcc-patches
This patch enables MVE vshlq instructions for auto-vectorization. The existing mve_vshlq_n_ is kept, as it takes a single immediate as second operand, and is used by arm_mve.h. We move the vashl3 insn from neon.md to an expander in vec-common.md, and the mve_vshlq_ insn from mve.md to vec-common.

[PATCH 3/3] arm: Auto-vectorization for MVE: vshr

2020-12-17 Thread Christophe Lyon via Gcc-patches
This patch enables MVE vshr instructions for auto-vectorization. New MVE patterns are introduced that take a vector of constants as second operand, all constants being equal. The existing mve_vshrq_n_ is kept, as it takes a single immediate as second operand, and is used by arm_mve.h. The vashr3

c++: Fix clang problem [PR 98340]

2020-12-17 Thread Nathan Sidwell
Clang didn't like sizeot (uintset::value) in a templated context. Not sure where the problem lies -- ambiguous std, gcc erroneous accept or clang erroneous reject. Anyway, this avoids that construct. PR c++/98340 gcc/cp/ * module.c (uintset::hash::add): Use uintset

Re: [PATCH] Correct -fdump-go-spec's handling of incomplete types

2020-12-17 Thread Ian Lance Taylor via Gcc-patches
On Thu, Dec 17, 2020 at 8:31 AM Nikhil Benesch via Gcc-patches wrote: > > On 12/17/20 7:28 AM, Rainer Orth wrote: > > I first tried with the new version included, but that broke badly: > > > > cc1 -fpreprocessed sysinfo.i -quiet -O -std=gnu99 > > -fdump-go-spec=tmp-gen-sysinfo.go -o sysinfo.s > >

Re: [PATCH] PowerPC: Add float128/Decimal conversions

2020-12-17 Thread Michael Meissner via Gcc-patches
On Fri, Dec 11, 2020 at 01:51:44PM -0600, Segher Boessenkool wrote: > Hi! > > On Thu, Nov 19, 2020 at 07:05:24PM -0500, Michael Meissner wrote: > > If the glibc is not 2.32 or later, this code just compiles to using abort. > > That is the compile-time target glibc. That is often *not* the glibc

Re: [PATCH 2/3] PowerPC: require IBM long double for pr70117.

2020-12-17 Thread Michael Meissner via Gcc-patches
On Mon, Dec 14, 2020 at 05:26:03PM -0600, Segher Boessenkool wrote: > Hi! > > On Thu, Dec 03, 2020 at 10:57:56PM -0500, Michael Meissner wrote: > > --- a/gcc/testsuite/gcc.target/powerpc/pr70117.c > > +++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c > > @@ -1,5 +1,6 @@ > > -/* { dg-do run { target

Re: [PATCH] Correct -fdump-go-spec's handling of incomplete types

2020-12-17 Thread Nikhil Benesch via Gcc-patches
On 12/17/20 1:05 PM, Ian Lance Taylor wrote: Thanks for looking into this. I've gotten confused now, though. Which patch fixes the problem on Solaris? Thanks. Ian The patch I submitted upstream is all that is needed to fix the compilation failures on Solaris: https://go-review.googlesou

doc: Standard library header units

2020-12-17 Thread Nathan Sidwell
It seems users are confused by the lack of standard library header units. gcc/ * doc/invoke.texi (C++ Modules): Document lack of std library header units. -- Nathan Sidwell diff --git i/gcc/doc/invoke.texi w/gcc/doc/invoke.texi index 054b8371593..8766bcdfc18 100644 --- i/

V2 [PATCH 3/3] Support the PGO build for binutils+gdb

2020-12-17 Thread H.J. Lu via Gcc-patches
Add the --enable-pgo-build[=lto] configure option. When binutils+gdb is not built together with GCC, --enable-pgo-build enables the PGO build: 1. First build with -fprofile-generate. 2. Use "make maybe-check-*" to generate profiling data and pass -i to make to ignore errors when generating profil

V2 [PATCH 3/3] Support the PGO build for binutils+gdb

2020-12-17 Thread H.J. Lu via Gcc-patches
Add the --enable-pgo-build[=lto] configure option. When binutils+gdb is not built together with GCC, --enable-pgo-build enables the PGO build: 1. First build with -fprofile-generate. 2. Use "make maybe-check-*" to generate profiling data and pass -i to make to ignore errors when generating profil

V2 [PATCH 2/3] Binutils: Pass --plugin to AR and RANLIB

2020-12-17 Thread H.J. Lu via Gcc-patches
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. libctf/

V2 [PATCH 1/3] GCC: Pass --plugin to AR and RANLIB

2020-12-17 Thread H.J. Lu via Gcc-patches
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. * Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. * configure.ac: Include config/gcc-plugin.m4. AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. *

[r11-6232 Regression] FAIL: gcc.dg/pr97750.c (test for warnings, line 17) on Linux/x86_64

2020-12-17 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, c25b504636fec7bf8f181a84af83a52757ba7e89 is the first bad commit commit c25b504636fec7bf8f181a84af83a52757ba7e89 Author: Andrew MacLeod Date: Thu Dec 17 09:24:11 2020 -0500 Fix trap in pointer conversion in op1_range. caused FAIL: gcc.dg/pr97750.c (test for excess errors

[PATCH] Update default_estimated_poly_value prototype in targhooks.h

2020-12-17 Thread H.J. Lu via Gcc-patches
On Thu, Dec 17, 2020 at 6:16 AM Richard Sandiford via Gcc-patches wrote: > > Kyrylo Tkachov via Gcc-patches writes: > > Hi all, > > > > While experimenting with some backend costs for Advanced SIMD and SVE I hit > > many cases where GCC would pick SVE for VLA auto-vectorisation even when the > >

x86_64 build error converting poly_value_estimate_kind

2020-12-17 Thread Martin Sebor via Gcc-patches
The top of trunk fails to build with the error below. I haven't spent any time debugging it except to look at git log where the description for r11-6238 mentions the function also referenced in the error message. Could the patch be responsible for this? https://gcc.gnu.org/pipermail/gcc-cvs/2020

[PATCH] libstdc++: Add support for C++20 barriers

2020-12-17 Thread Thomas Rodgers
From: Thomas Rodgers Let's see if this one sticks... Adds libstdc++/ChangeLog: * doc/doxygen/user.cfg.in: Add new header. * include/Makefile.am (std_headers): likewise. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Add new header. *

Re: x86_64 build error converting poly_value_estimate_kind

2020-12-17 Thread H.J. Lu via Gcc-patches
On Thu, Dec 17, 2020 at 11:07 AM Martin Sebor via Gcc-patches wrote: > > The top of trunk fails to build with the error below. I haven't > spent any time debugging it except to look at git log where > the description for r11-6238 mentions the function also referenced > in the error message. Coul

Re: [PATCH] c++: Fix PCH ICE with __builtin_source_location [PR98343]

2020-12-17 Thread Jason Merrill via Gcc-patches
On 12/17/20 10:04 AM, Jakub Jelinek wrote: Hi! Seems the ggc_remove ppc_nx 3 operand member relies on the hash tables to contain pointers in the first element, which is not the case for source_location_table* hash table, which has location_t and unsigned as first two members and pointer somewher

[committed] rtl-ssa: Fix reg_raw_mode thinko [PR98347]

2020-12-17 Thread Richard Sandiford via Gcc-patches
I'd used reg_raw_mode[regno] for general registers, even though the array is only valid for hard registers. This patch uses regno_reg_rtx instead. Tested on i686-linux-gnu, committed as obvious. Richard gcc/ PR rtl-optimization/98347 * rtl-ssa/access-utils.h (full_register): Us

  1   2   >