
     1  %begin
     2  
503 @ 4405:         LINE   1 "regression-compile-tmp/recordmap.imp"
504 @ 4445:         BEGIN  _lev0id0 {lev=0 --> 1}

     3    %recordformat small rec fm(%integer i, %real r)
505 @ 4446:            LINE   3 "regression-compile-tmp/recordmap.imp"
506 @ 4486:            DEF    SMALLRECFM p1=V_0081 a/tf=44 b/format=81 c/ostate=0  type=4 (record) form=4 (record-format) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
507 @ 4508:            START  ( RECORDFORMAT
508 @ 4509:               DEF    I p1=V_0000 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
509 @ 4522:               DEF    R p1=V_0000 a/tf=21 b/format=1 c/ostate=0  type=2 (real) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
510 @ 4535:            FINISH ) 

     4    %recordformat big rec fm(%integer i, %real r, %string(255) s)
     5    
511 @ 4536:            LINE   4 "regression-compile-tmp/recordmap.imp"
512 @ 4576:            DEF    BIGRECFM p1=V_0082 a/tf=44 b/format=82 c/ostate=0  type=4 (record) form=4 (record-format) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
513 @ 4596:            START  ( RECORDFORMAT
514 @ 4597:               DEF    I p1=V_0000 a/tf=11 b/format=1 c/ostate=0  type=1 (integer) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
515 @ 4610:               DEF    R p1=V_0000 a/tf=21 b/format=1 c/ostate=0  type=2 (real) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
516 @ 4623:               DEF    S p1=V_0000 a/tf=31 b/format=ff c/ostate=0  type=3 (string) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
517 @ 4636:            FINISH ) 

     6    %record (small rec fm) small rec, small rec 2
518 @ 4637:            LINE   6 "regression-compile-tmp/recordmap.imp"
519 @ 4677:            DEF    SMALLREC p1=V_0083 a/tf=41 b/format=81 c/ostate=0  type=4 (record) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0
520 @ 4697:            DEF    SMALLREC2 p1=V_0084 a/tf=41 b/format=81 c/ostate=0  type=4 (record) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0

     7    %record (big rec fm) big rec
     8  
521 @ 4718:            LINE   7 "regression-compile-tmp/recordmap.imp"
522 @ 4758:            DEF    BIGREC p1=V_0085 a/tf=41 b/format=82 c/ostate=0  type=4 (record) form=1 (simple) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0

     9    %record (small rec fm) %name small ptr
    10  
523 @ 4776:            LINE   9 "regression-compile-tmp/recordmap.imp"
524 @ 4816:            DEF    SMALLPTR p1=V_0086 a/tf=42 b/format=81 c/ostate=0  type=4 (record) form=2 (name) special=0 (<special:0>) linkage=0 (auto) spec=0 indirect=0 unass=0

    11    small rec_i = 123 ; small rec_r = 234.56
525 @ 4836:            LINE   11 "regression-compile-tmp/recordmap.imp"
526 @ 4876:            PUSH   SMALLREC
527 @ 4879:            SELECT 1
528 @ 4882:            PUSHI  #0x0000007b
529 @ 4887:            ASSVAL
530 @ 4888:            LINE   11 "regression-compile-tmp/recordmap.imp"
531 @ 4928:            PUSH   SMALLREC
532 @ 4931:            SELECT 2
533 @ 4934:            PUSHR  code=0 len=6 "234.56"
534 @ 4944:            ASSVAL

    12    big rec_i = 123 ; big rec_r = 234.56 ; big rec_s = "A String"
    13  
    14  ! regular record assignments. These work OK.
    15  
535 @ 4945:            LINE   12 "regression-compile-tmp/recordmap.imp"
536 @ 4985:            PUSH   BIGREC
537 @ 4988:            SELECT 1
538 @ 4991:            PUSHI  #0x0000007b
539 @ 4996:            ASSVAL
540 @ 4997:            LINE   12 "regression-compile-tmp/recordmap.imp"
541 @ 5037:            PUSH   BIGREC
542 @ 5040:            SELECT 2
543 @ 5043:            PUSHR  code=0 len=6 "234.56"
544 @ 5053:            ASSVAL
545 @ 5054:            LINE   12 "regression-compile-tmp/recordmap.imp"
546 @ 5094:            PUSH   BIGREC
547 @ 5097:            SELECT 3
548 @ 5100:            PUSHS  "A String"
549 @ 5110:            ASSVAL

    16    small ptr == small rec 2
    17  
550 @ 5111:            LINE   16 "regression-compile-tmp/recordmap.imp"
551 @ 5151:            PUSH   SMALLPTR
552 @ 5154:            PUSH   SMALLREC2
553 @ 5157:            ASSREF

    18    small ptr = small rec
    19  
554 @ 5158:            LINE   18 "regression-compile-tmp/recordmap.imp"
555 @ 5198:            PUSH   SMALLPTR
556 @ 5201:            PUSH   SMALLREC
557 @ 5204:            ASSVAL

    20    small rec = small ptr
    21  
558 @ 5205:            LINE   20 "regression-compile-tmp/recordmap.imp"
559 @ 5245:            PUSH   SMALLREC
560 @ 5248:            PUSH   SMALLPTR
561 @ 5251:            ASSVAL

    22    small rec <- small ptr
    23  
    24  ! These generate bad code:
    25  
    26  ! RECORD() on RHS
    27  
562 @ 5252:            LINE   22 "regression-compile-tmp/recordmap.imp"
563 @ 5292:            PUSH   SMALLREC
564 @ 5295:            PUSH   SMALLPTR
565 @ 5298:            JAM   

    28    small ptr == RECORD(ADDR(big rec))
    29  
566 @ 5299:            LINE   28 "regression-compile-tmp/recordmap.imp"
567 @ 5339:            PUSH   SMALLPTR
568 @ 5342:            PUSH   RECORD
569 @ 5345:            PUSH   ADDR
570 @ 5348:            PUSH   BIGREC
571 @ 5351:            ASSPAR
572 @ 5352:            CALL  
573 @ 5353:            ASSPAR
574 @ 5354:            CALL  
575 @ 5355:            ASSREF

    30    small ptr == RECORD(ADDR(small rec))
    31  
576 @ 5356:            LINE   30 "regression-compile-tmp/recordmap.imp"
577 @ 5396:            PUSH   SMALLPTR
578 @ 5399:            PUSH   RECORD
579 @ 5402:            PUSH   ADDR
580 @ 5405:            PUSH   SMALLREC
581 @ 5408:            ASSPAR
582 @ 5409:            CALL  
583 @ 5410:            ASSPAR
584 @ 5411:            CALL  
585 @ 5412:            ASSREF

    32    small rec 2 = RECORD(ADDR(big rec))
    33  
586 @ 5413:            LINE   32 "regression-compile-tmp/recordmap.imp"
587 @ 5453:            PUSH   SMALLREC2
588 @ 5456:            PUSH   RECORD
589 @ 5459:            PUSH   ADDR
590 @ 5462:            PUSH   BIGREC
591 @ 5465:            ASSPAR
592 @ 5466:            CALL  
593 @ 5467:            ASSPAR
594 @ 5468:            CALL  
595 @ 5469:            ASSVAL

    34    small rec 2 <- RECORD(ADDR(big rec))
    35  
596 @ 5470:            LINE   34 "regression-compile-tmp/recordmap.imp"
597 @ 5510:            PUSH   SMALLREC2
598 @ 5513:            PUSH   RECORD
599 @ 5516:            PUSH   ADDR
600 @ 5519:            PUSH   BIGREC
601 @ 5522:            ASSPAR
602 @ 5523:            CALL  
603 @ 5524:            ASSPAR
604 @ 5525:            CALL  
605 @ 5526:            JAM   

    36    small ptr = RECORD(ADDR(big rec))
    37  
606 @ 5527:            LINE   36 "regression-compile-tmp/recordmap.imp"
607 @ 5567:            PUSH   SMALLPTR
608 @ 5570:            PUSH   RECORD
609 @ 5573:            PUSH   ADDR
610 @ 5576:            PUSH   BIGREC
611 @ 5579:            ASSPAR
612 @ 5580:            CALL  
613 @ 5581:            ASSPAR
614 @ 5582:            CALL  
615 @ 5583:            ASSVAL

    38    small rec 2 <- RECORD(ADDR(big rec))
    39  
616 @ 5584:            LINE   38 "regression-compile-tmp/recordmap.imp"
617 @ 5624:            PUSH   SMALLREC2
618 @ 5627:            PUSH   RECORD
619 @ 5630:            PUSH   ADDR
620 @ 5633:            PUSH   BIGREC
621 @ 5636:            ASSPAR
622 @ 5637:            CALL  
623 @ 5638:            ASSPAR
624 @ 5639:            CALL  
625 @ 5640:            JAM   

    40    small ptr <- RECORD(ADDR(big rec))
    41  
    42  ! RECORD() on LHS
    43  
626 @ 5641:            LINE   40 "regression-compile-tmp/recordmap.imp"
627 @ 5681:            PUSH   SMALLPTR
628 @ 5684:            PUSH   RECORD
629 @ 5687:            PUSH   ADDR
630 @ 5690:            PUSH   BIGREC
631 @ 5693:            ASSPAR
632 @ 5694:            CALL  
633 @ 5695:            ASSPAR
634 @ 5696:            CALL  
635 @ 5697:            JAM   

    44    RECORD(ADDR(big rec)) = small rec
    45  
636 @ 5698:            LINE   44 "regression-compile-tmp/recordmap.imp"
637 @ 5738:            PUSH   RECORD
638 @ 5741:            PUSH   ADDR
639 @ 5744:            PUSH   BIGREC
640 @ 5747:            ASSPAR
641 @ 5748:            CALL  
642 @ 5749:            ASSPAR
643 @ 5750:            CALL  
644 @ 5751:            PUSH   SMALLREC
645 @ 5754:            ASSVAL

    46    RECORD(ADDR(big rec)) <- small rec
    47  
646 @ 5755:            LINE   46 "regression-compile-tmp/recordmap.imp"
647 @ 5795:            PUSH   RECORD
648 @ 5798:            PUSH   ADDR
649 @ 5801:            PUSH   BIGREC
650 @ 5804:            ASSPAR
651 @ 5805:            CALL  
652 @ 5806:            ASSPAR
653 @ 5807:            CALL  
654 @ 5808:            PUSH   SMALLREC
655 @ 5811:            JAM   

    48    RECORD(ADDR(small rec)) = big rec
    49  
656 @ 5812:            LINE   48 "regression-compile-tmp/recordmap.imp"
657 @ 5852:            PUSH   RECORD
658 @ 5855:            PUSH   ADDR
659 @ 5858:            PUSH   SMALLREC
660 @ 5861:            ASSPAR
661 @ 5862:            CALL  
662 @ 5863:            ASSPAR
663 @ 5864:            CALL  
664 @ 5865:            PUSH   BIGREC
665 @ 5868:            ASSVAL

    50    RECORD(ADDR(small rec)) <- big rec
    51  
    52    
666 @ 5869:            LINE   50 "regression-compile-tmp/recordmap.imp"
667 @ 5909:            PUSH   RECORD
668 @ 5912:            PUSH   ADDR
669 @ 5915:            PUSH   SMALLREC
670 @ 5918:            ASSPAR
671 @ 5919:            CALL  
672 @ 5920:            ASSPAR
673 @ 5921:            CALL  
674 @ 5922:            PUSH   BIGREC
675 @ 5925:            JAM   

    53  %endofprogram
676 @ 5926:            LINE   53 "regression-compile-tmp/recordmap.imp"
677 @ 5966:         END    _lev0id0 {lev=1 --> 0}
678 @ 5967:         END     {lev=0 --> -1}
679 @ 5968: 

