Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: recently added go tests failing on ppc64le #43252

Closed
laboger opened this issue Dec 17, 2020 · 7 comments
Closed

gccgo: recently added go tests failing on ppc64le #43252

laboger opened this issue Dec 17, 2020 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@laboger
Copy link
Contributor

laboger commented Dec 17, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15.6 gccgo (GCC) 11.0.0 20201217 (experimental) linux/ppc64le

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
ppc64le

What did you do?

Ran the gccgo testcases using make check-gcc-go

What did you expect to see?

No new failures.

What did you see instead?

Some new failures due to new tests added most likely in one of these commits, since they didn't exist before.

commit 6f8486523f61bf0aa476dfa4197d1e3b71a0a8f3
Author: Ian Lance Taylor iant@golang.org
Date: Wed Dec 16 19:43:20 2020 -0800
test: add new Go tests from source repo
commit ba74e74ac66ab85a4a0a2b06c7e15bba2571823b
Author: Ian Lance Taylor iant@golang.org
Date: Wed Dec 16 19:38:08 2020 -0800
test: add new Go tests from source repo

For the first two, if I add the 'go' tool built with gccgo to the PATH, the failures go away.

issue22660.go
2020/12/17 10:22:04 expected full path (users/xxx/go) in error message, got:
FAIL: go.test/test/fixedbugs/issue22660.go execution, -O2 -g

issue21576.go
Error: exec: "go": executable file not found in $PATH
FAIL: go.test/test/fixedbugs/issue21576.go execution, -O2 -g

The other failures are due to not recognizing some expected errors.
issue18915.go
issue18915.go:13: error: expected ';' after statement in if expression^M
issue18915.go:16: error: parse error in for statement^M
issue18915.go:19: error: send statement used as value; use select for non-blocking send^M
issue18915.go:13: error: 'a' declared but not used^M
issue18915.go:16: error: 'b' declared but not used^M
issue18915.go:19: error: 'c' declared but not used^M
compiler exited with status 1
PASS: issue18915.go -O (test for errors, line 13)
PASS: issue18915.go -O (test for errors, line 16)
PASS: issue18915.go -O (test for errors, line 19)
FAIL: issue18915.go -O (test for excess errors)
Excess errors:
issue18915.go:19: error: send statement used as value; use select for non-blocking send

This test existed before the commits I note above.

FAIL: issue4458.go -O (test for errors, line 19)
FAIL: issue4458.go -O (test for excess errors)
Excess errors:
issue4458.go:19: error: method 'foo' is ambiguous

@gopherbot gopherbot added this to the Gccgo milestone Dec 17, 2020
@laboger
Copy link
Contributor Author

laboger commented Dec 17, 2020

cc @ianlancetaylor

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 17, 2020
@ianlancetaylor ianlancetaylor self-assigned this Dec 17, 2020
@gopherbot
Copy link

Change https://golang.org/cl/279052 mentions this issue: test: recognize and use gc build tag

@ianlancetaylor
Copy link
Contributor

I understand the issue22660.go and issue21576.go failures. I'll fix those.

I don't understand the other two errors. I don't see why those would have different behavior for ppc64le. What is the output of gcc -c .../issue18915.go ? I see

/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:13:20: error: expected ‘;’ after statement in if expression
   13 |         if a := 10 { // ERROR "cannot use a := 10 as value|expected .*;|declared but not used"
      |                    ^
/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:16:21: error: parse error in for statement
   16 |         for b := 10 { // ERROR "cannot use b := 10 as value|parse error|declared but not used"
      |                     ^
/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:19:24: error: expected ‘;’ after statement in switch expression
   19 |         switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
      |                        ^
/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:13:12: error: ‘a’ declared but not used
   13 |         if a := 10 { // ERROR "cannot use a := 10 as value|expected .*;|declared but not used"
      |            ^
/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:16:13: error: ‘b’ declared but not used
   16 |         for b := 10 { // ERROR "cannot use b := 10 as value|parse error|declared but not used"
      |             ^
/home/iant/gcc/trunk/gcc/testsuite/go.test/test/fixedbugs/issue18915.go:19:16: error: ‘c’ declared but not used
   19 |         switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
      |                ^

gopherbot pushed a commit that referenced this issue Dec 18, 2020
Change the run.go driver to recognize the "gc" build tag.

Change existing tests to use the "gc" build tag if they use some
feature that seems specific to the gc compiler, such as passing specific
options to or expecting specific behavior from "go tool compile".
Change tests to use the "!gccgo" build tag if they use "go build" or
"go run", as while those might work with compilers other than gc, they
won't work with the way that gccgo runs its testsuite (which happens
independently of the go command).

For #43252

Change-Id: I666e04b6d7255a77dfc256ee304094e3a6bb15ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/279052
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
@laboger
Copy link
Contributor Author

laboger commented Dec 22, 2020

gcc -c issue18915.go
issue18915.go:13:13: error: expected ‘;’ after statement in if expression
  if a := 10 { // ERROR "cannot use a := 10 as value|expected .*;|declared but not used"
             ^
issue18915.go:16:14: error: parse error in for statement
  for b := 10 { // ERROR "cannot use b := 10 as value|parse error|declared but not used"
              ^
issue18915.go:19:17: error: send statement used as value; use select for non-blocking send
  switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
                 ^
issue18915.go:13:5: error: ‘a’ declared and not used
  if a := 10 { // ERROR "cannot use a := 10 as value|expected .*;|declared but not used"
     ^
issue18915.go:16:6: error: ‘b’ declared and not used
  for b := 10 { // ERROR "cannot use b := 10 as value|parse error|declared but not used"
      ^
issue18915.go:19:9: error: ‘c’ declared and not used
  switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
         ^

@ianlancetaylor
Copy link
Contributor

The difference is that I see this:

fixedbugs/issue18915.go:19:24: error: expected ‘;’ after statement in switch expression
   19 |         switch c := 10 { // ERROR "cannot use c := 10 as value|expected .*;|declared but not used"
      |                        ^

@ianlancetaylor
Copy link
Contributor

Oh, I see the problem. An uninitialized variable.

@gopherbot
Copy link

Change https://golang.org/cl/279752 mentions this issue: compiler: initialize saw_send_stmt locals

sebhub pushed a commit to RTEMS/gnu-mirror-gcc that referenced this issue Dec 23, 2020
The C++ compiler wasn't warning because we take their address.

Fixes golang/go#43252

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279752
@golang golang locked and limited conversation to collaborators Dec 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants