MPS issue job002175

TitleMPS unaligned references are not detected by AMC pools
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionMPS unaligned references are not detected by AMC pools

This may reduce efficiency, and weaken error detection and reporting:

Unaligned 'references' are obviously invalid. If ambiguous, they should be ignored. [Not necessarily right; see below.] If exact, this is a fault and should be detected and reported immediately.

AMC pools do not detect unaligned references. If ambiguous, AMC accepts it as equivalent to the next lower aligned reference, and may erroneously preserve a dead object: this could unnecessarily increase ambiguous retention. If exact, AMC accepts it and passes it to the client's format code: this acceptence and continued processing of invalid data could cause client format code, or MPS code, to fail later, in unclear ways.
AnalysisRHSK 2009-10-15: Suspected and somewhat confirmed, but not yet thoroughly confirmed [2].

GDR 2012-10-17: see also job003317.

GDR 2012-11-06: it's possible that genuine unaligned references could appear in registers: see job003359 for a case where Clang stored a pointer to an interior field of an object in a register; if the field has been unaligned (e.g. a byte field) then the reference would have been unaligned too. So ambiguous unaligned references should not be ignored: they might be the only reference keeping an object alive. (Unaligned exact references are of course errors.)
How foundinspection
Evidence[1] Inspection of poolamc.c revision 23 https://info.ravenbrook.com/infosys/cg...om/project/mps/master/code/poolamc.c+23
[2] <http://info.ravenbrook.com/mail/2009/09/04/14-20-53/0.txt>
Observed in1.108.2
Created byRichard Kistruck
Created on2009-10-15 16:09:19
Last modified byGareth Rees
Last modified on2014-10-19 08:58:14
History2009-10-15 RHSK Created.
2013-03-19 GDR Assigned to RB.

Fixes

Change Effect Date User Description
187162 closed 2014-10-08 21:13:34 Gareth Rees AMC now asserts that references (unless ambiguous) are aligned to the pool alignment.