Bug #41

fixing a register allocation problem in the compiler

Added by J. Templ over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:04/23/2015
Priority:NormalDue date:
Assignee:J. Templ% Done:

0%

Category:-
Target version:1.7
Forum topic:

Description

The following procedure produces a trap in the compiler.

PROCEDURE P(IN in : ARRAY 10 OF SHORTCHAR; OUT out : ARRAY 10 OF SHORTCHAR);
BEGIN
  out[Index()] := SHORT(CHR(1 + ORD(in[0])));
END P;

The reason is that the right hand side expression is evaluated into a register
that cannot be used for a comparison operation, which is necessary for SHORTCHAR conversion.
A proposal to fix the bug exists in CPC 1.7 rc5 by changing
the register selection order.

Reported/fix proposed by oberoncore, Maliya by dia, 2013-05-19.
See http://forum.oberoncore.ru/viewtopic.php?f=47&t=4087&p=80212#p80205
http://oberspace.dyndns.org/index.php?topic=500.0;topicseen

Refers to CPC 1.7 rc5 change list number 17.

Associated revisions

Revision 7a06391e
Added by J. Templ over 4 years ago

Register allocation strategy changed. Refs: #41.
As proposed in CPC 1.7 rc5 by Maliya by dia/oberoncore.
Registers 0..3 are preferred over 6,7 because the comparison
operator works only on 0..3.

Signed-off-by: Josef Templ <>

Revision 14f60896
Added by J. Templ over 4 years ago

Unused register BX moved to the end. Refs: #41.
Symbolic constants used instead of numbers.

Signed-off-by: Josef Templ <>

Revision a7f81cd4
Added by J. Templ over 4 years ago

Merge pull request #24 from BlackBoxCenter/issue-#41

Refs: #41.

History

#1 Updated by J. Templ over 4 years ago

  • Status changed from New to Closed

Also available in: Atom PDF