public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Provide index information on bounds check failure
@ 2019-08-28 19:01 Ian Lance Taylor
  2019-08-29 21:14 ` Rainer Orth
  2019-08-29 22:36 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2019-08-28 19:01 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

This patch to the Go frontend and libgo changes the panic message
reported for an out of bounds index or slice operation to include the
invalid values.  This makes it easier for the user to see what the
problem is.  This implements https://golang.org/cl/161477 in the
gofrontend, for https://golang.org/issue/30116.  Bootstrapped and ran
Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Unfortunately, GMail has once again blocked the patch attachment.  So
if you want to see the patch, see
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=274998 .

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Go patch committed: Provide index information on bounds check failure
  2019-08-28 19:01 Go patch committed: Provide index information on bounds check failure Ian Lance Taylor
@ 2019-08-29 21:14 ` Rainer Orth
  2019-08-29 22:36 ` Andreas Schwab
  1 sibling, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2019-08-29 21:14 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

Hi Ian,

> This patch to the Go frontend and libgo changes the panic message
> reported for an out of bounds index or slice operation to include the
> invalid values.  This makes it easier for the user to see what the
> problem is.  This implements https://golang.org/cl/161477 in the
> gofrontend, for https://golang.org/issue/30116.  Bootstrapped and ran
> Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
>
> Unfortunately, GMail has once again blocked the patch attachment.  So
> if you want to see the patch, see
> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=274998 .

this patch broke sparc-sun-solaris2.11 bootstrap: in gotools I get
several link failures like this:

Undefined                       first referenced
 symbol                             in file
runtime.goPanicExtendSliceAcap      ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendSliceAlen      ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendIndex          ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendIndexU         ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendSliceB         ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendSliceAcapU     ../sparc-sun-solaris2.11/libgo/.libs/libgo.so
runtime.goPanicExtendSliceBU        ../sparc-sun-solaris2.11/libgo/libgotool.a(buildid.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:829: buildid] Error 1

The attached patch fixes this and allows the links to succeed; tests
still to be run.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sparc-libgo-panic32.patch --]
[-- Type: text/x-patch, Size: 408 bytes --]

diff --git a/libgo/go/runtime/panic32.go b/libgo/go/runtime/panic32.go
--- a/libgo/go/runtime/panic32.go
+++ b/libgo/go/runtime/panic32.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build 386 amd64p32 arm mips mipsle m68k nios2 sh shbe
+// +build 386 amd64p32 arm mips mipsle m68k nios2 sh shbe sparc
 
 package runtime
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Go patch committed: Provide index information on bounds check failure
  2019-08-28 19:01 Go patch committed: Provide index information on bounds check failure Ian Lance Taylor
  2019-08-29 21:14 ` Rainer Orth
@ 2019-08-29 22:36 ` Andreas Schwab
  2019-08-31  6:30   ` Ian Lance Taylor
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2019-08-29 22:36 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

On Aug 28 2019, Ian Lance Taylor <iant@golang.org> wrote:

> This patch to the Go frontend and libgo changes the panic message
> reported for an out of bounds index or slice operation to include the
> invalid values.

This breaks aarch64/-mabi=ilp32.

aarch64-suse-linux/ilp32/libgo/archive/tar/check-testlog:

/usr/aarch64-suse-linux/bin/ld: _gotest_.o: in function `archive..z2ftar.Reader.next':
/opt/gcc/gcc-20190829/Build/aarch64-suse-linux/ilp32/libgo/gotest1086/test/reader.go:72: undefined reference to `runtime.goPanicExtendSliceAlen'

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Go patch committed: Provide index information on bounds check failure
  2019-08-29 22:36 ` Andreas Schwab
@ 2019-08-31  6:30   ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2019-08-31  6:30 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

On Thu, Aug 29, 2019 at 1:50 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Aug 28 2019, Ian Lance Taylor <iant@golang.org> wrote:
>
> > This patch to the Go frontend and libgo changes the panic message
> > reported for an out of bounds index or slice operation to include the
> > invalid values.
>
> This breaks aarch64/-mabi=ilp32.
>
> aarch64-suse-linux/ilp32/libgo/archive/tar/check-testlog:
>
> /usr/aarch64-suse-linux/bin/ld: _gotest_.o: in function `archive..z2ftar.Reader.next':
> /opt/gcc/gcc-20190829/Build/aarch64-suse-linux/ilp32/libgo/gotest1086/test/reader.go:72: undefined reference to `runtime.goPanicExtendSliceAlen'

We should probably use a different GOARCH value for that build, such
as arm64p32.  But for now I'm committing this patch which will fix
both problems by just always building panic32.go.  Bootstrapped and
tested on x86_64-pc-linux-gnu.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 847 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 275227)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-11fd9208f8545e882f945d3ed86fcc33abf1a61b
+2444eb1e8c697531f8beb403679e4ab00b16dbf5
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/runtime/panic32.go
===================================================================
--- libgo/go/runtime/panic32.go	(revision 274998)
+++ libgo/go/runtime/panic32.go	(working copy)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build 386 amd64p32 arm mips mipsle m68k nios2 sh shbe
-
 package runtime
 
 import _ "unsafe" // for go:linkname

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-31  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 19:01 Go patch committed: Provide index information on bounds check failure Ian Lance Taylor
2019-08-29 21:14 ` Rainer Orth
2019-08-29 22:36 ` Andreas Schwab
2019-08-31  6:30   ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).