NetBSD Problem Report #8952
Received: (qmail 5445 invoked from network); 4 Dec 1999 19:41:59 -0000
Message-Id: <199912041941.OAA205647@antharia.mit.edu>
Date: Sat, 4 Dec 1999 14:41:56 -0500 (EST)
From: Dan Winship <danw@MIT.EDU>
Reply-To: danw@MIT.EDU
To: gnats-bugs@gnats.netbsd.org
Subject: gcc on powerpc sometimes generates bad struct copies
X-Send-Pr-Version: 3.95
>Number: 8952
>Category: port-powerpc
>Synopsis: gcc on powerpc sometimes generates bad struct copies
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: port-powerpc-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 04 11:42:01 +0000 1999
>Closed-Date: Mon Nov 19 21:53:18 +0000 2001
>Last-Modified: Mon Nov 19 21:53:18 +0000 2001
>Originator: Dan Winship
>Release: current
>Organization:
>Environment:
System: NetBSD frotz 1.4M NetBSD 1.4M (FROTZ) #19: Fri Dec 3 14:22:05 EST 1999 root@frotz:/usr/src/sys/arch/macppc/compile/FROTZ macppc
>Description:
gcc on the powerpc outputs floating-point instructions to do
64-bit copies, but doesn't check that the data is properly
aligned.
>How-To-Repeat:
danw@frotz:/tmp> cat foo.c
int main(int argc, char **argv)
{
struct foo { short a, b, c, d; } one;
struct bar { short e; struct foo f; } two;
two.f = one;
}
danw@frotz:/tmp> gcc -o foo foo.c
danw@frotz:/tmp> ./foo
Bus error (core dumped)
>Fix:
Fix gcc to know it can't do that. (I think it actually only
needs to be 32-bit aligned: Changing the shorts to ints makes
it work.)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: matt
State-Changed-When: Mon Nov 19 13:47:03 PST 2001
State-Changed-Why:
Bug no longer present in gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.