From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55785 invoked by alias); 27 Jun 2019 07:09:54 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 55743 invoked by uid 9078); 27 Jun 2019 07:09:54 -0000 Date: Thu, 27 Jun 2019 07:09:00 -0000 Message-ID: <20190627070954.55741.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] or1k: Correct longjmp return value X-Act-Checkin: newlib-cygwin X-Git-Author: Martin Erik Werner X-Git-Refname: refs/heads/master X-Git-Oldrev: 09e2ec87efa5ba167dffd19d39ce7a59b7ef7877 X-Git-Newrev: 8b080534cadd8b9e920c8b023e341937a2e274bc X-SW-Source: 2019-q2/txt/msg00027.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8b080534cadd8b9e920c8b023e341937a2e274bc commit 8b080534cadd8b9e920c8b023e341937a2e274bc Author: Martin Erik Werner Date: Wed Jun 26 17:44:54 2019 +0200 or1k: Correct longjmp return value Invert equality check instruction to correct the return value handling in longjmp. The return value should be the value of the second argument to longjmp, unless the argument value was 0 in which case it should be 1. Previously, longjmp would set return value 1 if the second argument was non-zero, and 0 if it was 0, which was incorrect. Diff: --- newlib/libc/machine/or1k/setjmp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/machine/or1k/setjmp.S b/newlib/libc/machine/or1k/setjmp.S index 5c02327..0b93a03 100644 --- a/newlib/libc/machine/or1k/setjmp.S +++ b/newlib/libc/machine/or1k/setjmp.S @@ -70,7 +70,7 @@ longjmp: /* If the second argument to longjmp is zero, set return address to 1, otherwise set it to the value of the second argument */ l.addi r11, r0, 1 - l.sfne r4, r0 + l.sfeq r4, r0 l.bf 1f l.nop l.addi r11, r4, 0