Building gpc-20051104 on i686-apple-darwin8

Adriaan van Os gpc at
Sun Nov 20 15:18:10 CET 2005

Waldek Hebisch wrote:

>> ? procedural parameter and local procedure problems (? trampolines ?)
>> the following test failures look the same:
>> * backtraceerr.pas
>> * fjf35.pas
>> * fjf464c.pas
>> * fjf464e.pas
>> * fproc.pas, same
>> * knuth1.pas, same
>> * nicola4d.pas, same
>> * nlgpp.pas
>> * nlgpp2.pas
>> * t6334-2.pas
>> * t6p6p3p4.pas
>> <snip>
>> Anything I can do to investigate this further and report it to gcc
>> bugzilla ?
> Basic precedure I use is: first debug the test program. There is added
> difficulty that one has to down to assembly level. Once the exact 
> problem
> with generated code is known one looks why the compiler generated this
> code.
> The long list starting with backtraceerr.pas looks like tests for
> nonlocal jumps (and related). We had problems with them on various
> platforms in the past. To demonstrate that the problems indeed are
> backend problems we have translated few of the tests to C. The tests
> should be now in GCC testsuite, but probably buried between thousends
> of other tests. I would suggest finding tests attached to past bug
> reports about nonlocal jumps and check if they work with the C 
> compiler.
> If you have problem finding the tests I can search for them. If the
> tests work with the C compiler then we need to do extra work. If not
> we should report that to backend developers.

I believe trampolines are failing rather non-local goto's. The 
nonlocxxgoto.pas tests pass with --no-pic, but a simplified version of 
fjf35.pas fails.

program tramp;

procedure pp(procedure proc);

procedure global;

   procedure loc;



Assembly with --no-pic:

	pushl	%ebp	#
	movl	%esp, %ebp	#,
	subl	$8, %esp	#,
	movl	8(%ebp), %eax	# Proc, Proc
	call	*%eax	# Proc
	pushl	%ebp	#
	movl	%esp, %ebp	#,
	subl	$4, %esp	#,
	movl	%ecx, -4(%ebp)	#,
	pushl	%ebp	#
	movl	%esp, %ebp	#,
	subl	$40, %esp	#,
	leal	-24(%ebp), %eax	#, tmp61
	addl	$0, %eax	#, tmp60
	andl	$-1, %eax	#, tmp60
	movl	$_Loc.0, %ecx	#, tmp63
	leal	10(%eax), %edx	#, tmp64
	subl	%edx, %ecx	# tmp64,
	movl	%ecx, %edx	#, tmp62
	movb	$-71, (%eax)	#,
	leal	-8(%ebp), %ecx	#,
	movl	%ecx, 1(%eax)	#,
	movb	$-23, 5(%eax)	#,
	movl	%edx, 6(%eax)	# tmp62,
	leal	-24(%ebp), %eax	#, tmp59
	addl	$0, %eax	#, tmp58
	andl	$-1, %eax	#, tmp58
	movl	%eax, (%esp)	# tmp58,
	call	__p__M0_S0_Pp	#

This would also mean that 
<> is wrong (or right 
for the wrong reasons). I will try the gcc testsuite, but I bet 
trampolines fail there also. I couldn't find anything related to 
darwin/x86 and trampolines on the gcc mailing list, so I think they 
didn't even bother.


Adriaan van Os

More information about the Gpc mailing list