pc bug with set intersection - (nf)

stepp at uiuccsb.UUCP stepp at uiuccsb.UUCP
Wed Nov 9 13:36:00 AEST 1983


#N:uiuccsb:14900005:000:2220
uiuccsb!stepp    Nov  8 10:06:00 1983

The following program illustrates a bug in the code generator of pc.
We are running 4.1a BSD on an 11/780.

program errors(output);

var
      prtflags     : set of 'a'..'z';

begin
      prtflags := ['e'];
      if (prtflags*['a','e']=['e']) then
         writeln('true') else writeln('false');
      end.

When run through pi;px the output is 'true' (correct).
When run through pc;a.out the output is 'false' (***error***).

The -S output of pc follows.  I do not know the fix for this, is it ok in 4.2?

	.stabs	"cerror.p",0x30,0,0x1,0
	.data
	.align	2
	.comm	_prtflags,4
	.text
	.stabs	"prtflags",0x30,0,0x6,0x4
	.text
	.align	1
	.globl	_main
_main:
	.word	0
	calls	$0,_PCSTART
	movl	4(ap),__argc
	movl	8(ap),__argv
	calls	$0,_program
	calls	$0,_PCEXIT
	.text
	.align	1
	.globl	_program
_program:
	.word	L2
	jbr	L4
L3:
	moval	_UNWIND,0(fp)
	moval	__disply+8,-4(fp)
	movq	__disply+8,-12(fp)
	movq	ap,__disply+8
	.data
	.align 2
L6:
	.long	0x10
	.text
	movl	L6,_prtflags
	.data
	.align 2
L7:
	.long	0x11
	.text
	.data
	.align 2
L8:
	.long	0x10
	.text
	pushl	$L8
	pushl	$1
	pushl	$L7
	pushl	$_prtflags
	subl3	$32,fp,r0
	pushl	r0
	popr	$0x17
	movl	r0,r3
1:
	mcoml	(r1)+,r5
	bicl3	r5,(r2)+,(r3)+
	sobgtr	r4,1b
	pushl	r0
	pushl	$16
	popr	$0xb
	movl	r0,r4
1:
	movzwl	$65535,r0
	cmpl	r4,r0
	jleq	3f
	subl2	r0,r4
	cmpc3	r0,(r1),(r3)
	jeql	1b
2:
	clrl	r0
	jbr	4f
3:
	cmpc3	r4,(r1),(r3)
	jneq	2b
	incl	r0
4:
	tstl	r0
	jeql	L9
	moval	_output,-16(fp)
	.data
L10:
	.byte	0164,0162,0165,0145
	.byte	0
	.text
	pushl	-16(fp)
	movl	(sp)+,r1
	movl	12(r1),r0
	pushl	r0
	pushl	$1
	pushl	$4
	pushl	$L10
	calls	$4,_fwrite
	pushl	-16(fp)
	movl	(sp)+,r1
	movl	12(r1),r0
	pushl	r0
	cvtbl	$10,-(sp)
	sobgeq	*4(sp),1f
	calls	$2,__flsbuf
	jbr	2f
1:
	popr	$0x3
	movb	r0,*4(r1)
	incl	4(r1)
2:
	jbr	L11
L9:
	moval	_output,-16(fp)
	.data
L12:
	.byte	0146,0141,0154,0163,0145
	.byte	0
	.text
	pushl	-16(fp)
	movl	(sp)+,r1
	movl	12(r1),r0
	pushl	r0
	pushl	$1
	pushl	$5
	pushl	$L12
	calls	$4,_fwrite
	pushl	-16(fp)
	movl	(sp)+,r1
	movl	12(r1),r0
	pushl	r0
	cvtbl	$10,-(sp)
	sobgeq	*4(sp),1f
	calls	$2,__flsbuf
	jbr	2f
1:
	popr	$0x3
	movb	r0,*4(r1)
	incl	4(r1)
2:
L11:
	movq	-12(fp),__disply+8
	ret
	.set	L2, 0x0
L4:
	subl2	$LF1,sp
	.set	LF1,32
	jbr	L3



More information about the Comp.unix.wizards mailing list