Skip to content

runtime: de-duplicate bit operations with math/bits #35569

Open
@aclements

Description

@aclements

For the page allocator rewrite, @mknyszek tried to depend on math/bits in the runtime. This almost works, but conflicts with go test -coverpkg=all (#35461) because that tries to instrument math/bits in ways that are incompatible with running inside the runtime. In order to get this working, CL 206199 duplicated some math/bits functions into the runtime (and CL 206200 intrinsified them).

This duplication was expedient, but unfortunate, and for 1.15 I'd like to reconsider this. A few possibilities:

  1. -coverpkg=all shouldn't apply to anything the runtime depends on. You'd hardly be losing anything if it didn't cover math/bits since almost all of those functions are intrinsified anyway.

  2. If the cover tool can switch to using compiler-inserted coverage information, rather than source rewriting, it's possible this problem will go away.

/cc @dr2chase @cherrymui @mdempsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Triage Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions