[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::dec_pascal_bugs

Title:DEC Pascal Bug Reports
Notice:New kit announcement in TURRIS::Pascal conference
Moderator:TLE::GARRISON
Created:Wed Sep 09 1992
Last Modified:Fri May 30 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:838
Total number of notes:3659

830.0. "Pascal V5.5-52 Compiler internal error" by CSC32::D_SANFORD () Mon Mar 03 1997 20:17

    DEC Pascal V5.5-52, OpenVMS Alpha V6.2
    
    Customer would like to report the following compiler internal error...

    Regards, Drew Sanford
    Customer Support Center
    C970213-2952

    Sample code:

[IDENT('V1.0'),INHERIT('SYS$LIBRARY:STARLET')]

PROGRAM test(INPUT,OUTPUT);

CONST
  module          {Name of this module}
                = 'TEST';

TYPE
    record_type =
         RECORD
         loop_counter : INTEGER;
         something_else : INTEGER;
         END;

VAR
    record_type_ptr : ^record_type := NIL;

LABEL
  EXIT;

PROCEDURE internal_procedure;

VAR
  x : INTEGER;

BEGIN

WITH  record_type_ptr^ DO
  BEGIN
  x := 0;
  FOR loop_counter := 1 to 10 DO
    BEGIN
    x := x + 1;
    END;
  something_else := 10;
  END;
END;

BEGIN {test}

internal_procedure;

EXIT:

END {test}.


    Sample compilation:

$ pascal test/noopt/list
Assertion failure:  Compiler internal error - please submit problem report
DEC Pascal Fatal Error has occurred
%GEM-F-ASSERTION, Compiler internal error - please submit problem report
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC
 PASCAL  GEM_DB  GEM__DB_ASSERT_END       720 00000000000002C0 000000000018F8E0
 PASCAL  GEM_DB  GEM_DB_ABORT             587 0000000000000048 000000000018F668
 PASCAL  GEM_DB  GEM_DB_ABORT_FAST        610 00000000000000C0 000000000018F6E0
 PASCAL  GEM_CD  CD_INTERP               6950 000000000000626C 000000000035EB3C
 PASCAL  GEM_CD  GEM_CD                  1149 0000000000000118 00000000003589E8
 PASCAL  GEM_CG  GEM_CG                   729 00000000000003BC 00000000002B1AFC
 PASCAL  GEM_CO  GEM_CO_COMPILE_ROUTINE
                                         2358 000000000000348C 00000000001AB92C
 PASCAL  GEM_CO  COMPILE_ALL             2607 000000000000369C 00000000001ABB3C
 PASCAL  GEM_CO  COMPILE_ALL             2612 00000000000036BC 00000000001ABB5C
 PASCAL  GEM_CO  COMPILE_ALL             2612 00000000000036BC 00000000001ABB5C
 PASCAL  GEM_CO  GEM_CO_COMPILE_MODULE   1446 0000000000000A20 00000000001A8EC0
 PASCAL  PASCAL  GEM_XX_COMPILE          1519 0000000000000AD0 00000000003DCE78
 PASCAL  GEM_CP_VMS  GEM_CP_MAIN         2509 00000000000015C4 0000000000189824
                                            0 FFFFFFFF833C2170 FFFFFFFF833C2170

T.RTitleUserPersonal
Name
DateLines
830.1TLE::REAGANAll of this chaos makes perfect senseSun Mar 09 1997 16:0114
    OK, I reproduced it with the latest compiler.  We'll let you know if
    there is a workaround when we can look a little closer at it.
    
    				-John
    
    
    Note to Meg/or/me:
    
    Oddly, when I used /SWITCH=FE_IC* to see if the CIL was bad, I got 12
    integrity checks in the CIL.  With a BL33 compiler, I only got 2
    integrity checks in the CIL and the 2 were not in the list of 12 I
    got with the BL32 compiler.  Its as if FE_IC* didn't work right with
    the BL33 compiler, we need to check that it works.
    
830.2TLE::REAGANAll of this chaos makes perfect senseFri Mar 28 1997 13:0077
    Well, I'll fix this by saying its an illegal program that the
    compiler didn't detect.
    
    In a FOR statement, the index variable must be a "whole" variable.
    It can't be a array element, record field, pointer dereference, etc.
    
    The compiler already detects all of these cases:

  FOR r.loop_counter := 1 to 10 DO
.......^
%PASCAL-E-SYNASSIN, Syntax: ":=" or IN expected
at line number 37 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7

  FOR r.loop_counter := 1 to 10 DO
........^
%PASCAL-E-FORACTVAR, FOR loop control must be a true variable
at line number 37 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7


  FOR arr[1] := 1 to 10 DO
.........^
%PASCAL-E-SYNASSIN, Syntax: ":=" or IN expected
at line number 39 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7

  FOR arr[1] := 1 to 10 DO
...........^
%PASCAL-E-FORACTVAR, FOR loop control must be a true variable
at line number 39 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7

    For pointer dereferences, we catch that error, but don't issue
    the secondary FORACTVAR message.  

  FOR int_ptr^ := 1 to 10 DO
.............^
%PASCAL-E-SYNASSIN, Syntax: ":=" or IN expected
at line number 35 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7


    For pointer dereference to a record, we catch that also

  FOR record_type_ptr^.loop_counter := 1 to 10 DO
.....................^
%PASCAL-E-SYNASSIN, Syntax: ":=" or IN expected
at line number 33 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;7


    However, when you use a WITH to open the scope of record_type_ptr^,
    we didn't detect the use of a record field as the FOR index variable.

    We do detect this if you don't use a pointer.  For example,
    
VAR
    r : record_type;

  WITH R DO
    FOR loop_counter := 1 to 10 DO
      x := x + 1;

    FOR loop_counter := 1 to 10 DO
........^
%PASCAL-E-FORACTVAR, FOR loop control must be a true variable
at line number 42 in file PAS$:[REAGAN.WORK.NOTE830]P.PAS;8


    So the user's program is illegal, but the compiler does have the
    following bugs:
    
    1) For explicit "ptr^" as a FOR index, we don't print the 2nd FORACTVAR
       message.
    
    2) For implicit record-fields from a opened WITH statement using a
       pointer, we don't issue any errors and pass bogus data to the code
       generator.  The code generator doesn't like it and crashes/burns.
       We should issue the FORACTVAR message just like the case with
       the WITH statement that doesn't use a pointer-dereference.

				-John
830.3TLE::REAGANAll of this chaos makes perfect senseMon Apr 14 1997 17:2214
    OK, I've fixed this.  The compiler now detects the illegal program.
    
    FOR loop_counter := 1 to 10 DO
........^
%PASCAL-E-FORACTVAR, FOR loop control must be a true variable
at line number 43 in file PAS$:[REAGAN.WORK.NOTE830]NOTE830.PAS;2

    I'll put in a release note highlighting this chance.  Nobody has
    been relying on this on Alpha since you break the compiler.  However,
    from my testing, it sometimes "does the right thing" on the VAX
    (and sometimes not) depending on the phase of the moon and wind
    direction. :-)
    
    				-John