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

x/tools/go/gccgoexportdata: escape tag is not supported #23324

Closed
cherrymui opened this issue Jan 3, 2018 · 6 comments
Closed

x/tools/go/gccgoexportdata: escape tag is not supported #23324

cherrymui opened this issue Jan 3, 2018 · 6 comments
Milestone

Comments

@cherrymui
Copy link
Member

With gccgo, when the escape analysis is turned on (-fgo-optimize-allocs), it writes escape tag for function arguments in the export data, with the format <esc:0xNN> before the type tag, like

func Compare (a <esc:0x1> <type 19 [] <type -20>>, b <esc:0x1> <type 19>) <type -11>;

The gccgoexportdata package cannot parse export data with escape tags in them.

reading export data: /usr/local/google/home/cherryyz/w/gccgo2/lib64/go/8.0.0/x86_64-pc-linux-gnu/bytes.gox: import error bytes:11:15 (byte offset = 516): expected keyword type, got "esc"

cc @ianlancetaylor @alandonovan

@gopherbot gopherbot modified the milestones: Unreleased, Gccgo Jan 3, 2018
@cherrymui cherrymui modified the milestones: Gccgo, Unreleased Jan 3, 2018
@griesemer griesemer modified the milestones: Unreleased, Go1.11 Jan 8, 2018
@griesemer
Copy link
Contributor

@cherrymui Is this a blocker for you? Let me know and I'll prioritize if necessary.

@cherrymui
Copy link
Member Author

cherrymui commented Jan 9, 2018

@griesemer, thank you! It is a blocker for turning on the escape analysis by default for gccgo. Meanwhile we could use the flag -fgo-optimize-allocs to turn on the escape analysis, but some tools would fail to work.

@griesemer
Copy link
Contributor

We have a gccgoimporter also in the std library. This seems a very safe fix that we should probably add to Go 1.10.

@griesemer griesemer modified the milestones: Go1.11, Go1.10 Jan 9, 2018
@gopherbot
Copy link

Change https://golang.org/cl/86977 mentions this issue: go/internal/gccgoimporter: parse option escape info in export data

@gopherbot
Copy link

Change https://golang.org/cl/87295 mentions this issue: go/internal/gccgoimporter: parse optional escape info in export data

gopherbot pushed a commit to golang/tools that referenced this issue Jan 11, 2018
This is a copy of https://go-review.googlesource.com/c/go/+/86977
and brings those changes into the x/tools repo.

It also includes a minor change to parser.go that was done via
https://go-review.googlesource.com/37839 but that wasn't brought
over.

For golang/go#23324.

Change-Id: I84b7cf134fec250ac340e404802158860cb3c630
Reviewed-on: https://go-review.googlesource.com/87295
Reviewed-by: Cherry Zhang <cherryyz@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/87878 mentions this issue: go/internal/gccgoimporter: port CL 86977 to support escape tags in export data

@golang golang locked and limited conversation to collaborators Jan 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants