From owner-freebsd-alpha Fri Jul 6 21:48:14 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 45CCB37B403 for ; Fri, 6 Jul 2001 21:48:10 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from beppo (mjacob@beppo [192.67.166.79]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f674lxS49971; Fri, 6 Jul 2001 21:48:04 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Fri, 6 Jul 2001 21:47:59 -0700 (PDT) From: Matthew Jacob X-Sender: mjacob@beppo Reply-To: mjacob@feral.com To: "David O'Brien" Cc: alpha@FreeBSD.ORG Subject: this a gcc bug? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I'm taking it your our point person for toolchain issues? If not, could you direct me to....? I was tracking down unaligned faults in ping... They come from an unaligned reference in that: struct sockaddr whereto; ... bzero((char *)&whereto, sizeof(struct sockaddr)); to = (struct sockaddr_in *)&whereto; ... (void)printf("PING %s (%s)", hostname, inet_ntoa(to->sin_addr)); ... pid 528 (ping): unaligned access: va=0x120017ad3 pc=0x120003850 ra=0x12000335c op=ldl Why? Well, in test compiling ping.c I found: yorp.feral.com > nm /tmp/ping |grep where 0000000120027b0f B whereto But was it the linker? No. Assembler output shows: ... .comm options,4,4 .comm rcvd_tbl,128,1 .comm whereto,16,1 ... Say &what&? Here we have a structure (struct sockaddr) that has only byte required alignment? Structs, no matter what there contents, have been ALDOUBLE since Portable C compiler days- or so I thought. Maybe I'm just showing my ignorance/age. Have I gone nuts? -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message