Bug 91781 - [10 regression] r275691 breaks go test "reflect"
Summary: [10 regression] r275691 breaks go test "reflect"
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 10.0
: P4 normal
Target Milestone: 10.0
Assignee: Ian Lance Taylor
Depends on:
Reported: 2019-09-16 18:26 UTC by seurer
Modified: 2019-09-17 20:28 UTC (History)
0 users

See Also:
Host: powerpc64-unknown-linux-gnu
Target: powerpc64-unknown-linux-gnu
Build: powerpc64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2019-09-16 18:26:43 UTC
This only seems to occur on powerpc 64 BE.

--- FAIL: TestMethodValue (0.00s)
    all_test.go:2290: Int32Method returned 45088; want 456
FAIL: reflect

r275691 | ian | 2019-09-12 18:22:53 -0500 (Thu, 12 Sep 2019) | 4 lines

    libgo: update to Go1.13
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194698
Comment 1 Ian Lance Taylor 2019-09-16 19:42:20 UTC
Does this work at SVN revision r275611?
Comment 2 Ian Lance Taylor 2019-09-16 19:44:45 UTC
Oh, never mind, this is a new test in r275691, this code has probably never worked on ppc64be.
Comment 3 seurer 2019-09-16 20:22:33 UTC
Sorry, I missed this was a new test case.  And no, it still doesn't work with current trunk.
Comment 4 Andreas Schwab 2019-09-16 20:32:05 UTC
For reflect to work there needs to be support for go closures in libffi.
Comment 5 ian@gcc.gnu.org 2019-09-17 20:24:31 UTC
Author: ian
Date: Tue Sep 17 20:24:00 2019
New Revision: 275813

URL: https://gcc.gnu.org/viewcvs?rev=275813&root=gcc&view=rev
	PR go/91781
    reflect: promote integer closure return to full word
    The libffi library expects an integer return type to be promoted to a
    full word.  Implement that when returning from a closure written in Go.
    This only matters on big-endian systems when returning an integer smaller
    than the pointer size, which is why we didn't notice it until now.
    Fixes https://gcc.gnu.org/PR91781.
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195858

Comment 6 Ian Lance Taylor 2019-09-17 20:28:21 UTC
Thanks for reporting this.  It should be fixed.

(To Andreas's point, there is already Go closure support in libffi for PPC64.)