From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 42F552F1AD for ; Tue, 26 Sep 2000 06:13:24 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.8.7/8.8.7) id GAA25837 for axp-list@listman.redhat.com; Tue, 26 Sep 2000 06:13:24 -0400 Received: from snowball.ucd.ie (snowball.ucd.ie [193.1.132.97]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id GAA25832 for ; Tue, 26 Sep 2000 06:13:22 -0400 Received: from genie.ucd.ie ([193.1.132.80]:18949 "EHLO genie.ucd.ie") by snowball.ucd.ie with ESMTP id ; Tue, 26 Sep 2000 11:12:52 +0100 Received: by genie.ucd.ie with local (Exim 3.03 #1 (Debian)) id 13drjI-0004ci-00 for ; Tue, 26 Sep 2000 11:12:52 +0100 Date: Tue, 26 Sep 2000 11:12:52 +0100 To: axp-list@redhat.com Subject: Re: Weird Compaq CCC / GCC interaction ? Message-ID: <20000926111252.A17671@snowball.ucd.ie> References: <010C86D15E4D1247B9A5DD312B7F5AA70BEC27@stegosaurus.bristol.quadrics.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <010C86D15E4D1247B9A5DD312B7F5AA70BEC27@stegosaurus.bristol.quadrics.com>; from addy@quadrics.com on Tue, Sep 26, 2000 at 09:55:12AM +0100 From: Nikita Schmidt X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors On Tuesday, 26 Sep, David Addison wrote: > > Anyone know what's wrong ... is this a bug with ccc or gcc ? > This looks like a bug in gcc - see below why. > cat fn.c > > unsigned int fn() > { > return (0xc00fc00f); > } > [...] > > objdump -d fn_gcc.o > > fn_gcc.o: file format elf64-alpha > > Disassembly of section .text: > > 0000000000000000 : > 0: 0f c0 1f 20 lda v0,-16369(zero) > 4: 10 c0 00 24 ldah v0,-16368(v0) > 8: 20 f6 01 48 zapnot v0,0xf,v0 > c: 01 80 fa 6b ret zero,(ra),0x1 > ... > > objdump -d fn_ccc.o > > fn_ccc.o: file format elf64-alpha > > Disassembly of section .text: > > 0000000000000000 : > 0: 10 c0 1f 24 ldah v0,-16368(zero) > 4: 1f 04 ff 47 nop > 8: 0f c0 00 20 lda v0,-16369(v0) > c: 01 80 fa 6b ret zero,(ra),0x1 > > > GCC is inserting a ZAPNOT instruction to zero the top 4-bytes - is this > correct ? According to the Calling Standard for Alpha Systems, Section 4.1.5 "Unused Bits in Passed Data," both signed and unsigned ints should be passed sign-extended in registers. Gcc is compatible with itself, but not with any other compiler which follows the documented conventions. If gcc claims to be standards compliant, this is a bug; please submit a report. Nikita