Oct 20,1981 To: J Duffy/C R Morgan From: J R Greenwood; Subject: Summary of Errors in Sept-81 Praxis Compilers as/ detected by the Praxis test suite.GThe following is a list of the various facilities that are incorrect orJgiving trouble in the Praxis compilers. This list derives from the Praxis@test suite. The test suite resides on the Nova VAX in directoryKDBC1:[praxistst.suite]. The routine names listed after each brief problem>description are in that directory with an extension of ".PRX".H The test suite can be run by the command file "suite.com". Individual0tests can be run easily if you do the following: $ sui" $ @symbols ! define suite symbols7 $ p p001abc ! runs test of VAX compiler on p001abc.prx; $ pe p002abc ! runs test of PDP-11 compiler on p002abc.prxEA couple of command files in the suite directory do most of the work.The list of problems is below:M-----------------------------------------------------------------------------E0) - INfinite loops. The following tests infinite loop the compiler. x005flex p6p6p2d9 f001names ( interesting) f002names f01subscr f03subscr) m01cvrul1, m01cvrul5, m01cvrra, p01cvrraD1)- Expressions as actual parameters to predefined functions: Floor, round, ceiling, etc. P001round p001floor 2) -Modules= Grouping definitions by importing and then exporting. fails p01seper m01seper m02seper53)- Trailing semicolon after endmodule - Syntax error p01semic p02semic F3a - (pdp-11 only) 32 bit constants initializing 32 bit cardinals and  integers blows 11 compiler. p01bases>4)- 36 bit size is allowed in VAX compiler. Should fail. The" 11 compiler catches it however. f03bases f04basesF5)- The ".." notation is not allowed anymore in the FOR loop. That is) FOR K in 5..6 do gives an error message.- A range type howevere is ok in the above. P001rangeH6)- The range spec enforces that lower>upper always. It would be betterif it were lower>= upper. p005range<7) - Many dimensioned arrays( 17 or more). Bombs compilers. p01subscr p02subscr ( fails ) p03subscr ( fails )E8) - Lexical mistake. Real constants must have decimal point follow;by a digit. Not true in implementation- 1234. is legal. p1p5d4I9) - Is a subrange of characters compatible with the character data type?? Subranges of integers are compatible with integers; so why not> subranges of characters? Also same argument for subranges of@ enumerations. Test becomes relevant when attempting to assign? a quoted string to a packed array of a subrange of characters. P1p7d7I10)- Are true, false, unlocked, nil reserved words. As implemented yes!@ Is this what we want. I believe so. If so change the tests to fail ones. p2p2d2 p2p2d3I11) - Scoping of names. The order of declarations of in a declare block? interacts with the block nesting scope. This causes confusingD definitions and violates that all type definitions within a declare block are simultaneous. p2p2d4 p2p2d4TF12) - Named constants in new constant declarations cannot be used with; arithmetic operators. pi = 3.124, then mpi = - pi fails.  p3d1H13 - Variant checking is not implemented. Therefore the following tests% fail by typing "error not detected". p4p3p3d5 p4p3p3d6 p4p3p3d7 p4p3p3d8M14 - Set inclusion, intersection etc operators don't work yet. ( <=, >= etc.) P4p3p4d2H14a - (pdp-11 only) Registers exhausted error. Just gives up then finds bad stack at semi-colon. p4p3p4d5<15 - Are different sets of compatible base types compatible?/ Compiler implements NO. Is this what we want? P4p5d9C15a - Range checking not implemented on PDP-11. Hits BPT and bombs the 11 compiler. p4p6d4 p4p6d6E16 - The "arm x_nil_pointer" which should enable nil pointer checkingA ( if it was implemented) causes "incorrect object module" error.F VAX Compiler gets very sick. PDP-11 compiler seems ok but references9 the symbol: PRX$NI which I assume stands for NIL_check.i p5p4d1r p5p4d2iI17 - Dynamic ( on the stack) declarations are lost by intervening routines8 declarations. That is scope and extent get messed up.  p6p1d4bM17a - Long_real on PDP-11s. Long_real(3.114) causes "unimplemented feature"t error.  p6p2d3t p6p6p2d1 M18 - Functions returning large items generates bad code such that the routine D bombs at run-time. One item returned is a SET so this may be a set9 implementation problem. (seems to only bomb Vax version)c p6p2d4iM19- Function type checking error. Function specified as a type, and the typeeE defines the formal paramter, doesn't match the actual when supplied..% ( vax generates error, Pdp-11 bombs)1 p6p3p1d5 p6p3p3d1I20- Vax run-time support for FREE should check for NIL pointer and raise exception if its bad news.:" p6p5p3d3 freeing nil pointer test, p6p5p3d4 freeing uninitialized pointer test, p6p5p3d5 pointer aliasing test( not caught)J21 - Syntax errors when semi-colons used in various places in the declareD block and in the param/endparam block. I'm not sure what exactly causes this. p6p5p4d1sI22 - Fortran routines on VAX. The word Fortran on the VAX version shouldC do nothing. Second order on the VAX the Fortran should tell it torC pass the ?N value by REF not VAL since it is easier to fake on the)B VAX fortran routines.( don't need to say %val) The pdp-11 rulesE for Fortran stuff should remain the same. The passing of a routine E in or out of Fortran routines on the 11 should be changed to requiretH it by VAL, not REF since thats how fortran actually does it. Right now& we force all parameters to be by REF.I We should dicuss the rules for general as well, to make sure we get what we want/need.I23a - Real arithmetic. PDP-11 version gives unimplemented feature error.P Then gives "x_failed_assertion" p6p6p2d3wM24- The functions floor,ceiling,round, and integer give the compiler trouble. Bad stack at semicolon. p6p6p3d1eN25 - Long_real constants are handled. That is " x = long_real(3.9)" doesn't( define a long_real constant called "x". Blows 11 compiler up. p7p1d2LO26 - Arithmetic exception checks aren't implemented. The"arm x_zero_divide" anduH and other checking for arithmetic exceptions on Vax and 11; do nothing. p7p2p2d3 integers p7p2p2d3C cardinals p7p2p2d8 MOD with zero argrJ27 - Set operations ( + , - , = , * ) don't work and cause the compiler to* raise the "x_failed_assertion" exception. p7p2p4d3aK28 - Set operations ( <=, >, <, >= ) don't work. Gives type compatibility u problems. p7p2p5d2dH29 - Evaluation order. When pointers are involved, the left side of an A asignment gets evaluated before the right side? Is this what we G want? What about when volatile is used? With volatile stuff this ISwF relevant. Also when EXPLICIT is used what do we have? We don't haveC an EXPLICIT for the whole asignment statement, so I feel the rule aG be definite. For non-pointer operations it appears that the right sidel& of the assignment is evaluated first. p8p2p2d2 P30 - Select/case statement. When a select statement does not contain a constantE of the selected value, we just ignore it and go merily on. I think tG this should raise an exception. It is too easy to forget one elementcG in specifiying the case elements. If we don't raise an exception, we pF are leaving a very error prone construct in the language. If the guyE does one this effect he can get it by specifying an empty Default: .e s p8p3p5d5a p8p3p5d6tH31 - Real and long_real FOR loops. When the index of a FOR loop is realB or long_real loop should start on the actual first value, and the@ tests should be against the actual final value using the actualC index value. It appears that the tests truncate the values givings= mixed results depending on the actual real numbers employed.m p8p3p9d10 realk+ p8p3p9d10L long_real ( blows 11 compiler)tH32 - Order of evaluation of limits in a FOR statement. What is Praxis'sA definition here? Should it always be that the first expressionn@ is done first? I think so, since the language purposely allowsC aliasing. What happens if the expressions have volatile variablesuG in them. ( An Aside: note that a volatile function does make sense.)n p8p3p9d15F33- FOR loop nesting. THe FOR loops can't nest deeper than 15 levels.F Why not? Should we leave this? Perhaps if we also get 15 levels on the PDP-11. p8p3p9d20I34 - Extremal FOR loops. When the indices either integer or cardinal runfD up to either the smallest or largest numbers the for loops INFINITEG loop. I don't know of a simple fix for this. We certainly don't wantF to glop up the code gen in general. We should test this in Fortran!* How does Fortran handle the same problem? p8p3p9d7:/ p8p3p9d7D ( x_failed_assertion on 11 compiler) p8p3p9d7E0 p7p3p9d7C ( x_failed_assertion on 11 compiler )O35 - FOR loop usage of ".." notation. The range constant form of the FOR loopnE gives a syntax error. It used to work. The form "FOR I IN 4..6 DO"a: doesn't work. Specifying a range type however does work. p001range p001forP35a - (pdp-11 only) 32 bit arith operations. * and ** . This module bombs 11 compiler. p001operaI36 - Constant folding with ** operator. We don't handle constant foldingn* on things of the form " a = 0.114 ** 5 " 1 p001expon@37 - STARTING doesn't work. Always raises "x_failed_assertion". p001start p002start p003start p004start p005start p006start p007start p008start p009start p010start p011startM38 - Size specification on individual variables. Saying " a : 1 bit logical"oF or " b : 1 bit boolean" doesn't work for single variables. They workB within structures, but not alone. These used to work before you  completely upgraded packing.o p003size 1 bit in variables p004size 1 bit in type,38a - Size/range conflicts. o p005sizes p009sizeiI39 - Size on enumerations. WE had decided to allow size on enumerations.=? Apparantly thats not implemented. Shall we leave it that way?. p010sizeoV40 - Multiple sized cardinal arithmetic. Blows compiler. Causes "x_failed_assertion" _ p001cards p002cards# p003cards (PDP-11 only, ok on Vax)nN41 - EXPLICIT. Explicit is undefined. We never deleted it. where did it go. p001expltM42 - PACKED. A PACKED structure should be the same as a structure of Packed A components. Or should it? Both manuals talk about PACKED in atH very confused manner. We need to sit down a rigidly define the packingH rules, since you now believe them to be correct. ( I hope! ). With theH PDP-10 compiler forcing a redo of Packed, the rules have changed. Lets1 get the manuals up-to-date to reflect the rules.i p001packhO43 - Operations on Packed aggregates. The following modules fail a compilcatedW7 series of tests of Packed structure and packed arrays.e p002pack p003pack p004packe p005packo! p006pack (Pdp-11 bad, ok on VAX)e p007packl! p008pack (pdp-11 bad, ok on Vax)i! p009pack (pdp-11 bad, ok on Vax)a! p010pack (pdp-11 bad, ok on Vax)e044 - ALLOCATE - nested allocates in constructors! Gives Error(99): compiler error. p002allocM45 - ALLOCATE Static and compile-time allocates don't work. Cause compilercC errors and breakpoint traps. Gives out error(99): compiler error.e p003alloc constant & static446 - ALLOCATE block initialization done incorrectly. p006allocL47 - FREE of big blocks. PRXLIB is wrong! Can't FREE a block greater than  100 bytes long on the VAX.t p007allocL48 - Allocates on initiallys of fields of a type. The allocate specified onE a type initially causes bad code generation, and subsequent crash of the program.I p008alloc!48a - Allocate on type initially.s+ p009alloc blows both Vax and 11 compilers.uO49 - Allocate of flex array doesn't allow initialization using the flex length.D This I guess is a language implementation restriction. Ok for now. p007flextO50 - Pointers to flex arrays as parameters with an allocate inside the routine.k Compiler botches this somehow. p008flexsN51 - Flexible arrays: This feature is not totally implemented. The following features don't work. , a)- Having the lower bound only be flexible2 b)- Having both lower and upper bound be flexibleD c)- specifying a negative flexible bound. ( ie [-20..?N] and N=-10)D d)- Error reporting if flexy parameter not specified by REF is very confusing.G e)- Flexible array as last element of a strucure. THis is needed badly 7 to do a viable string package, and for other reasons.n x001flexx x002flex x003flexy x004flex?51a - More Flexy problems. These are simpler tests then above.t p009flexe p010flexa p012flexm p013flexM52 - Sets and For loops. Iterating through a set with a for loop. Compilerp get bad stack a semicolon x001setsL53 - Sets of Cardinals. Type checking error. The literals specified in theI set constructor don't appear to be forced to type cardinal from integer.H Says type 96 doesn't match type 97. Also poor error diagnostic. Should0 say the predefined type names, not the numbers.H Also blows the compiler with "x_failed_assertion"; but this may be form7 the set operations being unimplemented for large sets.n x002sets type checkingo hD54 - SEts - More problems with sets. Large ones and set operations. x003setsa x004setslL55 - Interlocks in pointer structures. The ADD_to_queue example from Jan's D manual fails. Most other interlock aspects pass fairly good tests.D x004locks (pdp-11 only -> "inconsistent stack address assignments)" x006locks x007locksL55a - RAISE FINISHING - A raise finishing of an interlock doesn't always getK handled correctly. The VAX version generates bad code, the Pdp-11 version< generates the error "inconsistent stack address assignment"( p001fini fails VAX, 11 is incon.. stack. p002fini passes Vax, 11 is inconsistent stack- p003fini fails vax, 11 is inconsistent stackrL56 - Volatile - The right side of an assignment should be evaluated first if- the expression contains a voltile component.p x001volatJ57 - Variadic - Now has a new syntax. The LRM and Tutorial are incorrect.B New form is: " x : variadic type_def" and the number of args/ specified is gotten by the function "High(x)".E* p001vari Shows new form. Works correctly p002vari new form , okc58 - HIDDEN - many problemsh/ x001hidn Can't specify hidden on variable specn( x002hidn Can't specify hidden on a type x003hidng x004hidni3 x005hidn Import into nested module- blows compiler 1 x006hidn Funny nested module - fails at run-time,2 x007hidn Funny nested module - what should it do?)59 - READONLY - generates a syntax error. x001readoE60 - FOR loop indice is assignable. One can write the for loop indexr@ when within the for loop. This is suppose to be illegal. AlsoC one can pass it to an out formal parameter. Both these operationsX# are illegal and should be caught. ,C r8p3p9d16 these tests should be "P" tests. I'll change them later., r8p3p9d19 r8p3p9d2L r8p3p9d3tJ61 - REAL - The PDP-11 code generation messes up the handling of registersC on various floating point operations. It seems to confuse regularC7 registers with floating point accumulators(registers).e1 Praxmath macro assemble catches the bad code gent p001when- p6p2d1  p6p2d6t p6p6p2d3d p6p6p2d4c p6p6p2d50 p6p6p2d67 p6p6p2d7bJ62 - M01cvrul1,P01cvrra etc - Infinite loop the 11 compiler. Uses 32 bit cardinals in p01cvvra.c63 - A64 - M*****************************************************************************s@The following are FAIL routines which give the compiler trouble.>1- F1p5d5 - lexical problem with " a=1 234" or "b = 0 .1234"# Compiler gets an acess violation.-I2- f4p1d3 - fails to detect a structure field referencing itself, due to+ the name being defined in an outer scope.sK3 - f4p5d2 - Are subranges of the same enumeration, compatible types? ThiseC tests says that they are. Others elsewhere showed that they were h not.U4 - f7p2p4d1 - Overlapping sets. Should compiler detect the use of overlapping sets?iL5 - f001size - Fails to detect specification of a 37 bit and 36 bit integer.M6 - f001const - Constant literals should be checked at compile-time to insurel? that they fit in the size object. Especially for the default > size things like integers etc. Placing large literals into/ a 16 bit integer on the pdp-11 is not caught.nN7 - f001init - Initializing an array with a constructure which has the indices8 wrong for the underlying type is not caught. That isA for an array[1..272] we use a constructure with [1..545]:$a andF the compiler doesn't choke. I don't know what code is generated for! the copy into the actual array.CJ8 - f005optnl - the initially clause type on an optional parameter spec isB not type checked with the formal. THus one can say as a formal:' x : optional boolean initially 3.114r) with no error. Who knows what it does.  James R Greenwoodd Nova/Novette Consultant