gccgo: oddity with export data and init functions #34618
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?gccgo tip
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
Compile this package with gccgo:
What did you expect to see?
Expected a single entry
func F () <type -11>
in the export data for the package, since that is the only exported identifier.
What did you see instead?
Export data includes the 'byMaskLength' type and its associated methods, which was a surprise.
I poked around at this and discovered that the lowering phase is running inlinabliity analysis on init functions, and it decides as part of this that the init() function is inlinable. This means that we include the types reachable from it in the export data (even though the init function itself is not emitted as an inline candidate.
The text was updated successfully, but these errors were encountered: