2024-04-23 17:10 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000526mercuryBugpublic2021-04-28 11:17
Reporterwangp 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000526: unused imports affected by opt-imported typeclass instances
DescriptionSome basic investigation of why warnings/bug412.m fails when intermodule optimisation is enabled.

The `io' module is considered used because polymorphism adds a typeclass info to the constant structure database due to opt-imported typeclass instances. Then const_struct_used_modules treats every constant structure as a use:

const_struct_used_modules(_ConstNum - ConstStruct, !UsedModules) :-
    % Every const_struct in the const_struct_db was put there because
    % it is used in module. None of the uses can be in the interface.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001124

zs (developer)

The obvious fix is to add a field to each entry to the const_struct_db
that says "does this entry come from the current module, or not?",
and then ignore the fields with "no" answers when it comes to computing
the set of used modules. The only nontrivial aspect I see is when
two or more const structs use a smaller const struct; the smaller
const struct should say "for this module" if any of its users also say so.

Do you see anything wrong with this approach?

~0001125

wangp (developer)

I think your approach should work.

(Sorry for the late response; the notification was caught by GMail's spam filter.)

~0001134

wangp (developer)

Fixed by zs on 2021-01-23
+Notes

-Issue History
Date Modified Username Field Change
2020-11-11 11:34 wangp New Issue
2020-11-12 03:13 zs Note Added: 0001124
2020-11-30 13:35 wangp Note Added: 0001125
2021-04-28 11:17 wangp Assigned To => wangp
2021-04-28 11:17 wangp Status new => resolved
2021-04-28 11:17 wangp Resolution open => fixed
2021-04-28 11:17 wangp Note Added: 0001134
+Issue History