From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17593 invoked by alias); 18 Mar 2003 23:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17548 invoked by uid 71); 18 Mar 2003 23:26:00 -0000 Resent-Date: 18 Mar 2003 23:26:00 -0000 Resent-Message-ID: <20030318232600.17547.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, p.van-hoof@qub.ac.uk Received: (qmail 27216 invoked from network); 18 Mar 2003 23:20:15 -0000 Received: from unknown (HELO mta05-svc.ntlworld.com) (62.253.162.45) by sources.redhat.com with SMTP; 18 Mar 2003 23:20:15 -0000 Received: from scooby.star.fleet ([80.6.77.177]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20030318232007.ZGBO310.mta05-svc.ntlworld.com@scooby.star.fleet>; Tue, 18 Mar 2003 23:20:07 +0000 Received: (from pvh@localhost) by scooby.star.fleet (8.12.2+Sun/8.12.2/Submit) id h2INJt4D002990; Tue, 18 Mar 2003 23:19:55 GMT Message-Id: <200303182319.h2INJt4D002990@scooby.star.fleet> Date: Tue, 18 Mar 2003 23:26:00 -0000 From: p.van-hoof@qub.ac.uk To: gcc-gnats@gcc.gnu.org Cc: p.van-hoof@qub.ac.uk X-Send-Pr-Version: 3.113 Subject: c/10142: gcc -m64 produces wrong code when passing struct as parameter X-SW-Source: 2003-03/txt/msg01239.txt.bz2 List-Id: >Number: 10142 >Category: c >Synopsis: gcc -m64 produces wrong code when passing struct as parameter >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Mar 18 23:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Peter van Hoof >Release: 3.2.2 >Organization: Queen's University of Belfast >Environment: System: SunOS scooby 5.9 Generic_112233-04 sun4u sparc SUNW,Sun-Blade-100 Architecture: sun4 host: sparc-sun-solaris2.9 build: sparc-sun-solaris2.9 target: sparc-sun-solaris2.9 configured with: /opt/temp/gcc-3.2.2/configure --prefix=/opt/local --enable-threads >Description: In the program below, a struct is passed as a parameter to a routine. This is clearly done incorrectly, as demonstrated by the print statements. This bug is triggered by the -m64 flag on the command line, even in non-optimized mode. This bug is present in gcc 3.2.2, as well as 3.3 and 3.4. >How-To-Repeat: scooby> gcc h.c scooby> a.out 1.20e+00 25 1.20e+00 25 scooby> gcc -m64 h.c scooby> a.out 1.20e+00 25 1.20e+00 -2147488472 scooby> cat h.c typedef struct { double m; long x; } mx; void b(int i1,int i2,int i3,int i4,int i5,int i6,mx m) { printf("%.2e %ld\n",m.m,m.x); } int main() { mx z={1.2, 25}; printf( "%.2e %ld\n", z.m, z.x ); b(1,2,3,4,5,6,z); return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: