Re: C++ 20 modules

2020-12-15 Thread Nathan Sidwell
a patch gcc_update not touching files: fixed libcody uses too-new options: fixed, hopefully libcody unused variable: fixed by Marek, thanks! nathan -- Nathan Sidwell

c++: Fix (some) solaris breakage

2020-12-16 Thread Nathan Sidwell
x27;s inclusion logic to get it earlier. gcc/cp/ * mapper-client.cc: Include sys/socket.h before system.h. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/mapper-client.cc w/gcc/cp/mapper-client.cc index acec591296a..2ad770b3d78 100644 --- i/gcc/cp/mapper-client.cc +++

c++tools: Fix (an) install issue

2020-12-16 Thread Nathan Sidwell
ushing to trunk -- Nathan Sidwell diff --git i/c++tools/Makefile.in w/c++tools/Makefile.in index 49b7fae1526..4ec1419fa5b 100644 --- i/c++tools/Makefile.in +++ w/c++tools/Makefile.in @@ -38,7 +38,7 @@ mostlyclean:: rm -f $(MAPPER.O) clean:: - rm -f c++-mapper-server$(exeext) + rm -f g++-mapper

c++: Fix detailed-mem-stat breakage

2020-12-16 Thread Nathan Sidwell
indirection. gcc/cp/ * module.cc (loc_spans): Make spans a pointer, not inline. Adjust all accesses. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 1b40a72a0d6..d2806966e43 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -3273,32

Re: libcody: Fix for dash

2020-12-16 Thread Nathan Sidwell
On 12/16/20 5:02 AM, Richard Sandiford wrote: Nathan Sidwell writes: Apparently 'var+=...' is not a dash thing. Fixed thusly. * config.m4: Avoid non-dash idiom * configure: Rebuilt. pushed (2 patches, because I didn't look carefully enough the first tim

Re: [PATCH] libcody: Fix build for older GCC versions

2020-12-16 Thread Nathan Sidwell
on. Built on GNu/Linux using both gcc-11 and gcc-4.8, and also by hacking it so that __builtin_FILE and __builtin_LINE aren't found, and gets used. OK for trunk? great, thanks! nathan -- Nathan Sidwell

libcody: fix --enable-checking=... [PR 98311]

2020-12-16 Thread Nathan Sidwell
ushing to trunk -- Nathan Sidwell diff --git i/libcody/configure w/libcody/configure index 4cc03dcaa3a..76ff932d61b 100755 --- i/libcody/configure +++ w/libcody/configure @@ -1285,7 +1285,11 @@ Optional Features: --enable-maintainer-mode enable maintainer mode. Add r

Re: Libcody breaks configure

2020-12-16 Thread Nathan Sidwell
On 12/16/20 3:38 AM, Kewen.Lin via Gcc-patches wrote: on 2020/12/16 下午2:35, Stott Graham via Gcc-patches wrote: If any ---checking options used The related PR PR98311[1] has been filed by David. BR, Kewen [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98311 now fixed -- Nathan

Re: libcody: fix --enable-checking=... [PR 98311]

2020-12-16 Thread Nathan Sidwell
On 12/16/20 10:40 AM, Jakub Jelinek wrote: On Wed, Dec 16, 2020 at 09:22:49AM -0500, Nathan Sidwell wrote: Thanks Jakub for pointing at libcpp. The -enable-checking configure code in libcody didn't play well with us. This just uses libcpp's configurey for that piece.

c++: Fix offsetof use [PR 98232]

2020-12-16 Thread Nathan Sidwell
offsetof is underspecified. GCC happened to accept an unneeded explicit scoping, clang does not. gcc/cp/ * module.cc (dumper::push): Clangify offsetof use. pushed -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index d2806966e43..e9ea18636b4 100644 --- i

c++tools: fix install-strip [PR 98328]

2020-12-16 Thread Nathan Sidwell
: Use INSTALL_PROGRAM. * configure.ac: Add INSTALL_PROGRAM. * configure: Regenerated. pushing to trunk -- Nathan Sidwell diff --git i/c++tools/Makefile.in w/c++tools/Makefile.in index 4ec1419fa5b..310b5674fec 100644 --- i/c++tools/Makefile.in +++ w/c++tools/Makefile.in @@ -22,7

c++: Fix template parm ICE [PR 98297]

2020-12-16 Thread Nathan Sidwell
checking for instantiation. gcc/testsuite/ * g++.dg/template/pr98297.C: New. pushing to trunk -- Nathan Sidwell diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c index 7ea8c28830e..3883339aa64 100644 --- c/gcc/cp/parser.c +++ w/gcc/cp/parser.c @@ -19650,7 +19650,9

c++: Another solaris header use [PR 98315]

2020-12-16 Thread Nathan Sidwell
stead. * module.cc: Specify no CODY_NETWORKING. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/mapper-resolver.cc w/gcc/cp/mapper-resolver.cc index 8e968c52556..53c482441b4 100644 --- i/gcc/cp/mapper-resolver.cc +++ w/gcc/cp/mapper-resolver.cc @@ -21,13 +21,9 @@ along with GCC; see the

Re: C++ 20 modules

2020-12-16 Thread Nathan Sidwell
-stat init issue I'm aware of the following: * 98324 bootstrap with lto/PIE. I can reproduce this, investigating * 98300 windows build, reporter has indicated patch gets further * 98316 solaris socket lib, Rainer is developing a patch On 12/15/20 5:33 PM, Nathan Sidwell wrote: as expected

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

2020-12-17 Thread Nathan Sidwell
rated. Of course, didn't know about that option, thanks nathan -- Nathan Sidwell

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

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

2020-12-17 Thread Nathan Sidwell
sions on i386-pc-solaris2.11 (Solaris 11.3 and 11.4), sparc-sun-solaris2.11, and x86_64-pc-linux-gnu. Ok for master? Thank you very much for working on this. Approved to the extent of my approval rating! nathan -- Nathan Sidwell

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

bootstrap: Fix some windows issues [PR 98300]

2020-12-17 Thread Nathan Sidwell
result signedness comparisons. -- Nathan Sidwell diff --git i/c++tools/config.h.in w/c++tools/config.h.in index 747aaf40b12..bfb49582357 100644 --- i/c++tools/config.h.in +++ w/c++tools/config.h.in @@ -15,12 +15,42 @@ /* Define if inet_ntop provided. */ #undef HAVE_INET_NTOP +/* Define to 1 if you hav

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

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/li

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

2020-12-17 Thread Nathan Sidwell
on how the class can be used. I don;t know whether our optimizers are smart enough (credulous enough?) to know that the low bits of any pointer to an aligned type must be zero, and therefore optimize the assert away in those cases? If they're not something like assert (align (T) > 1 || !(reinterpret_cast (ptr) & 1)) ? -- Nathan Sidwell

c++: Fix clang problem [PR 98340]

2020-12-17 Thread Nathan Sidwell
: Use uintset (0u).MEMBER, rather than uintset::MEMBER. Thanks to Peter for testing. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 21d04ccec19..b2b81900fc3 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -2718,7 +2718,7 @@ uintset::hash

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

Re: C++ 20 modules

2020-12-17 Thread Nathan Sidwell
p with lto/PIE, still working on it. * 98300 follow on patch pushed, waiting On 12/16/20 4:52 PM, Nathan Sidwell wrote: Several issues have been fixed today: * Solaris headers 98315 (hopefully finally) * install-strip  98328 * clang offsetof 98323 (I typoed the PR in the commit) * libcody enabl

c++: Fix windows binary files [PR 98362]

2020-12-18 Thread Nathan Sidwell
Windows has unique and special needs for open(2). gcc/cp/ * module.cc (O_CLOEXEC, O_BINARY): Add window's support. (elf_in::defrost, module_state::do_import) (finish_module_processing): Use O_BINARY. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/g

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

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 ---

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

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

2020-12-21 Thread Nathan Sidwell
sockaddr_in6 addr; ^~~~ That should be fixed now -- Nathan Sidwell

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

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

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

2020-12-21 Thread Nathan Sidwell
that your commit essentially matches my proposed patch, I went ahead and committed the remaining part. With that libcody now builds (and I'll look into the follow-up patch you shared). thanks, I didn't realize you had a patch already. nathan -- Nathan Sidwell

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

2020-12-21 Thread Nathan Sidwell
lient::open_module_client): Avoid std::stoul. * mapper-resolver.cc: INCLUDE_STRING, INCLUDE_VECTOR. Thanks for checking it Eric! nathan -- Nathan Sidwell diff --git i/gcc/cp/mapper-client.cc w/gcc/cp/mapper-client.cc index 2ad770b3d78..df821bab7e1 100644 --- i/gcc/cp/mapper-client.cc +++ w/g

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

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 fc918d

Re: Add libcody

2020-12-21 Thread Nathan Sidwell
declared here extern void fancy_abort (const char *, int, const char *) can you try with Gerald Pfeifer's patch setting INCLUDE_$X? Some ot that's committed but not all. nathan -- Nathan Sidwell

c++: Module ICE fix

2020-12-22 Thread Nathan Sidwell
A missing check for decl lang specific has madeitself apparent. gcc/cp/ * module.cc (has_definition): Check DECL_LANG_SPECIFIC. (test in the next uber-patch) -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index ed3dbe244a3..19fe66346bd 100644 --- i/gcc/cp

testsuite: C++ module tests

2020-12-22 Thread Nathan Sidwell
This adds most of the modules tests. I do not include the tests that excercise system & C++ library header files. Those will be later. gcc/testsuite/ * g++.dg/modules/*: Many tests. -- Nathan Sidwell tests.diff.gz Description: application/gzip

c++tools: Fix PIE [PR 98324]

2020-12-23 Thread Nathan Sidwell
: Add --enable-default-pie support. * configure: Rebuilt. -- Nathan Sidwell diff --git i/c++tools/Makefile.in w/c++tools/Makefile.in index 7dc67ad9e06..590a856af90 100644 --- i/c++tools/Makefile.in +++ w/c++tools/Makefile.in @@ -28,7 +28,9 @@ AUTOCONF := @AUTOCONF@ AUTOHEADER

libcody: Remove testsuite [PR 98318]

2020-12-23 Thread Nathan Sidwell
ts/jouster: Delete. -- Nathan Sidwell diff --git c/libcody/Makefile.in w/libcody/Makefile.in index a0722f9a385..6e38d51516f 100644 --- c/libcody/Makefile.in +++ w/libcody/Makefile.in @@ -100,7 +100,7 @@ endif CXXOPTS += $(filter-out -DHAVE_CONFIG_H,@DEFS@) -include config.h # Linker options -LDF

c++: EOF location [PR 96045]

2020-12-23 Thread Nathan Sidwell
* g++.dg/template/error-recovery1.C: Likewise * g++.dg/template/error57.C: Likewise * g++.old-deja/g++.other/crash31.C: Likewise -- Nathan Sidwell diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c index 3883339aa64..dd8e8081847 100644 --- c/gcc/cp/parser.c +++ w/gcc/cp/parser.c

[libcody] Windows absdir fix

2021-01-04 Thread Nathan Sidwell
An obvious thinko in dirve name check :( libcody/ * resolver.cc (IsAbsDir): Fix string indexing. Signed-off-by: Nathan Sidwell pushed to trunk -- Nathan Sidwell diff --git i/Makefile.def w/Makefile.def index c45be5bff45..d87c2a4bc3c 100644 --- i/Makefile.def +++ w

[libcody] Remove some std::move [PR 98368]

2021-01-04 Thread Nathan Sidwell
Compiling on clang showed a couple of pessimizations. Fixed thusly. libcody/ * client.cc (Client::ProcessResponse): Remove std::move inside ?: c++tools/ * resolver.cc (module_resolver::cmi_response): Remove std::move of temporary. -- Nathan

c++: Add stdlib module test cases

2021-01-04 Thread Nathan Sidwell
++.dg/modules/xtreme-tr1_a.H: New. * g++.dg/modules/xtreme-tr1_b.C: New. -- Nathan Sidwell module-stdlib-tests.diff.gz Description: application/gzip

cxx status update

2021-01-04 Thread Nathan Sidwell
Here's a patch describing the c++20 modules status. While there I noticed the coroutines project status was out of date (it's done). ok? nathan -- Nathan Sidwell diff --git i/htdocs/gcc-11/changes.html w/htdocs/gcc-11/changes.html index f457b7e7..e044d710 100644 --- i/htd

Re: [committed] libgomp: Avoid bad "up" link in libgomp docs

2021-01-04 Thread Nathan Sidwell
tead of me? Or should Author: list the committer? add --author='sandra to the git commit line. You can also add --signoff there to add your stamp of approval nathan -- Nathan Sidwell

Re: cxx status update

2021-01-04 Thread Nathan Sidwell
On 1/4/21 3:33 PM, Gerald Pfeifer wrote: Hi Nathan, On Mon, 4 Jan 2021, Nathan Sidwell wrote: Here's a patch describing the c++20 modules status. While there I noticed the coroutines project status was out of date (it's done). ok? you don't need extra approval for release

[c++]: Improve module-decl diagnostics [PR 98327]

2021-01-05 Thread Nathan Sidwell
is permissable. gcc/testsuite/ * g++.dg/modulex/mod-decl-1.C: Adjust. * g++.dg/modulex/p0713-2.C: Adjust. * g++.dg/modulex/p0713-3.C: Adjust. -- Nathan Sidwell diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index d855e034458..c713852fe93 100644 --- i/gcc/cp/parser

Re: [PATCH] v2: Don't link cc1 etc. against libcody.a

2021-01-05 Thread Nathan Sidwell
R) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \ Jakub -- Nathan Sidwell

Re: [PATCH] Fix UBSAN bootstrap

2021-01-11 Thread Nathan Sidwell
(not here though). I think replacing more bits with libcpp configure goup is probably the better. nathan -- Nathan Sidwell

c++: Fix cp_build_function_call_vec [PR 98626]

2021-01-13 Thread Nathan Sidwell
vector. -- Nathan Sidwell diff --git c/gcc/cp/module.cc w/gcc/cp/module.cc index d2093916c9e..1fd0bcfe3eb 100644 --- c/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -18977,8 +18977,8 @@ module_add_import_initializers () if (modules) { tree fntype = build_function_type (void_type_node

Re: [PATCH] c++: Failure to lookup using-decl name [PR98231]

2021-01-13 Thread Nathan Sidwell
rapped/regtested on x86_64-pc-linux-gnu, ok for trunk? ok -- Nathan Sidwell

c++: Fix erroneous parm comparison logic [PR 98372]

2021-01-14 Thread Nathan Sidwell
text logic. gcc/testsuite/ * cpp0x/constexpr-52830.C: Restore dg-ice * g++.dg/template/pr98372.C: New. -- Nathan Sidwell diff --git c/gcc/cp/tree.c w/gcc/cp/tree.c index d339036e88e..3a9a86de34a 100644 --- c/gcc/cp/tree.c +++ w/gcc/cp/tree.c @@ -3841,8 +3841,8 @@ cp_tree_equal (tre

c++: Fix langspecs with -fsyntax-only [PR98591]

2021-01-15 Thread Nathan Sidwell
syntax-only, so we ended up with two -o options. PR c++/98591 gcc/cp/ * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only. -- Nathan Sidwell diff --git c/gcc/cp/lang-specs.h w/gcc/cp/lang-specs.h index f16279142be..8902ae1d2ed 100644 --- c/gcc/cp/lang-sp

preprocessor: Make quoting : [PR 95253]

2021-01-15 Thread Nathan Sidwell
I changed the quoting of ':', this restores it. Make doesn't need ':' quoting (in a filename). PR preprocessor/95253 libcpp/ * mkdeps.c (munge): Do not escape ':'. -- Nathan Sidwell diff --git i/libcpp/mkdeps.c

Re: preprocessor: Make quoting : [PR 95253]

2021-01-15 Thread Nathan Sidwell
. -- Nathan Sidwell diff --git a/gcc/testsuite/g++.dg/modules/dep-1_a.C b/gcc/testsuite/g++.dg/modules/dep-1_a.C index 766f4368ee6..5ec5dd30f6d 100644 --- a/gcc/testsuite/g++.dg/modules/dep-1_a.C +++ b/gcc/testsuite/g++.dg/modules/dep-1_a.C @@ -4,6 +4,6 @@ export module m:part; // { dg-module-cmi m:part

c++: Fix qualified array-type construction [PR 98538]

2021-01-15 Thread Nathan Sidwell
/ g++.dg/template/pr98538.C: New. -- Nathan Sidwell diff --git c/gcc/cp/tree.c w/gcc/cp/tree.c index 3a9a86de34a..55325d7c671 100644 --- c/gcc/cp/tree.c +++ w/gcc/cp/tree.c @@ -1332,10 +1332,12 @@ cp_build_qualified_type_real (tree type, if (!t) { - gcc_checking_assert (TYP

c++: Remove unused fn

2021-01-19 Thread Nathan Sidwell
Martin pointed out this is found with some warning modes. I had two overloads of a function, but only one was needed. Let's keep the constant one. gcc/cp/ * modules.cc (identifier): Merge overloads. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc

c++: Fix null this pointer [PR 98624]

2021-01-19 Thread Nathan Sidwell
There's no need for this function to have an object, so make it static and avoid UB. gcc/cp/ * module.cc (trees_out::write_location): Make static. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 1fd0bcfe3eb..3b224b616c1 100644 --- i/gcc/cp/modu

driver: do not check input file existence here [PR 98452]

2021-01-19 Thread Nathan Sidwell
h. booted & tested on x86_64-linux, ok? gcc/ * gcc.c (process_command): Don't check OPT_SPECIAL_input_file existence here. -- Nathan Sidwell diff --git i/gcc/gcc.c w/gcc/gcc.c index 7dccfadfef2..aa5774af7e7 100644 --- i/gcc/gcc.c +++ w/gcc/gcc.c @@ -4811,44 +4811,12 @@ pr

Re: driver: do not check input file existence here [PR 98452]

2021-01-20 Thread Nathan Sidwell
On 1/19/21 6:27 PM, Joseph Myers wrote: On Tue, 19 Jan 2021, Nathan Sidwell wrote: Joseph, I was relying on this patch on the modules branch, but didn't realize the implications when merging and thought it was just a cleanup. I'm not sure why the driver wants to check here, rather

c++: Avoid UB in signed shift [PR 98625]

2021-01-20 Thread Nathan Sidwell
signed type. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 1fd0bcfe3eb..8f9c7940ef8 100644 --- i/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -881,9 +881,12 @@ bytes_in::i () v &= 0xf; if (v & 0x8) v |= -1 ^ 0x7; + /* unsigned necessary due to l

Re: [PATCH] coroutines: Add a cleanup expression for g-r-o when needed [PR95477].

2020-06-08 Thread Nathan Sidwell
_never{}; } + }; +}; + +simple +f() +{ + co_return; +} + +int main() { + { +f(); + } + + if (simple::alive != 0) + { + PRINTF ("something wrong with dtors: %d\n", simple::alive); + abort (); + } + return 0; +} -- Nathan Sidwell

Re: [PATCH] coroutines: Handle lambda closure pointers like 'this'.

2020-06-08 Thread Nathan Sidwell
entifier; but this bit will be different on 10.2. I think you want if (lambda_p) { parm.lambda_cobj = parm.this_ptr || DECL_NAME (arg) == closure_identifier; parm.this_pointer = false; } ? looks ok otherwise, for both. -- Nathan Sidwell

Re: [PATCH] coroutines: Ensure distinct DTOR trees [PR95137].

2020-06-08 Thread Nathan Sidwell
On 5/22/20 7:19 AM, Iain Sandoe wrote: Hi This is almost obvious - except perhaps I’m missing some more efficient way of doing it; it seems less than ideal to have to build the ctor call twice with exactly the same inputs. If there’s no better way …. ok. nathan -- Nathan Sidwell

1-800-GIT-HELP

2020-06-10 Thread Nathan Sidwell
mmit history (git tree --first-parent). But this doesn;t seem to be working. In particular I thought that if $HASH matched the last master commit that I merged from, the result would be a nop. It isn't :( How do I update my branch to some non-HEAD point on master? nathan -- Nathan Sidwell

Re: 1-800-GIT-HELP

2020-06-10 Thread Nathan Sidwell
On 6/10/20 11:38 AM, Nathan Sidwell wrote: I'm trying to merge master to devel/c++-modules, as I usually do.  But there's an ICE creeping in, so I'm attempting incremental merges to figure out what happened. I thought 'git merge --no-commit origin $HASH' would do th

Re: 1-800-GIT-HELP

2020-06-10 Thread Nathan Sidwell
On 6/10/20 12:00 PM, Andreas Schwab wrote: On Jun 10 2020, Nathan Sidwell wrote: needed 'origin' -- eg 'git merge origin master' That's an octopus merge. I don't think you want that. ah. Somehow I convinced myself that was how to merge from master, but I gu

Re: [PATCH] coroutines: Update handling and failure for g-r-o-o-a-f [PR95505]

2020-06-15 Thread Nathan Sidwell
*/ ... to what? Is this a repeat of the above rationale or something different? nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Copy attributes to the outlined functions [PR95518]

2020-06-15 Thread Nathan Sidwell
xcept { return {}; } +void return_void() const noexcept {} +void unhandled_exception() const noexcept {} +}; +int i; // work around #95516 +}; + +[[maybe_unused]] static dummy foo() +{ +co_return; +} -- Nathan Sidwell

Re: [PATCH][RFC] Do not stream all zeros for gcda files.

2020-06-17 Thread Nathan Sidwell
save even more space. What's the size of zlib (or other) compression of that 17MB file? nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Add a cleanup expression for g-r-o when needed [PR95477].

2020-06-23 Thread Nathan Sidwell
On 6/12/20 4:06 PM, Iain Sandoe wrote: Iain Sandoe wrote: Nathan Sidwell wrote: On 6/8/20 5:17 AM, Iain Sandoe wrote: + r = gro_is_void_p ? integer_zero_node : rvalue (gro); + /* The return object is constructed, even if the gro is void. */ Would error_mark_node work here

Re: [PATCH v2] coroutines: Copy attributes to the outlined functions [PR95518, PR95813]

2020-06-24 Thread Nathan Sidwell
On 6/24/20 7:00 AM, Iain Sandoe wrote: Hi Nathan, Nathan Sidwell wrote: On 6/11/20 3:53 PM, Iain Sandoe wrote: Hi We had omitted the copying of function attributes (including the 'used' status). Mark the outlined functions as artificial, since they are; some diagnostic proces

Re: [PATCH] coroutines: Generalize promise expressions [PR95519]

2020-06-25 Thread Nathan Sidwell
urn_object() noexcept { return handle_t::from_promise(*this); } + ueh unhandled_exception; +}; + +int lambda_ueh = 0; + +struct pt_d : pt_b +{ + using handle_t = std::coroutine_handle; + auto get_return_object() noexcept { return handle_t::from_promise(*this); } + static constexpr auto unhandled_exception += [] () noexcept { PRINT("call to lambda UEH"); lambda_ueh++; }; +}; + +template <> +struct std::coroutine_traits +{ using promise_type = pt_c; }; + +static pt_c::handle_t +foo () +{ + throw ("foo"); + co_return; +} + +template <> +struct std::coroutine_traits +{ using promise_type = pt_d; }; + +static pt_d::handle_t +bar () +{ + throw ("bar"); + co_return; +} + +int main () +{ + foo (); + bar (); + if (called_ueh_op != 1 || lambda_ueh != 1) +{ + PRINT ("Failed to call one of the UEH cases"); + abort (); +} +} -- Nathan Sidwell

Re: [PATCH] coroutines: Handle awaiters that are sub-objects [PR95736]

2020-06-26 Thread Nathan Sidwell
promise_type::coro_handle handle; +}; + +struct bar { + bar() = default; + bar(const bar&) = delete; + + footable foo{}; + footask task = taskfun(); + + footask taskfun() noexcept { + std::cout << "coro begin" << std::endl; + co_await foo; + std::cout << "coro end" << std::endl; + } +}; + +int main() { + bar foobar; + foobar.foo(); + assert(foobar.task.handle.done()); + std::cout << "releasing" << std::endl; + foobar.foo.release(); + std::cout << "done" << std::endl; + return 0; +} -- Nathan Sidwell

Re: [PATCH] coroutines: Collect the function body rewrite code.

2020-06-29 Thread Nathan Sidwell
) - warning_at (fn_start, 0, "no member named %qE in %qT", - coro_unhandled_exception_identifier, - get_coroutine_promise_type (orig)); -} - /* Else we don't check and don't care if the method is missing. */ - /* Start to build the final functions. We push_deferring_access_checks to avoid these routines being seen as @@ -4671,7 +4553,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) /* Build the actor... */ build_actor_fn (fn_start, coro_frame_type, actor, fnbody, orig, param_uses, - &local_var_uses, param_dtor_list, initial_await, final_await, + &local_var_uses, param_dtor_list, fs_label, resume_fn_field, body_aw_points.await_number, frame_size); /* Destroyer ... */ -- Nathan Sidwell

Re: [PATCH][RFC] Do not stream all zeros for gcda files.

2020-06-30 Thread Nathan Sidwell
a compatible manner. nathan -- Nathan Sidwell

c++: Tweak function cloning names

2020-06-30 Thread Nathan Sidwell
ction_decl): Likewise. (instantiate_template_1): Likewise. libcc1/ * libcp1plugin.cc (plugin_build_decl): Adjust clone_function_decl call. -- Nathan Sidwell diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 94a95854e25..b0cc027e0de 100644 --- a/gcc/cp/cla

Re: [PATCH][RFC] Do not stream all zeros for gcda files.

2020-07-01 Thread Nathan Sidwell
On 7/1/20 3:15 AM, Martin Liška wrote: On 6/30/20 3:24 PM, Nathan Sidwell wrote: On 6/30/20 8:53 AM, Martin Liška wrote: Yes, if there's a real need for a solid compression, then I would use a generic compressor of a final streamed file. for avoidance of doubt, I'm good with yo

c++: Expose cloning form predicates

2020-07-01 Thread Nathan Sidwell
that might need these. On the modules branch I need to clone cdtors before the underlying class information is necessarily complete. There build_cdtor_clones is externally callable to facilitate that. nathan -- Nathan Sidwell diff --git a/gcc/cp/class.c b/gcc/cp/class.c index b0cc027e0de

Re: [PATCH] analyzer: Fix -Wanalyzer-possible-null-argument warning

2020-07-01 Thread Nathan Sidwell
t log. OK for master? ok -- Nathan Sidwell

Re: [PATCH] c++: Allow empty-declaration in C++11 and later (PR 96068)

2020-07-06 Thread Nathan Sidwell
-declaration in C++98. gcc/testsuite/ChangeLog: * g++.old-deja/g++.bugs/900404_04.C: Add c++98_only selector to dg-error for extra ';'. * g++.old-deja/g++.law/missed-error2.C: Likewise. Tested x86_64-linux, OK for trunk? ok thanks. -- Nathan Sidwell

c++: Always use pushdecl for exception library helpers

2020-07-06 Thread Nathan Sidwell
g/eh/builtin7.C: Likewise. * g++.dg/eh/builtin9.C: Likewise. * g++.dg/parse/crash55.C: Likewise. -- Nathan Sidwell

c-family: token streamer

2020-11-17 Thread Nathan Sidwell
that functionality. pushing to trunk -- Nathan Sidwell diff --git i/gcc/c-family/c-ppoutput.c w/gcc/c-family/c-ppoutput.c index 44c6f30e06b..517de15d97c 100644 --- i/gcc/c-family/c-ppoutput.c +++ w/gcc/c-family/c-ppoutput.c @@ -304,120 +304,18 @@ token_streamer::stream (cpp_reader *pfile, const

langhooks: preprocessor hooks for c++ modules

2020-11-17 Thread Nathan Sidwell
is do_streamer, call preprocess_token lang hook. (scan_translation_unit_directives_only): Use do_streamer. (print_line_1): Move src_line recording to after string output. (cb_undef): Maybe call preprocess_undef lang hook. pushing to trunk -- Nathan Sidwell diff --

preprocessor: Fix profiled bootstrap warning [pr97858]

2020-11-17 Thread Nathan Sidwell
As Jakub points out, we only ever pass a single variadic parm (if at all), so just an optional arg is fine. PR 97858 libcpp/ * mkdeps.c (munge): Drop varadic args, we only ever use one. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/mkdeps.c w/libcpp/mkdeps.c

preprocessor: module line maps

2020-11-17 Thread Nathan Sidwell
: New, broken out of ... (linemap_macro_map_lookup): ... here. Call it. (linemap_dump): Add module dump. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/include/line-map.h w/libcpp/include/line-map.h index 44008be5c08..50b2e4ff91a 100644 --- i/libcpp/include/line-map.h +++ w/libcpp/include

preprocessor: new callbacks

2020-11-17 Thread Nathan Sidwell
): Add user_deferred_macro & translate_include. pushing to trunk -- Nathan Sidwell diff --git c/libcpp/include/cpplib.h w/libcpp/include/cpplib.h index 8e398863cf6..81be6457951 100644 --- c/libcpp/include/cpplib.h +++ w/libcpp/include/cpplib.h @@ -680,6 +695,9 @@ struct cpp_callb

global trees

2020-11-17 Thread Nathan Sidwell
/ * c-common.h (enum c_tree_index): Reorder to place lazy fields after newly-added CTI_MODULE_HWM. gcc/cp/ * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields after newly-added CPTI_MODULE_HWM. Pushing to trunk -- Nathan Sidwell diff --git i/gcc/c

c++: duplicate block-scope extern [PR 97877]

2020-11-17 Thread Nathan Sidwell
xtend decl_lang_specific checking assert. gcc/testsuite/ * g++.dg/lookup/pr97877.C: New. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/decl.c w/gcc/cp/decl.c index 89bae06cd6b..d90e9840f40 100644 --- i/gcc/cp/decl.c +++ w/gcc/cp/decl.c @@ -2452,6 +2452,20 @@ duplicate_

extend cache_integer_cst

2020-11-17 Thread Nathan Sidwell
icate. applying to trunk -- Nathan Sidwell diff --git i/gcc/tree.c w/gcc/tree.c index 569a9b9317b..004385548c9 100644 --- i/gcc/tree.c +++ w/gcc/tree.c @@ -1755,8 +1755,15 @@ wide_int_to_tree (tree type, const poly_wide_int_ref &value) return build_poly_int_cst (type, value);

preprocessor: Update mkdeps for modules

2020-11-18 Thread Nathan Sidwell
enabled. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/include/cpplib.h w/libcpp/include/cpplib.h index d2324266d39..75d4d0a9f2f 100644 --- i/libcpp/include/cpplib.h +++ w/libcpp/include/cpplib.h @@ -528,6 +528,9 @@ struct cpp_options one. */ bool phony_targets

preprocessor: Add support for header unit translation

2020-11-18 Thread Nathan Sidwell
eader_unit): Declare. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/files.c w/libcpp/files.c index d73177aa1ee..b5d9f30297e 100644 --- i/libcpp/files.c +++ w/libcpp/files.c @@ -111,6 +111,9 @@ struct _cpp_file /* If this file is implicitly preincluded. */ bool implicit_preinclude : 1; +

preprocessor: C++ module-directives

2020-11-18 Thread Nathan Sidwell
1): Deal with directive_file_token triggering. pushing to trunk -- Nathan Sidwell diff --git i/gcc/c-family/c-lex.c w/gcc/c-family/c-lex.c index 8dd1420d10d..c8d33d0c9d1 100644 --- i/gcc/c-family/c-lex.c +++ w/gcc/c-family/c-lex.c @@ -667,8 +667,11 @@ c_lex_with_flags (tree *value, locatio

Re: [32/32] fixinclude

2020-11-18 Thread Nathan Sidwell
truct type. Fixed by naming the struct. fixincludes/ * inclhack.def (aix_physaddr_t): New. * fixincl.x: Regenerated. nathan -- Nathan Sidwell diff --git c/fixincludes/fixincl.x w/fixincludes/fixincl.x index 758d5620641..21439652bce 100644 --- c/fixincludes/fixincl.x

preprocessor: main-file cleanup

2020-11-19 Thread Nathan Sidwell
_report_missing_guards): Adjust. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/directives.c w/libcpp/directives.c index c4ecb9657e5..bffdc913adb 100644 --- i/libcpp/directives.c +++ w/libcpp/directives.c @@ -877,7 +877,7 @@ do_include_next (cpp_reader *pfile) /* If this is the primary

preprocessor: main file searching

2020-11-19 Thread Nathan Sidwell
ocate main file. Set main_loc * files.c (cpp_retrofit_as_include): New. pushing to trunk. nathan -- Nathan Sidwell diff --git i/libcpp/files.c w/libcpp/files.c index ba52d2bf3cf..301b2379a23 100644 --- i/libcpp/files.c +++ w/libcpp/files.c @@ -1131,6 +1131,37 @@ cpp_find_header

c++: Relax new assert [PR 97905]

2020-11-19 Thread Nathan Sidwell
It turns out there are legitimate cases for the new decl to not have lang-specific. PR c++/97905 gcc/cp/ * decl.c (duplicate_decls): Relax new assert. gcc/testsuite/ * g++.dg/lookup/pr97905.C: New. pushing to trunk -- Nathan Sidwell diff --git c/gcc/cp

config: Add tests for modules-desired features

2020-11-19 Thread Nathan Sidwell
/ * configure.ac: Add tests for fstatat, sighandler_t, O_CLOEXEC, unix-domain and ipv6 sockets. * config.in: Rebuilt. * configure: Rebuilt. pushing to trunk -- Nathan Sidwell diff --git c/gcc/configure.ac w/gcc/configure.ac index b2732d17bf4..1cce371a9e1 100644

<    5   6   7   8   9   10   11   12   13   14   >