The defaulted default constructor defined as deleted when one of variant member has a default member initializer

2020-12-21 Thread jim x via Gcc-patches
struct A{ A(){} }; union C{ A a; int b = 0; }; int main(){ C c; } GCC reports the default constructor for union `C` is defined as deleted. However, the relevant rule in the current c++ standard says that: > A defaulted default constructor for class X is defined as deleted if: >> X i

[PATCH] bootstrap: include string/vector before abort redefinition

2020-12-21 Thread Nikhil Benesch via Gcc-patches
Similar to 1467a5c and PR 98412. Bootstrapping on FreeBSD 12.2 with the default compiler (Clang 10.0.1) fails if the and headers are included after abort is redefined to fancy_abort. Appears to be missing defines in the new C++ module code. The following patch is sufficient. gcc/cp/ChangeLog:

[pushed] c++: Add some asserts in mangle.c

2020-12-21 Thread Jason Merrill via Gcc-patches
The added asserts are places I noticed that we aren't adding the "on" to distinguish an operator name from an expression involving the operator. Hopefully that's because operator names never get there; if not, crash bug reports will let us fix the issue. Tested x86_64-pc-linux-gnu, applying to tru

[pushed] c++: Fix demangling of

2020-12-21 Thread Jason Merrill via Gcc-patches
The ABI for unresolved scoped names on the RHS of . and -> used to be sr That changed years ago to something more complex, but G++ was never updated. This change was particularly incompatible for simple qualified-ids like A::x, which were previously mangled as sr1A1x, and now sr1AE1x. This o

godump patch committed: DECL_ORIGINAL_TYPE is sometimes NULL

2020-12-21 Thread Ian Lance Taylor via Gcc-patches
This patch to -fdump-go-spec code handles the case where DECL_ORIGINAL_TYPE of a decl is NULL. I saw this case while building on aarch64-unknown-linux-gnu for the type pthread_attr_t. I don't know whether this is supposed to be possible or not, but this patch does enable the build to continue wor

Go patch committed: Force MPFR exponent range to be large enough

2020-12-21 Thread Ian Lance Taylor via Gcc-patches
The Go frontend recently started checking whether an exponent was out of range when parsing a string into a floating point number. It turns out that in GCC the mpfr exponent range is target dependent, due to PR 88074. That breaks some Go programs that use large exponents in untyped constants on p

[PATCH] c++: Fix up floating point complex handling in build_zero_init_1 [PR98353]

2020-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! While the gimplifier patch I've just committed fixed an ICE, in some cases like on the committed testcase cp folding doesn't happen after build_zero_init_1 because it is called already during gimplification. Not exactly sure why we just don't call build_zero_cst (type); for the scalar types,

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

2020-12-21 Thread Maciej W. Rozycki
On Mon, 21 Dec 2020, Patrick Palka wrote: > > This breaks with the `vax-netbsdelf' target in GCC compilation: > > > > .../libstdc++-v3/src/c++17/floating_to_chars.cc:126:38: error: static > > assertion failed > > 126 | static_assert(__DBL_MANT_DIG__ == 53); > > |

[committed] gimplify: Gimplify value in gimplify_init_ctor_eval_range [PR98353]

2020-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! gimplify_init_ctor_eval_range wasn't gimplifying value, so if it wasn't a gimple val, verification at the end of gimplification would ICE (or with release checking some random pass later on would ICE or misbehave). Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed

Re: [PATCH] libstdc++: Gracefully disable floating-point to_chars on unsupported targets

2020-12-21 Thread Maciej W. Rozycki
On Mon, 21 Dec 2020, Patrick Palka via Gcc-patches wrote: > This patch conditionally disables the floating-point std::to_chars > implementation on targets whose float and double aren't IEEE binary32 > and binary64, until a proper fallback can be added for such targets. > This fixes a bootstrap fai

Re: [PATCH,rs6000] Combine patterns for p10 load-cmpi fusion

2020-12-21 Thread Segher Boessenkool
On Mon, Dec 21, 2020 at 12:11:44PM -0600, Pat Haugen wrote: > On 12/4/20 1:19 PM, acsawdey--- via Gcc-patches wrote: > > + print " [(set_attr \"type\" \"load\")\n"; > > We need to tag these with a new instruction type, such as 'fused-load-cmp', > so the scheduler can distinguish them from no

[pushed] c++: Fix demangling of qualified-id after '.'

2020-12-21 Thread Jason Merrill via Gcc-patches
The demangler was assuming that only an unqualified-id could appear after . or ->. libiberty/ChangeLog: * cp-demangle.c (d_expression_1): Recognize qualified-id on RHS of dt/pt. * testsuite/demangle-expected: Add test. --- libiberty/cp-demangle.c | 20 ++

[pushed] c++: Fix demangling of x.operator type

2020-12-21 Thread Jason Merrill via Gcc-patches
d_operator_name decides whether "cv" indicates a cast or a conversion operator based on is_expression. "on" specifies that we want the conversion operator. libiberty/ChangeLog: * cp-demangle.c (d_unqualified_name): Clear is_expression. * testsuite/demangle-expected: Add tests. --

[pushed] Darwin : Update the kernel version to macOS version mapping.

2020-12-21 Thread Iain Sandoe
Hi We are currently computing the wrong macOS version information for Darwin kernel editions >= 20.1 (because the computation rules have changed). This fixes the computation as far as it’s currently defined. The patch is an addendum to “Darwin20 is macOS 11” and is needed on the open [and closed

Re: [PATCH] libstdc++: Gracefully disable floating-point to_chars on unsupported targets

2020-12-21 Thread Patrick Palka via Gcc-patches
On Mon, 21 Dec 2020, Jonathan Wakely wrote: > On 21/12/20 11:58 -0500, Patrick Palka via Libstdc++ wrote: > > This patch conditionally disables the floating-point std::to_chars > > implementation on targets whose float/double are not IEEE binary32 and > > binary64 respectively, until a proper fall

Re: [PATCH v2] C-family : Add attribute 'unavailable'.

2020-12-21 Thread Iain Sandoe
Hi Joseph, Nathan has approved this from the C++ perspective (and Martin said that his comments were "not necessarily to object to the idea behind the attribute but to draw attention to the fact that it's not suitable for standard APIs.”) So, I wonder, do you have more comments on the revise

Re: Add libcody

2020-12-21 Thread Nathan Sidwell
On 12/21/20 1:23 PM, Sebastian Huber wrote: Hello Nathan, ../../gnu-mirror-gcc-cf22f78/gcc/../libcody/cody.hh:24: In file included from /usr/include/c++/v1/memory:654: /usr/include/c++/v1/typeinfo:231:5: error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy

Re: [PATCH] libstdc++: Gracefully disable floating-point to_chars on unsupported targets

2020-12-21 Thread Jonathan Wakely via Gcc-patches
On 21/12/20 11:58 -0500, Patrick Palka via Libstdc++ wrote: This patch conditionally disables the floating-point std::to_chars implementation on targets whose float/double are not IEEE binary32 and binary64 respectively, until a proper fallback can be added for such targets. This fixes a bootstr

Re: Add libcody

2020-12-21 Thread Sebastian Huber
Hello Nathan, there is network related build errors are now fixed on FreeBSD 12. However, I got another build error: /usr/bin/c++ -O2 -pipe -fbracket-depth=1024 -I/usr/home/user/rtems-source-builder/rtems/build/tmp/sb-1001/7/rtems-aarch64/usr/local/rtems/6/include -fno-PIE -c  -DIN_GCC_FRONT

Re: [PATCH,rs6000] Fusion patterns for logical-logical

2020-12-21 Thread Pat Haugen via Gcc-patches
On 12/10/20 8:41 PM, acsawdey--- via Gcc-patches wrote: > + [(set_attr "type" "logical") Similar to load-cmp fusion pairs, we need a new insn type here. -Pat

Re: [PATCH,rs6000] Combine patterns for p10 load-cmpi fusion

2020-12-21 Thread Pat Haugen via Gcc-patches
On 12/4/20 1:19 PM, acsawdey--- via Gcc-patches wrote: > + print " [(set_attr \"type\" \"load\")\n"; We need to tag these with a new instruction type, such as 'fused-load-cmp', so the scheduler can distinguish them from normal loads. -Pat

c++: Windows rename [PR 98412]

2020-12-21 Thread Nathan Sidwell
Some system's rename(2) fails if the target already exists, so delete it first. gcc/cp/ * module.cc (create_dirs): Add logging. (finish_module_processing): Unlink before rename. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index fc918d296a2..7e3829

Re: C++ 20 modules

2020-12-21 Thread Nathan Sidwell
On 12/21/20 12:38 PM, Gerald Pfeifer wrote: O Mon, 21 Dec 2020, Nathan Sidwell wrote: /scratch/tmp/gerald/GCC-HEAD/gcc/cp/mapper-client.cc:31: In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/cp/mapper-client.h:26: In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/../libcody/cody.hh:2

Re: C++ 20 modules

2020-12-21 Thread Gerald Pfeifer
O Mon, 21 Dec 2020, Nathan Sidwell wrote: >> /scratch/tmp/gerald/GCC-HEAD/gcc/cp/mapper-client.cc:31: >> In file included from >> /scratch/tmp/gerald/GCC-HEAD/gcc/cp/mapper-client.h:26: >> In file included from >> /scratch/tmp/gerald/GCC-HEAD/gcc/../libcody/cody.hh:24: >> In file included from /usr

bootstrap: std:stoul non-portable [PR 98412]

2020-12-21 Thread Nathan Sidwell
Fix some more system-specific issues. Not everyone's C++11 is the same :( PR bootstrap/98412 libcody/ * client.cc: Include cstdlib. * server.cc: Include cstdlib. gcc/cp/ * mapper-client.cc: INCLUDE_STRING, INCLUDE_VECTOR. (module_client::op

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

2020-12-21 Thread Patrick Palka via Gcc-patches
On Sun, 20 Dec 2020, Maciej W. Rozycki wrote: > On Thu, 17 Dec 2020, Patrick Palka via Gcc-patches wrote: > > > > >libstdc++-v3/ChangeLog: > > > > > > > > * config/abi/pre/gnu.ver: Add new exports. > > > > * include/std/charconv (to_chars): Declare the floating-point > > > > ove

[PATCH] libstdc++: Gracefully disable floating-point to_chars on unsupported targets

2020-12-21 Thread Patrick Palka via Gcc-patches
This patch conditionally disables the floating-point std::to_chars implementation on targets whose float/double are not IEEE binary32 and binary64 respectively, until a proper fallback can be added for such targets. This fixes a bootstrap failure on non-IEEE-754 FP targets such as vax-netbsdelf.

Re: [PATCH, fix bootstrap] libcody: Include as needed

2020-12-21 Thread Nathan Sidwell
On 12/21/20 11:19 AM, Gerald Pfeifer wrote: We explicitly need to inlude netinet.h, (despite what happened on my test systems) libcody/ * netclient.cc: Add netinet.h. Note, though, that my patch also fixed libcody/netserver.cc, which still failed. Seeing t

[PATCH] rtl-ssa: Fix updates to call clobbers [PR98403]

2020-12-21 Thread Richard Sandiford via Gcc-patches
In the PR, fwprop was changing a call instruction and tripped an assert when trying to update a list of call clobbers. There are two ways we could handle this: remove the call clobber and then add it back, or assume that the clobber will stay in its current place. At the moment we don't have enoug

Re: [PATCH, fix bootstrap] libcody: Include as needed

2020-12-21 Thread Gerald Pfeifer
On Mon, 21 Dec 2020, Nathan Sidwell wrote: > On 12/20/20 6:28 PM, Gerald Pfeifer wrote: >> libcody as originally added to GCC fails to build on *-unknown-freebsd11.4 >> and presumably others: >> >>c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c >> -o netclient.o >>

[PATCHv2] hurd: libgcc unwinding over signal trampolines with SIGINFO

2020-12-21 Thread Samuel Thibault via Gcc-patches
When the application sets SA_SIGINFO, the signal trampoline parameters are different to follow POSIX. libgcc/ * config/i386/gnu-unwind.h (x86_gnu_fallback_frame_state): Add the posix siginfo case to struct handler_args. Detect between legacy and siginfo from the second parameter, which is a small

libcody: Add ranlib

2020-12-21 Thread Nathan Sidwell
Add RANLIB. libcody/ * Makefile.in (RANLIB): New var. * Makesub.in (libcody.a): Apply RANLIB. * configure.in: Call AC_PROG_RANLIB. * configure: Rebuilt. -- Nathan Sidwell diff --git c/libcody/Makefile.in w/libcody/Makefile.in index 28e

Re: [PATCH] hurd: libgcc unwinding over signal trampolines with SIGINFO

2020-12-21 Thread Samuel Thibault via Gcc-patches
Jessica Clarke, le lun. 21 déc. 2020 14:21:39 +, a ecrit: > On 21 Dec 2020, at 14:09, Samuel Thibault wrote: > > @@ -75,29 +86,52 @@ x86_gnu_fallback_frame_state > > return _URC_END_OF_STACK; > > > > handler_args = context->cfa; > > - scp = handler_args->scp; > > - usp = scp->sc_uesp;

Re: [PATCH] hurd: libgcc unwinding over signal trampolines with SIGINFO

2020-12-21 Thread Jessica Clarke
On 21 Dec 2020, at 14:09, Samuel Thibault wrote: > @@ -75,29 +86,52 @@ x86_gnu_fallback_frame_state > return _URC_END_OF_STACK; > > handler_args = context->cfa; > - scp = handler_args->scp; > - usp = scp->sc_uesp; > + sigcode = handler_args->legacy.sigcode; > + if (sigcode < 4096) Do y

[PATCH] hurd: libgcc unwinding over signal trampolines with SIGINFO

2020-12-21 Thread Samuel Thibault via Gcc-patches
When the application sets SA_SIGINFO, the signal trampoline parameters are different to follow POSIX. libgcc/ * config/i386/gnu-unwind.h (x86_gnu_fallback_frame_state): Add the posix siginfo case to struct handler_args. Detect between legacy and siginfo from the second parameter, which is a small

Re: C++ 20 modules

2020-12-21 Thread Nathan Sidwell
On 12/20/20 6:57 PM, Gerald Pfeifer wrote: On Thu, 17 Dec 2020, Nathan Sidwell wrote: As yesterday, several issues fixed: Here is a new one, *-unknown-freebsd11.4; with my previous patch /scratch/tmp/gerald/GCC-HEAD/gcc/cp/mapper-client.cc In file included from /scratch/tmp/gerald/GCC-HEAD/

Re: [PATCH, fix bootstrap] libcody: Include as needed

2020-12-21 Thread Nathan Sidwell
On 12/20/20 6:28 PM, Gerald Pfeifer wrote: libcody as originally added to GCC fails to build on *-unknown-freebsd11.4 and presumably others: c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c -o netclient.o .../libcody/netclient.cc:114:3: error: unknown type sockad

libcody: Add netinet.h

2020-12-21 Thread Nathan Sidwell
We explicitly need to inlude netinet.h, (despite what happened on my test systems) libcody/ * netclient.cc: Add netinet.h. -- Nathan Sidwell diff --git c/libcody/netclient.cc w/libcody/netclient.cc index 8cccface71c..7f81dd91810 100644 --- c/libcody/netclient.cc +++ w/li

libcody: to_string is not always available [PR 98412]

2020-12-21 Thread Nathan Sidwell
to_string is not always available, so don't use it. libcody/ * buffer.cc (MessageBuffer::AppendInteger): Workaround to_string's non-ubiquity. -- Nathan Sidwell diff --git i/libcody/buffer.cc w/libcody/buffer.cc index 3256c37399b..85c066fef71 100644 --- i/libcody/buffer.cc

libcody: Fix exe suffix [PR 98409]

2020-12-21 Thread Nathan Sidwell
I had a thinko about variable case, and, coupled with Make's behaviour of just consing up variables out of nothing, and linux not having an executable extension, didn't notice. PR other/98409 libcody/ * Makefile.in: Fix exeext variable case. -- Nathan Sidwell diff --git i

Re: [PATCH][X86] Fix Typo

2020-12-21 Thread Uros Bizjak via Gcc-patches
On Mon, Dec 21, 2020 at 12:01 PM Hongtao Liu wrote: > > When i'm working on PR98348, i notice there's Typo in define_insn > "*one_cmpl2_1", There are 2 alternatives, so the index couldn't > be 2. > Bootstrap and regress test is ok on x86_64-unknown-linux. > > gcc/ChangeLog > > * config

Re: [PATCH, fix bootstrap] libcody: Include as needed

2020-12-21 Thread Sebastian Huber
On 21/12/2020 00:28, Gerald Pfeifer wrote: libcody as originally added to GCC fails to build on *-unknown-freebsd11.4 and presumably others: I experienced the same issue with FreeBSD 12 building a cross-compiler. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany

[PING] [PATCH] Fix -save-temp leaking lto files in /tmp

2020-12-21 Thread Bernd Edlinger
Hi, I'd like to ping for this patch below: https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561811.html Thanks Bernd. On 12/14/20 4:31 PM, Bernd Edlinger wrote: > Hi, > > On 2/21/20 8:35 AM, Richard Biener wrote: >> >> IIRC this definitely clashes with Alex work to overhaul >> -auxdir/-d

Re: [patch] libstdc++/testsuite: Tweak dg-prune-output regex for out-of-tree contexts

2020-12-21 Thread Jonathan Wakely via Gcc-patches
On 21/12/20 11:57 +0100, Olivier Hainque wrote: Thanks for your prompt feedback on this Jonathan. On 18 Dec 2020, at 23:24, Jonathan Wakely wrote: Is this ok to commit ? Yes, OK, although I wonder if this would be better: { dg-prune-output "/(functional|bits/invoke.h):" } Probably more

[PATCH][X86] Fix Typo

2020-12-21 Thread Hongtao Liu via Gcc-patches
When i'm working on PR98348, i notice there's Typo in define_insn "*one_cmpl2_1", There are 2 alternatives, so the index couldn't be 2. Bootstrap and regress test is ok on x86_64-unknown-linux. gcc/ChangeLog * config/i386/i386.md (*one_cmpl2_1): Fix typo, change alternative fr

Re: [patch] libstdc++/testsuite: Tweak dg-prune-output regex for out-of-tree contexts

2020-12-21 Thread Olivier Hainque
Thanks for your prompt feedback on this Jonathan. > On 18 Dec 2020, at 23:24, Jonathan Wakely wrote: > >> Is this ok to commit ? > > Yes, OK, although I wonder if this would be better: > > { dg-prune-output "/(functional|bits/invoke.h):" } Probably more robust, I agree. This still works both

[C PATCH] qualifiers of pointers to arrays in C2X [PR 98397]

2020-12-21 Thread Uecker, Martin
Here is a patch that adds the minor corrections needed for qualifiers of pointers to arrays in C23. -- Martin C: Correct qualifiers for pointers to arrays according to C2X [PR98397] 2020-12-12  Martin Uecker   gcc/c/  PR c/98397  * c-typeck.c (comp_target_types): Change pedwar

Re: [PATCH] Make switchconv smarter.

2020-12-21 Thread Martin Liška
On 12/18/20 2:19 PM, Martin Liška wrote: The patch covers 2 cases mentioned in the PR. I've got a discussion with Jakub on IRC about the patch and he sees 2 more optimizations: 1) using VRP information (from ranger) - I'm leaving that to him, or I can return to it in the next stage 1 2) cons

Re: Patch RFA: Support non-ASCII file names in git-changelog

2020-12-21 Thread Martin Liška
On 12/21/20 10:48 AM, Jakub Jelinek wrote: I have no idea who that is (if it is a single user at all, if it isn't any user with git write permissions). CCing Joel, he should help us how to set a git config that will be used by the server hooks. Martin

Re: Patch RFA: Support non-ASCII file names in git-changelog

2020-12-21 Thread Jakub Jelinek via Gcc-patches
On Mon, Dec 21, 2020 at 10:39:31AM +0100, Martin Liška wrote: > On 12/18/20 7:30 PM, Ian Lance Taylor wrote: > > I don't know the tradeoffs here. This approach sounds fine to me. > > Trade off is that we need to setup server (that's fine). > And people have to locally do the same, otherwise they'

Re: Patch RFA: Support non-ASCII file names in git-changelog

2020-12-21 Thread Martin Liška
On 12/18/20 7:30 PM, Ian Lance Taylor wrote: I don't know the tradeoffs here. This approach sounds fine to me. Trade off is that we need to setup server (that's fine). And people have to locally do the same, otherwise they'll newly see: $ git gcc-verify -p Checking 6c439cadf0362cc0f8f2b894c1

[PATCH][pushed] gcc-changelog: new error for quoted utf8 filenames

2020-12-21 Thread Martin Liška
The patch adds new error for situation where filenames are quoted. Pushed to master. Martin contrib/ChangeLog: * gcc-changelog/git_commit.py: Add new error for quoted filenames. * gcc-changelog/test_email.py: Test it. * gcc-changelog/test_patches.txt: Test it. --

[committed] fold-const: Fix up a buffer overflow in native_encode_initializer [PR98407]

2020-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! For flexible array members we need to incrementally clear just from ptr + total_bytes up to new ptr + total_bytes, but memset has been called with the length from ptr, so was missing - total_bytes. Additionally, in this code off is guaranteed to be -1 and thus o 0, so don't bother pretending

[RFC] Run pass_sink_code once more after ivopts/fre

2020-12-21 Thread Xiong Hu Luo via Gcc-patches
Here comes another case that requires run a pass once more, as this is not the common suggested direction to solve problems, not quite sure whether it is still a reasonble fix here. Source code is something like: ref = ip + *hslot; while (ip < in_end - 2) { unsigned int len = 2; len++; fo

RE: Add libcody

2020-12-21 Thread Hao Liu OS via Gcc-patches
Hi Nathan, This patch causes a build failure on CentOS. More information: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=98318#c3 Thanks, -Hao > -Original Message- > From: Gcc-patches On Behalf Of Nathan > Sidwell > Sent: Tuesday, December 15, 2020 11:46 PM > To: GCC Patches > Subject

[PATCH] c++: Handle array members in build_comparison_op [PR93480]

2020-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! http://eel.is/c++draft/class.compare.default#6 says for the expanded list of subobjects: "In that list, any subobject of array type is recursively expanded to the sequence of its elements, in the order of increasing subscript." but build_comparison_op just tried to compare the whole arrays, wh

[committed] openmp: Fix up handling of addressable temporaries in simd lb, b and incr expressions [PR98383]

2020-12-21 Thread Jakub Jelinek via Gcc-patches
Hi! For simd, we have code to artificially add locally defined variables into private clauses if they are addressable, so that omplower turns them into "omp simd array" variables. As the testcase shows, this is undesirable if those temporaries only show in the lb, b or incr expressions and nowher