From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14860 invoked by alias); 26 Feb 2002 18:06:03 -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 14797 invoked by uid 71); 26 Feb 2002 18:06:02 -0000 Resent-Date: 26 Feb 2002 18:06:02 -0000 Resent-Message-ID: <20020226180602.14796.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, kbosley@arbortext.com Received:(qmail 8878 invoked from network); 26 Feb 2002 17:59:49 -0000 Received: from unknown (HELO smtpgw3.arbortext.com) (198.108.59.202) by sources.redhat.com with SMTP; 26 Feb 2002 17:59:49 -0000 Message-Id:<200202261759.MAA0000147022@labalpha1.arbortext.com> Date: Tue, 26 Feb 2002 10:16:00 -0000 From: kbosley@arbortext.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c/5787: gcc-3.0.4 generates incorrect DEC ALPHA code in a varargs function X-SW-Source: 2002-02/txt/msg00714.txt.bz2 List-Id: >Number: 5787 >Category: c >Synopsis: gcc-3.0.4 generates incorrect DEC ALPHA code in a varargs function >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Feb 26 10:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Kevin Bosley >Release: 3.0.4 >Organization: ArborText, Inc. >Environment: System: OSF1 labalpha1.arbortext.com V5.1 1885 alpha Machine: alpha host: alphaev56-dec-osf5.1 build: alphaev56-dec-osf5.1 target: alphaev56-dec-osf5.1 configured with: ../../gcc-3.0.4/configure --prefix=/ati/devel/tools/gcc-3.0.4/install/alpha --enable-shared --enable-threads >Description: GCC version 3.0.4 generates bad subroutine prolog code for a varargs function on a DEC ALPHA platform. To be precise, it generates code which saves general registers 19, 20, 21 and floating point registers f19, f20, and f21 outside of the allocated stack frame. It generates the correct save instructions for registers 19, 20, and 21 as well. Here is an excerpt of the generated prolog. The comments to the right indicate the error: test: .frame $15,64,$26,24 .mask 0x4008000,-64 $test..ng: lda $30,-64($30) only 64 bytes allocated for frame stq $26,0($30) stq $15,8($30) mov $30,$15 .prologue 0 stq $16,16($15) mov $17,$1 stq $18,32($15) stq $19,112($15) ---+ stq $20,120($15) | stq $21,128($15) | stt $f19,64($15) => bad save code, writes past 64 byte frame stt $f20,72($15) | stt $f21,80($15) ---+ stq $19,40($15) correct save code for 19-21 stq $20,48($15) stq $21,56($15) stl $1,24($15) mov $15,$30 >How-To-Repeat: Here's the preprocessor output: ***** START OF PREPROCESSOR OUTPUT ***** # 35 "badprolog.c" typedef struct { char *w; long x; void *y; void *z; } badtype; void test(char *a, int b, char *c, badtype d, ...) { } ***** END OF PREPROCESSOR OUTPUT ***** >Fix: The only workaround I know of is to recode the function to take the address of struct "badtype" as a parameter instead Thanks for your assistance! Kevin L. Bosley Manager of Software Development Arbortext, Inc. 1000 Victors Way Ann Arbor, MI 48103 734-327-6077 >Release-Note: >Audit-Trail: >Unformatted: