From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11932 invoked by alias); 14 May 2003 17:12:28 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 11890 invoked from network); 14 May 2003 17:12:27 -0000 Received: from unknown (HELO palrel12.hp.com) (156.153.255.237) by sources.redhat.com with SMTP; 14 May 2003 17:12:27 -0000 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel12.hp.com (Postfix) with ESMTP id 7102F1C01F1D for ; Wed, 14 May 2003 10:12:26 -0700 (PDT) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.12.9/8.12.9/HPL-PA Hub) with ESMTP id h4EHCP4t023981 for ; Wed, 14 May 2003 10:12:26 -0700 (PDT) Received: from napali.hpl.hp.com (localhost [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-5) with ESMTP id h4EHCPrK028041 for ; Wed, 14 May 2003 10:12:25 -0700 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-5) id h4EHCPVc028037; Wed, 14 May 2003 10:12:25 -0700 Date: Wed, 14 May 2003 17:12:00 -0000 From: David Mosberger Message-Id: <200305141712.h4EHCPVc028037@napali.hpl.hp.com> To: libc-hacker@sources.redhat.com Subject: fix the setjmp fix Reply-To: davidm@hpl.hp.com X-SW-Source: 2003-05/txt/msg00019.txt.bz2 My previous fix for setjmp() introduced another bug. Embarrasing, but true: ar.unat was saved in a scratch register, but I forgot that setjmp is not a leaf (it calls __sigjmp_save). The patch below should help. Thanks to Gwenole Beauchesne from Mandrake for discovering and reporting this problem. --david 2003-05-13 David Mosberger * sysdeps/unix/sysv/linux/ia64/setjmp.S: Fix the fix from 2003-03-27: setjmp is NOT a leaf-routine (due to the call to __sigjmp_save) so we can't keep the saved unat value in a scratch register (r16). Use loc2 instead. Index: sysdeps/unix/sysv/linux/ia64/setjmp.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/setjmp.S,v retrieving revision 1.8 diff -u -r1.8 setjmp.S --- sysdeps/unix/sysv/linux/ia64/setjmp.S 27 Mar 2003 19:50:25 -0000 1.8 +++ sysdeps/unix/sysv/linux/ia64/setjmp.S 13 May 2003 17:49:28 -0000 @@ -86,9 +86,9 @@ ENTRY(__sigsetjmp) .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) - alloc loc1=ar.pfs,2,2,2,0 - .save ar.unat, r16 - mov r16=ar.unat + alloc loc1=ar.pfs,2,3,2,0 + .save ar.unat, loc2 + mov loc2=ar.unat ;; mov r17=ar.fpsr mov r2=in0 @@ -97,7 +97,7 @@ .mem.offset 8,0; st8.spill.nta [r2]=sp,16 // r12 (sp) .mem.offset 0,0; st8.spill.nta [r3]=gp,16 // r1 (gp) ;; - st8.nta [r2]=r16,16 // save caller's unat + st8.nta [r2]=loc2,16 // save caller's unat st8.nta [r3]=r17,16 // save fpsr add r8=0xa0,in0 ;; @@ -171,7 +171,7 @@ st8.nta [r3]=in0 // &__jmp_buf br.call.dpnt.few rp=__sigjmp_save .ret0: // force a new bundle ::q - mov.m ar.unat=r16 // restore caller's unat + mov.m ar.unat=loc2 // restore caller's unat mov rp=loc0 mov ar.pfs=loc1 mov r8=0