Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2002 14:24:08 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        current@freebsd.org
Subject:   aout support broken in gcc3
Message-ID:  <20020902141223.Y2138-100000@gamplex.bde.org>

next in thread | raw e-mail | index | archive | help
aout support is still required for a few things (mainly for compiling
some boot blocks), but is broken in gcc3 for at least compile-time
assignments to long longs and shifts of long longs by a non-constant
amount:

%%%
$ cat z.c
long long x = 0;
int y;

foo()
{
	x = x << y;
}
$ cc -O -S -aout z.c
$ cat z.s
	.file	"z.c"
.globl _x
	.data
	.p2align 3
	.type	_x,@object
	.size	_x,8
_x:
	.quad	0
	.text
	.p2align 2,0x90
.globl _foo
	.type	_foo,@function
_foo:
	pushl	%ebp
	movl	%esp, %ebp
	movb	_y, %cl
	movl	_x, %eax
	movl	_x+4, %edx
	shldl	%eax, %edx
	sall	%cl, %eax
	testl	$32, %ecx
	je	L2
	movl	%eax, %edx
	movl	$0, %eax
L2:
	movl	%eax, _x
	movl	%edx, _x+4
	leave
	ret
Lfe1:
	.size	_foo,Lfe1-_foo
	.comm	 _y,4
	.ident	"GCC: (GNU) 3.1 [FreeBSD] 20020509 (prerelease)"
%%%

The above assembler output has two syntax errors:
- ".quad 0".  .quad is not supported by the old aout assembler.
- "shldl %eax, %edx".  The old aout assembler only accepts the correct
  syntax of "shldl %cl,%eax,%edx".  Note that gcc doesn't elide the
  similarly implicit %cl register for the sall instruction.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020902141223.Y2138-100000>