From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31259 invoked by alias); 15 Mar 2002 23:56:04 -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 31185 invoked by uid 71); 15 Mar 2002 23:56:02 -0000 Resent-Date: 15 Mar 2002 23:56:02 -0000 Resent-Message-ID: <20020315235602.31183.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, janis187@us.ibm.com Received:(qmail 21895 invoked by uid 61); 15 Mar 2002 23:50:30 -0000 Message-Id:<20020315235030.21894.qmail@sources.redhat.com> Date: Fri, 15 Mar 2002 15:56:00 -0000 From: janis187@us.ibm.com Reply-To: janis187@us.ibm.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/5977: ia64 corruption in struct args passed by value X-SW-Source: 2002-03/txt/msg00548.txt.bz2 List-Id: >Number: 5977 >Category: target >Synopsis: ia64 corruption in struct args passed by value >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Fri Mar 15 15:56:02 PST 2002 >Closed-Date: >Last-Modified: >Originator: Janis Johnson >Release: gcc version 3.1 20020315 (prerelease) >Organization: >Environment: Itanium, Red Hat Linux release 7.1.94 (Roswell) >Description: The 3.1 prerelease compiler for ia64-unknown-linux-gnu has problems when passing struct arguments by value from a function to which they were also passed by value. This shows up with the SPEC CPU2000 benchmark program 175.vpr, but the test case here bears no resemblance to the original code. This is a regression from GCC 3.0.4. >How-To-Repeat: Compile the test case on ia64 with default options; when run it will abort. >Fix: Unknown. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="bug.c" Content-Disposition: inline; filename="bug.c" /* This test case fails at runtime when compiled, with any options, with gcc version 3.1 20020315 (prerelease) on ia64-unknown-linux-gnu. It passes two structs by value to a function that then passes them by value to another function, in which the values of the second struct argument are corrupted. */ struct S { int i1; int i2; int i3; int i4; int i5; int i6; int i7; int i8; int i9; }; struct S gs1, gs2; void init (struct S *p, int i) { p->i1 = 1 + i; p->i2 = 2 + i; p->i3 = 3 + i; p->i4 = 4 + i; p->i5 = 5 + i; p->i6 = 6 + i; p->i7 = 7 + i; p->i8 = 8 + i; p->i9 = 9 + i; } void check (struct S *p, int i) { if (p->i1 != 1 + i) abort (); if (p->i2 != 2 + i) abort (); if (p->i3 != 3 + i) abort (); if (p->i4 != 4 + i) abort (); if (p->i5 != 5 + i) abort (); if (p->i6 != 6 + i) abort (); if (p->i7 != 7 + i) abort (); if (p->i8 != 8 + i) abort (); if (p->i9 != 9 + i) abort (); } void bar (struct S s1, struct S s2) { check (&s1, 10); check (&s2, 20); } void foo (struct S s1, struct S s2) { bar (s1, s2); } int main () { init (&gs1, 10); check (&gs1, 10); init (&gs2, 20); check (&gs2, 20); foo (gs1, gs2); exit (0); }