Re: libgo: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH 3/4] libgo/test: Fix compilation for build sysroot)

2023-09-12 Thread Ian Lance Taylor via Gcc-patches
On Tue, Sep 12, 2023 at 4:16 AM Thomas Schwinge wrote: > > As we've found, this is conceptually problematic, as discussed in > > "Consider '--with-build-sysroot=[...]' for target libraries' build-tree > testing (instead of

godump.cc patch committed: Handle _BitInt

2023-09-06 Thread Ian Lance Taylor via Gcc-patches
This patch to godump.cc adds support for BITINT_TYPE. Bootstrapped and ran godump and Go tests on x86_64-pc-linux-gnu. Committed to mainline. Ian gcc/ PR go/111310 * godump.cc (go_format_type): Handle BITINT_TYPE. gcc/testsuite/ PR go/111310 *

libgo patch committed: permit $AR to include options

2023-09-06 Thread Ian Lance Taylor via Gcc-patches
This libgo patch changes the go tool to permit the AR environment variable to include options. This mirrors the way it already handles the CC environment variable. This ports https://go.dev/cl/526275 to the gofrontend repo. This is needed for gccgo testing because the top-level GCC Makefile now

Re: [RFC] GCC Security policy

2023-08-08 Thread Ian Lance Taylor via Gcc-patches
On Tue, Aug 8, 2023 at 7:37 AM Jakub Jelinek wrote: > > BTW, I think we should perhaps differentiate between production ready > libraries (e.g. libgcc, libstdc++, libgomp, libatomic, libgfortran, > libquadmath, > libssp) vs. e.g. the sanitizer libraries which are meant for debugging and > I

Re: [RFC] GCC Security policy

2023-08-08 Thread Ian Lance Taylor via Gcc-patches
On Tue, Aug 8, 2023 at 6:02 AM Jakub Jelinek via Gcc-patches wrote: > > On Tue, Aug 08, 2023 at 02:52:57PM +0200, Richard Biener via Gcc-patches > wrote: > > There's probably external tools to do this, not sure if we should replicate > > things in the driver for this. > > > > But sure, I think

Re: [PATCH] [libbacktrace] fix up broken test

2023-08-03 Thread Ian Lance Taylor via Gcc-patches
On Thu, Aug 3, 2023 at 6:27 AM Richard Biener via Gcc-patches wrote: > > zstdtest has some inline data where some testcases lack the > uncompressed length field. Thus it computes that but still > ends up allocating memory for the uncompressed buffer based on > that (zero) length. Oops. Causes

libbacktrace patch committed

2023-07-31 Thread Ian Lance Taylor via Gcc-patches
This libbacktrace patch, based on one by Andres Freund, uses the _pgmptr variable declared on Windows to find the executable file name if none is specified. Bootstrapped and ran libbacktrace testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Patch from Andres Freund: * configure.ac:

libgo patch committet: Don't collect package CGOLDFLAGS

2023-07-20 Thread Ian Lance Taylor via Gcc-patches
This libgo patch to the go command sources stops collecting package CGOLDFLAGS when using gccgo. The flags are already collected via cmd/cgo. The gccgo_link_c test is tweaked to do real linking as with this change the cgo ldflags are not fully reflected in go build -n output, since they now only

Re: Merge from trunk to gccgo branch

2023-06-26 Thread Ian Lance Taylor via Gcc-patches
I merged trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0 to the gccgo branch. Ian

Go patch committed: Support -fgo-importcfg

2023-06-26 Thread Ian Lance Taylor via Gcc-patches
The gc Go compiler has a -importcfg option that takes a file that provides a mapping from import paths to the files that satisfy those imports. This is used by the go build tool to let the compiler read imported packages directly out of the build cache. Without this option the go build tool has

Go patch committed: Support bootstrapping Go 1.21

2023-06-23 Thread Ian Lance Taylor via Gcc-patches
compiler, libgo: support bootstrapping gc compiler In the Go 1.21 release the package internal/profile imports internal/lazyregexp. That works when bootstrapping with Go 1.17, because that compiler has internal/lazyregep and permits importing it. We also have internal/lazyregexp in libgo, but

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-22 Thread Ian Lance Taylor via Gcc-patches
On Thu, Jun 22, 2023, 4:47 PM Peter Bergner wrote: > On 6/22/23 6:37 PM, Peter Bergner via Gcc-patches wrote: > > On 6/16/23 12:01 PM, Ian Lance Taylor via Gcc-patches wrote: > >> On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches > >> wrote: > &

Go patch committed: Determine types of Slice_{value, info} expressions

2023-06-21 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend determines the types of a couple of expressions types that accidentally failed to recurse into their subexpressions. The test case for this is https://go.dev/cl/505015. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

Merge from trunk to gccgo branch

2023-06-21 Thread Ian Lance Taylor via Gcc-patches
I merged trunk revision 577223aebc7acdd31e62b33c1682fe54a622ae27 to the gccgo branch. Ian

Re: libgo patch committed: Use a C function to call mmap

2023-06-20 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 20, 2023 at 11:35 AM Andreas Schwab wrote: > > On Jun 20 2023, Ian Lance Taylor via Gcc-patches wrote: > > > This libgo patches changes the runtime pacakge to use a C function to call > > mmap. > > > > The final argument to mmap, of type off_t, varies

libgo patch committed: Use a C function to call mmap

2023-06-20 Thread Ian Lance Taylor via Gcc-patches
This libgo patches changes the runtime pacakge to use a C function to call mmap. The final argument to mmap, of type off_t, varies. In https://go.dev/cl/445375 (https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604158.html) we changed it to always use the C off_t type, but that broke 32-bit

libgo patch committed: Add benchmarks and examples to test list

2023-06-16 Thread Ian Lance Taylor via Gcc-patches
In https://go.dev/cl/384695 (https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590289.html) I simplified the code that built lists of benchmarks, examples, and fuzz tests, and managed to break it. This patch corrects the code to once again make the benchmarks available, and to run the

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-16 Thread Ian Lance Taylor via Gcc-patches
On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches wrote: > > TARGET_AIX is defined to a non-zero value on linux and maybe other > powerpc64le targets. This leads to unexpected behavior such as > dropping the .go_export section when linking a shared library > on linux/powerpc64le. >

Re: [PATCH] libgcc: Use initarray section type for .init_stack

2023-05-31 Thread Ian Lance Taylor via Gcc-patches
On Wed, May 31, 2023 at 12:41 AM Kewen.Lin via Gcc-patches wrote: > > >> libgcc/ChangeLog: > >> > >> * config/i386/morestack.S: Use @init_array rather than > >> @progbits for section type of section .init_array. > >> * config/rs6000/morestack.S: Likewise. > >> *

libgo patch committed: Add syscall.prlimit

2023-05-11 Thread Ian Lance Taylor via Gcc-patches
As of https://go.dev/cl/476695 the package golang.org/x/sys/unix expects a syscall.prlimit function to exist. This libgo patch adds that function. This is for https://go.dev/issue/46279 and https://go.dev/issue/59712. Since this is a small patch and is needed to compile the widely used

libgo patch committed: Remove test ordering dependency in mime

2023-04-07 Thread Ian Lance Taylor via Gcc-patches
This libgo patch removes a test ordering dependency in the mime package. This is a backport of https://go.dev/cl/421442 from the upstream repo. This fixes https://go.dev/issue/51648. Bootstrapped and ran mime tests on x86_64-pc-linux-gnu. Committed to mainline. Ian

Merge from trunk to gccgo branch

2023-03-29 Thread Ian Lance Taylor via Gcc-patches
I merged trunk revision aa8f4242efc99f24de73c59d53996f28db28c13f to the gccgo branch. Ian

Go patch committed: Mark Call_expression multi-results as result struct

2023-03-28 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend marks a Call_expression multiple results struct as a result struct. In https://go.dev/cl/343873 we stopped padding zero-sized trailing fields in functions that return multiple results where the last result is zero-sized. This CL makes the corresponding change on the

libbacktrace patch committed: Tweaks to zstd decompression

2023-03-28 Thread Ian Lance Taylor via Gcc-patches
In looking over the recently committed support for zstd decompression in libbacktrace, I found a few minor cases that needed fixing. Bootstrapped and tested on x86_64-pc-linux-gnu. Committed to mainline. Ian * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading bits, not before. Add

Go patch committed: Add missing Slice_info_expression::do_traverse

2023-03-22 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend adds the missing Slice_info_expression::do_traverse method. Lack of the method caused https://go.dev/issue/59169. The test case is https://go.dev/cl/478217. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline and GCC 12 branch. Ian

Add notes for Go to gcc 12 and 13 changes file

2023-03-20 Thread Ian Lance Taylor via Gcc-patches
I committed this patch to the gcc-wwwdocs repo to add some notes about Go to the gcc 12 and 13 changes file. Ian pat e24f9ef56c11c69fc07bddf9a708ea2fc662f2b3 diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index c47d3285..d565c217 100644 --- a/htdocs/gcc-12/changes.html +++

Re: Now gcc-13: [Fwd: [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd.]

2023-03-15 Thread Ian Lance Taylor via Gcc-patches
On Wed, Mar 15, 2023 at 9:14 AM Svante Signell wrote: > > Package: gcc-snapshot > Version: 1:20230315-1 > Severity: important > Tags: patch > User: debian-h...@lists.debian.org > Usertags: hurd > Affects: gcc-snapshot > X-Debbugs-CC: debian-h...@lists.debian.org > > Hello, seems like the patch

Re: [PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-03-05 Thread Ian Lance Taylor via Gcc-patches
On Fri, Mar 3, 2023 at 10:47 PM Xi Ruoyao wrote: > > On Sat, 2023-01-07 at 06:52 +, Jonathan Yong via Gcc-patches wrote: > > On 1/6/23 18:10, Jakub Jelinek wrote: > > > On Sat, Jan 07, 2023 at 02:01:05AM +0800, LIU Hao via Gcc-patches > > > wrote: > > > > libgomp/ > > > > > > > > PR

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-02-05 Thread Ian Lance Taylor via Gcc-patches
On Sun, Feb 5, 2023 at 1:21 AM Björn Schäpers wrote: > > Am 24.01.2023 um 19:32 schrieb Ian Lance Taylor: > > On Tue, Jan 24, 2023 at 10:12 AM Eli Zaretskii via Gcc-patches > > wrote: > >> > >>> From: Ian Lance Taylor > >>> Date: Tue, 24 Jan 2023 09:58:10 -0800 > >>> Cc: g...@hazardy.de,

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jan 24, 2023 at 10:12 AM Eli Zaretskii via Gcc-patches wrote: > > > From: Ian Lance Taylor > > Date: Tue, 24 Jan 2023 09:58:10 -0800 > > Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > > > > I'd rather that the patch look like the appended. Can someone with a > >

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jan 24, 2023 at 8:53 AM Eli Zaretskii via Gcc-patches wrote: > > > From: Ian Lance Taylor > > Date: Tue, 24 Jan 2023 06:35:21 -0800 > > Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > > > > > > On Windows it seems that MAX_PATH is not > > > > a true limit, as an extended

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jan 24, 2023 at 5:11 AM Eli Zaretskii via Gcc-patches wrote: > > > Date: Mon, 23 Jan 2023 15:00:56 -0800 > > Cc: gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > > From: Ian Lance Taylor via Gcc > > > > > +#ifdef HAVE_WINDOWS_H > > > + > > > +static char * > > > +windows_get_executable_path

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-23 Thread Ian Lance Taylor via Gcc-patches
On Fri, Jan 20, 2023 at 2:56 AM Björn Schäpers wrote: > > From: Björn Schäpers > > This is actually needed so that libstdc++'s implementation > to be able to work on windows. > > Tested on x86_64-linux and i686-w64-mingw32. > > -- >8 -- > > * configure.ac: Add a check for windows.h. >

Re: [PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2023-01-20 Thread Ian Lance Taylor via Gcc-patches
On Fri, Jan 20, 2023 at 2:54 AM Björn Schäpers wrote: > > From: Björn Schäpers > > It's the right thing to do, since the PC shouldn't go out of the > uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. > This is a preparation for a following patch. > > Tested on x86_64-linux and

Go patch committed: Define builtin functions

2023-01-17 Thread Ian Lance Taylor via Gcc-patches
This patch by Andrew Pinski defines two builtin functions that are used by the middle-end. This fixes PR 108426. Bootstrapped and tested on x86_64-pc-linux-gnu. Committed to mainline. Ian PR go/108426 * go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_ctzl and

libbacktrace patch committed: Only test --build-id if supported

2023-01-06 Thread Ian Lance Taylor via Gcc-patches
PR 108297 points out that there are systems that use ELF but for which the linker does not support the --build-id option. This libbacktrace patch skips --build-id tests when it doesn't work. Bootstrapped and ran libbacktrace tests on x86_64-pc-linux-gnu. Committed to mainline. Ian PR

Re: [PATCH] go: fix clang warnings

2022-12-22 Thread Ian Lance Taylor via Gcc-patches
On Wed, Dec 21, 2022 at 12:05 AM Martin Liška wrote: > > The patch fixes the following Clang warnings: > > gcc/go/gofrontend/escape.cc:1290:17: warning: private field 'fn_' is not used > [-Wunused-private-field] > gcc/go/gofrontend/escape.cc:3478:19: warning: private field 'context_' is not >

Re: [PATCH] libgo: check if -lucontext is required for {make, set, get}context

2022-12-20 Thread Ian Lance Taylor via Gcc-patches
On Mon, Dec 19, 2022 at 8:59 AM wrote: > > From: Sören Tempel > > This patch is similar to the existing check for librt. If libucontext > is installed and libucontext.a provides the aforementioned symbols, then > it is added to $LIBS. If not, no error is emitted. We could, > alternatively, also

Re: Add zstd support to libbacktrace

2022-12-16 Thread Ian Lance Taylor via Gcc-patches
Some more tweaks of the libbacktrace zstd decompressor to make decompressing slightly faster: unpack all the literal data into the output buffer, rather than using scratch space. Bootstrapped and ran libbacktrace tests on x86_64-pc-linux-gnu. Committed to mainline. Ian * elf.c

libgo patch committed: Bump major version

2022-12-12 Thread Ian Lance Taylor via Gcc-patches
This libgo patch bumps the major version. The current version is the same as for GCC 12, but there have been minor changes like new type descriptors that make it impossible to run Go programs built with GCC 12 with the current GCC. This fixes https://gcc.gnu.org/PR108057. Bootstrapped on

Re: Add zstd support to libbacktrace

2022-12-09 Thread Ian Lance Taylor via Gcc-patches
On Wed, Dec 7, 2022 at 4:22 PM Ian Lance Taylor wrote: > > This patch adds zstd support to libbacktrace, to support the new > linker option --compress-debug-sections=zstd. This patch rewrites and simplifies the main zstd decompression loop using some ideas from the reference implementation.

Add zstd support to libbacktrace

2022-12-07 Thread Ian Lance Taylor via Gcc-patches
This patch adds zstd support to libbacktrace, to support the new linker option --compress-debug-sections=zstd. The zstd format is fairly complicated, so it's likely that there are some bugs here. It does pass the tests, at least. Unfortunately this decompressor only runs at about 1/3 the speed

Re: [PATCH v2] libgo: Don't rely on GNU-specific strerror_r variant on Linux

2022-11-30 Thread Ian Lance Taylor via Gcc-patches
On Tue, Nov 29, 2022 at 4:10 PM Ian Lance Taylor wrote: > > On Tue, Nov 29, 2022 at 9:54 AM wrote: > > > > From: Sören Tempel > > > > On glibc, there are two versions of strerror_r: An XSI-compliant and a > > GNU-specific version. The latter is only available on glibc. In order > > to avoid

Re: [PATCH v2] libgo: Don't rely on GNU-specific strerror_r variant on Linux

2022-11-29 Thread Ian Lance Taylor via Gcc-patches
On Tue, Nov 29, 2022 at 9:54 AM wrote: > > From: Sören Tempel > > On glibc, there are two versions of strerror_r: An XSI-compliant and a > GNU-specific version. The latter is only available on glibc. In order > to avoid duplicating the post-processing code of error messages, this > commit

Re: [PATCH] lto: Stream current working directory for first streamed relative filename and adjust relative paths [PR93865]

2022-11-14 Thread Ian Lance Taylor via Gcc-patches
On Thu, Sep 10, 2020 at 1:39 AM Jakub Jelinek via Gcc-patches wrote: > > If the gcc -c -flto ... commands to compile some or all objects are run in a > different directory (or in different directories) from the directory in > which the gcc -flto link line is invoked, then the .debug_line will be

Go patch committed: Define __atomic_fetch_add functions

2022-11-09 Thread Ian Lance Taylor via Gcc-patches
This patch to the GCC-specific part of the Go frontend defines the __atomic_fetch_add functions. The frontend only generates calls to the __atomic_add_fetch functions, but in some cases the middle-end can transform the latter into the former. This patch is originally by Marc Poulhiès. This

Re: [PATCH] libgo: use _off_t for mmap offset argument

2022-10-27 Thread Ian Lance Taylor via Gcc-patches
On Sat, Oct 22, 2022 at 6:45 AM Sören Tempel wrote: > > PING. > > soe...@soeren-tempel.net wrote: > > From: Sören Tempel > > > > On glibc-based systems, off_t is a 32-bit type on 32-bit systems and a > > 64-bit type on 64-bit systems by default. However, on systems using musl > > libc off_t is

Go patch committed: Treat S("") as a string constant

2022-10-10 Thread Ian Lance Taylor via Gcc-patches
This Go frontend patch treats S("") as a string constant. The compiler neglected to notice that a conversion from a string constant to a string type was a valid string constant. I didn't add a test case because this only caused a compiler failure when compiling without optimization, which is not

Go patch committed: Only build thunk struct type when needed

2022-10-10 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend delays building the struct type for a go/defer thunk until it is needed. We were building it in the determine_types pass. Now, we delay until the simplify_thunk_statements pass. That ensures that we are consistent in determining whether an argument is constant.

Go patch committed: better argument checking for builtins

2022-10-06 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend by Than McIntosh does some better argument type checking for some builtin functions. This avoids a compiler crash on cases like panic(panic("bad")). This fixes https://go.dev/issue/56071. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to

Re: [PATCH v2] libgo: Portable access to thread ID in struct sigevent

2022-09-27 Thread Ian Lance Taylor via Gcc-patches
On Fri, Sep 23, 2022 at 6:59 AM wrote: > > From: Sören Tempel > > Tested on x86_64 Arch Linux (glibc) and Alpine Linux (musl libc). > > Previously, libgo relied on the _sigev_un implementation-specific > field in struct sigevent, which is only available on glibc. This > patch uses the

libgo patch committed: Synchronize empty struct field handling

2022-09-27 Thread Ian Lance Taylor via Gcc-patches
This libgo patch by Funan Zeng synchronizes the handling of empty struct fields between the Go frontend and the libgo FFI code. In the compiler the logic for allocating one byte for the last field of a struct is: 1. the last field has zero size 2. the struct itself does not have zero size 3. the

Merge from trunk to gccgo branch

2022-09-22 Thread Ian Lance Taylor via Gcc-patches
I've merged trunk revision f35be1268c996d993ab0b4ff329734d467474445 to the gccgo branch. Ian

libgo patch committed: Add cgo.Incomplete

2022-09-22 Thread Ian Lance Taylor via Gcc-patches
This libgo patch changes the cgo command to use runtime/cgo.Incomplete instead of //go:notinheap, and to define the new type in the runtime/cgo package. This ports https://go.dev/cl/421879 to libgo. This is a quick port to update libgo to work with the version of cgo in gc mainline. A more

Re: libgo patch committed: Make runtime.Version return a useful value

2022-09-13 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 28, 2022 at 10:20 AM Ian Lance Taylor wrote: > > This libgo patch makes runtime.Version return a meaningful string. > This also means that "go version" will print something useful, e.g., > > go version go1.18 gccgo (GCC) 12.0.1 20220216 (experimental) linux/amd64 > > This fixes

Re: libgo patch committed: Ignore __morestack in runtime.Callers

2022-09-13 Thread Ian Lance Taylor via Gcc-patches
On Tue, Sep 6, 2022 at 6:40 PM Ian Lance Taylor wrote: > > This libgo patch ignores the __morestack function in runtime.Callers. > We were ignoring all functions starting with "__morestack_", but not > the function "__morestack" itself. Without this change, some tests > such as recover.go

libgo patch committed: Ignore __morestack in runtime.Callers

2022-09-06 Thread Ian Lance Taylor via Gcc-patches
This libgo patch ignores the __morestack function in runtime.Callers. We were ignoring all functions starting with "__morestack_", but not the function "__morestack" itself. Without this change, some tests such as recover.go started failing recently, though I'm not sure exactly what changed.

Re: [PATCH] PR bootstrap/106472: Add libgo depends on libbacktrace to Makefile.def

2022-07-30 Thread Ian Lance Taylor via Gcc-patches
On Sat, Jul 30, 2022 at 2:38 PM Roger Sayle wrote: > > > This patch fixes PR bootstrap/106472 by adding a missing dependency > to Makefile.def to allow make bootstrap when configured using > "--enable-languages=go" (and not using make with multiple threads). > > Tested on x86-64-pc-linux-gnu. Ok

Re: [PATCH] libgo: Explicitly define SYS_timer_settime for 32-bit musl targets

2022-07-30 Thread Ian Lance Taylor via Gcc-patches
On Thu, Jul 28, 2022 at 11:15 AM wrote: > > From: Sören Tempel > > On 32-bit systems, musl only defines SYS_timer_settime32 not > SYS_timer_settime. This causes the following compilation error: > > os_linux.go:251:30: error: reference to undefined name > '_SYS_timer_settime' >

Merge from trunk to gccgo branch

2022-07-27 Thread Ian Lance Taylor via Gcc-patches
I merged trunk revision 5eb9f117a361538834b9740d59219911680717d1 to the gccgo branch. Ian

Re: [PATCH] libgo: make match.sh POSIX-shell compatible

2022-07-22 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jul 19, 2022 at 11:35 PM wrote: > > From: Sören Tempel > > The `(( expression ))` syntax is a Bash extension and not supported by > POSIX shell [1]. However, the arithmetic expressions used by the > gobuild() function can also be expressed using arithmetic POSIX > expansions with `$((

Re: libgo patch committed: Don't include in sysinfo.c

2022-07-21 Thread Ian Lance Taylor via Gcc-patches
On Thu, Jul 21, 2022 at 4:53 AM Martin Liška wrote: > > On 7/21/22 12:19, Richard Biener via Gcc-patches wrote: > > On Wed, Jul 13, 2022 at 6:03 PM Ian Lance Taylor via Gcc-patches > > wrote: > >> > >> This libgo patch stops including when building > &g

Go patch committed: Handle f().x if f returns a zero-sized type

2022-07-16 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend handles the case of f().x when the function f returns a zero-sized type. In that case the GCC interface will have changed f to return void, as the GCC middle-end does not have complete support for zero-sized types. This patch handles the case of void when in a

Go patch committed: Don't crash on f(g()) if g returns a zero-sized value

2022-07-15 Thread Ian Lance Taylor via Gcc-patches
This patch to the GCC interface of the Go frontend fixes a crash in f(g()) if g returns a zero-sized value. In that case the GCC interface modifies g to return void, since GCC's middle-end does not have solid support for zero-sized values. This patch detects the f(g()) case and replaces the call

libgo patch committed: Don't include in sysinfo.c

2022-07-13 Thread Ian Lance Taylor via Gcc-patches
This libgo patch stops including when building gen-sysinfo.go. Removing this doesn't change anything at least with glibc 2.33. The include was added in https://go.dev/cl/6100049 but it's not clear why. This should fix GCC PR 106266. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.

libbacktrace patch committed: Check for sys/link.h

2022-07-08 Thread Ian Lance Taylor via Gcc-patches
Apparently QNX declares dl_iterate_phdr and friends in sys/link.h rather than link.h. This patch updates libbacktrace to check there. This fixes https://github.com/ianlancetaylor/libbacktrace/issues/86. Bootstrapped and ran libbacktrace testsuite on x86_64-pc-linux-gnu. Committed to mainline.

libbacktrace patch committed: Don't exit Mach-O dyld loop on failure

2022-07-07 Thread Ian Lance Taylor via Gcc-patches
This libbacktrace patch changes the loop over dynamic libraries on Mach-O to keep going if we fail to find the debug info for a particular library. We can still pick up debug info for other libraries even if one fails. Tested on x86_64-pc-linux-gnu which admittedly does little, but others have

libbacktrace patch committed: Don't let "make clean" remove allocfail.sh

2022-07-07 Thread Ian Lance Taylor via Gcc-patches
The script allocfail.sh was being incorrectly removed by "make clean". This patch fixes the problem. This fixes https://github.com/ianlancetaylor/libbacktrace/issues/81. Ran libbacktrace "make check" and "make clean" on x86_64-pc-linux-gnu. Committed to mainline. Ian For

Go patch committed: Propagate array length error marker

2022-07-05 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend propagates the array length error marker farther, to avoid a compiler crash on invalid code. This fixes https://go.dev/issue/53639. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian c70a48a8f8f6a43b35f783b5672c9a3c0a363c31 diff

Go patch committed: Better error message for unknown package name

2022-07-05 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend gives a better error message for an unknown package name, saying "undefined reference" rather than "expected package". This requires updating a test. This fixes https://go.dev/issue/51237. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to

Go patch committe: Use correct init order for multi-value init

2022-07-01 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend uses the correct initialization order for code like var a = c var b, c = x.(bool) The global c is initialized by the preinit of b, but we were missing a dependency of c on b, so a would be initialized to the zero value of c rather than the correct value. Simply

DSE patch RFA: Don't delete trapping insn

2022-07-01 Thread Ian Lance Taylor via Gcc-patches
The DSE pass can delete a dead store even if the instruction can trap. That is incorrect when using -fnon-call-exceptions -fno-delete-dead-exceptions. This led to a bug report against gccgo: https://go.dev/issue/53012. However, the bug is not specific to Go. This patch fixes the problem in a

Go patch committed: Avoid C++20 keyword requires

2022-07-01 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend renames "requires" to "needs" to avoid the C++20 keyword. Bootstrapped on x86_64-pc-linux-gnu. Committed to mainline. Ian 9d44418664ec8c3e59365901e3ec02e488d9e01c diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 0d49e9e70c6..65f64e0fbfb 100644

Re: [PATCH] mksysinfo: add support for musl libc

2022-06-30 Thread Ian Lance Taylor via Gcc-patches
On Thu, Jun 30, 2022 at 9:59 AM Sören Tempel wrote: > > Ian Lance Taylor wrote: > > Thanks for the info. Does this patch work? It tweaks the handling of > > SYS_SECCOMP to be specific to that constant. > > Yes, your patch works for me too on Alpine Linux Edge. Thanks. Committed to mainline.

Re: [PATCH] mksysinfo: add support for musl libc

2022-06-29 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 28, 2022 at 7:32 AM Sören Tempel wrote: > > Ian Lance Taylor wrote: > > Given that pretty much every one of these musl patches has led to > > problems on some glibc systems, it would be very nice if you could do > > some testing with glibc. Thanks. > > Sorry, my bad. > > I just

Go patch committed: Check repeated const expressions in new scop

2022-06-29 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend checks repeated const expressions in new scope, in case they refer to a newly defined name. The test case is const8.go in https://go.dev/cl/414795. This fixes https://go.dev/issue/53585. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to

Go patch committed: Use package path with embedded builtin

2022-06-28 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend changes the mangled name of a struct to use the package path with an embedded builtin type. The test case is https://go.dev/cl/414235. This fixes https://go.dev/issue/52856. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

libgo patch committed: Make runtime.Version return a useful value

2022-06-28 Thread Ian Lance Taylor via Gcc-patches
This libgo patch makes runtime.Version return a meaningful string. This also means that "go version" will print something useful, e.g., go version go1.18 gccgo (GCC) 12.0.1 20220216 (experimental) linux/amd64 This fixes https://go.dev/issue/51850. Bootstrapped and ran Go testsuite on

Go patch committed: Permit abstract bool expressions to remain abstract

2022-06-28 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend permits expressions of abstract bool to remain abstract, rather than forcing them into the named type bool. The test case for this is https://go.dev/cl/414755. This fixes https://go.dev/issue/51475. Bootstrarpped and ran Go testsuite on x86_64-pc-linux-gnu.

Re: [PATCH v2 3/7] libbacktrace: use grep instead of fgrep

2022-06-27 Thread Ian Lance Taylor via Gcc-patches
On Sun, Jun 26, 2022 at 11:10 PM Xi Ruoyao via Gcc-patches wrote: > > libbacktrace/ChangeLog: > > * configure.ac (AC_PROG_FGREP): Use grep instead of fgrep. > * configure: Regenerate. Thanks. Committed to mainline. Ian

Re: [PATCH] mksysinfo: add support for musl libc

2022-06-27 Thread Ian Lance Taylor via Gcc-patches
On Mon, Jun 27, 2022 at 9:47 AM wrote: > > From: Sören Tempel > > This patch addresses two minor compatibility issues with musl libc: > > * On some architecture (e.g. PowerPC), musl has more than one field > prefixed with st_{a,m,c}tim in struct stat. This causes the sed(1) > invocation to

Go patch committed: Don't use sink as method expression thunk parameter

2022-06-27 Thread Ian Lance Taylor via Gcc-patches
This Go frontend patch avoids using a sink name (_) as a parameter name when creating a method expression thunk. The patch also fixes a couple of cases where the error led to a later compiler crash. The test case is https://go.dev/cl/414336. This fixes https://go.dev/issue/52871. Bootstrapped

Go patch committed: Always initialize mpfr in integer import

2022-06-27 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend corrects the integer import code to always initialize an mpfr value. The test case for this is https://go.dev/cl/413980. This fixes https://go.dev/issue/52862. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

Go patch committed: Use bool for comma-ok if not already boolean

2022-06-24 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend uses bool for a comma-ok statement if the variable already has a type that is not a boolean type. This is a statement like v, ok := m[k] Otherwise we may try to convert an unnamed bool type to an interface type, which will fail. But we don't want to always use

Go patch committed: In Sort_bindings handle same value passed twice

2022-06-23 Thread Ian Lance Taylor via Gcc-patches
This patch by zhangjian to the Go frontend changes Sort_bindings to return false if comparing a value to itself. Apparently some versions of std::sort may pass elements at the same iterator location. This fixes https://go.dev/issue/53483. Bootstrapped and ran Go testsuite on

Go patch committed: unalias types for hash/equality functions

2022-06-23 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend makes sure to unalias types when creating hash/equality functions. This fixes https://go.dev/issue/52846. There is a test case at https://go.dev/cl/413694. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jun 21, 2022 at 8:16 AM Andreas Schwab wrote: > > On Jun 21 2022, Ian Lance Taylor via Gcc-patches wrote: > > > which seems to be Linux 3.13 and glibc 4.8.4. On that system I see > > That's stone age. I don't know who maintains these systems on the GCC compile farm. Ian

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-21 Thread Ian Lance Taylor via Gcc-patches
On Sat, Jun 18, 2022 at 8:59 AM Andreas Schwab wrote: > > On Jun 18 2022, Ian Lance Taylor wrote: > > > What target? > > aarch64-suse-linux, of course. Thanks. Sorry for missing that. > > What is the output of > > > > grep loff_t TARGET/libgo/gen-sysinfo.go > > type ___loff_t int64 > type

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-18 Thread Ian Lance Taylor via Gcc-patches
On Sat, Jun 18, 2022 at 12:19 AM Andreas Schwab wrote: > > ../../../libgo/go/syscall/libcall_linux.go:220:25: error: reference to > undefined name '_libgo_loff_t_type' > 220 | lroff = _libgo_loff_t_type(*roff) > | ^ >

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-17 Thread Ian Lance Taylor via Gcc-patches
On Tue, May 31, 2022 at 12:41 PM Sören Tempel wrote: > > PING. > > If there is anything else that needs to be addressed please let me know. Thanks. Committed as follows. Sorry for the delay. Ian e584afe7976a40df42eed4df6ce6852abab74030 diff --git a/gcc/go/gofrontend/MERGE

Go patch committed: Skip stubs for ambiguous direct iface methods

2022-06-16 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend by Михаил Аблакатов (Mikhail Ablakatov) avoids generating stubs for ambiguous direct interface methods. The current implementation checks whether it has to generate a stub method for a promoted method of an embedded struct field in Type::build_stub_methods(). If the

libgo patch committed: Format the syscall package

2022-06-14 Thread Ian Lance Taylor via Gcc-patches
This Go formatter is starting to format documentation comments in some cases. As a step toward that in libgo, this patch adds blank lines after //sys comments in the syscall package where needed, and then runs the new formatter on the syscall package files. This is the libgo version of

libbacktrace patch committed: Update README

2022-05-28 Thread Ian Lance Taylor via Gcc-patches
This patch updates the libbacktrace README to a near copy of the one from github.com/ianlancetaylor/libbacktrace. Committed to mainline. This fixes GCC PR 105721. Ian * README: Update. 6cf19361732bd7f8b41716ef9f4b5c205a3193b8 diff --git a/libbacktrace/README b/libbacktrace/README index

Re: libiberty: Would it be reasonable to add support for GnuCOBOL function name demangling?

2022-05-27 Thread Ian Lance Taylor via Gcc-patches
On Fri, May 27, 2022 at 12:17 AM Simon Sobisch via Gcc-patches wrote: > > As noted: the first question is: is it reasonable to add support for > GnuCOBOL? It seems fine to me to add support for demangling GnuCOBOL symbol names controlled by a DMGL option (options are defined in

Go patch committed: Traverse expressions with exporting consts

2022-05-18 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend by Julia Lapenko traverses expressions when exporting constants. When exporting a constant A that is expressed through a constant B from another package, it is necessary to traverse an expression representing the constant A to generate a sequence of type casts from

Go patch committed: load LHS subexpressions of op= only once

2022-05-17 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend loads LHS subexpressions of op= assignment only once. This avoids inconsistencies if the variables are changed by evaluating the RHS. This fixes https://go.dev/issue/52811. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. There is

Re: [PATCH] c: use CONST_DECL for enumerators in TYPE_VALUES

2022-05-17 Thread Ian Lance Taylor via Gcc-patches
On Tue, May 17, 2022 at 2:46 PM Marek Polacek wrote: > > On Tue, May 17, 2022 at 09:35:14PM +, Joseph Myers wrote: > > On Tue, 17 May 2022, Marek Polacek via Gcc-patches wrote: > > > > > The C and C++ FEs differ in TYPE_VALUES for an enum type: an entry in > > > the list in the C++ FE has a

Go patch committed: Always sort interface parse methods

2022-05-13 Thread Ian Lance Taylor via Gcc-patches
This patch to the Go frontend always sorts interface parse methods. The exporter relies on sorting interface parse methods. It would sort them as it encountered interface types. However, when an interface type is an element of a struct or array type, the exporter might encounter that interface

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-12 Thread Ian Lance Taylor via Gcc-patches
On Thu, May 12, 2022 at 11:23 AM Sören Tempel via Gcc-patches wrote: > > The off64_t type is used for defining Offset_t: > > > https://github.com/golang/gofrontend/blob/4bdff733a0c2a9ddc3eff104b1be03df058a79c4/libgo/mksysinfo.sh#L406-L410 > > On musl, _HAVE_OFF64_T is defined since

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-05-09 Thread Ian Lance Taylor via Gcc-patches
On Sun, Apr 24, 2022 at 3:20 AM wrote: > > From: Sören Tempel > > The libgo code assumes both off64_t and loff_t to be present. For > example, for the splice(2) function prototype. Similar to glibc, > musl libc supports these types but defines them as macros, not as > typedefs. Unfortunately,

  1   2   3   4   5   6   >