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

cmd/compile: eliminate duplicate instrumentation in racewalk #4247

Open
dvyukov opened this issue Oct 15, 2012 · 3 comments
Open

cmd/compile: eliminate duplicate instrumentation in racewalk #4247

dvyukov opened this issue Oct 15, 2012 · 3 comments

Comments

@dvyukov
Copy link
Member

dvyukov commented Oct 15, 2012

Use simple analysis to eliminate duplicate instrumentation in cases like:

x = ...;
... = x;

Currently it leads to insertion of 2 raceread() calls.
@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 1:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 2:

Adding Release=None to all Priority=Someday bugs.

Labels changed: added release-none.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: eliminate duplicate instrumentation in racewalk cmd/compile: eliminate duplicate instrumentation in racewalk Jun 8, 2015
@mdempsky
Copy link
Member

mdempsky commented Jun 7, 2019

Currently it leads to insertion of 2 raceread() calls.

Is this report actually about duplicate raceread calls, or is it about redundant racewrite+raceread calls?

If I compile the code below with -S -race, I see one racewrite call for the x = y assignment, and then one raceread call for the return x statement.

package p

var x int

func f(y int) int {
	x = y
	return x
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants