Message ID | 20200306182419.13945-2-vgupta@synopsys.com |
---|---|
State | Superseded |
Headers |
Received: (qmail 123540 invoked by alias); 6 Mar 2020 18:24:50 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 123408 invoked by uid 89); 6 Mar 2020 18:24:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: smtprelay-out1.synopsys.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1583519068; bh=Pb/epUPlJqEEBZOQ82k8aY5UgqWbgBxI3MOnpVBjbg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRDMzQ5Vhe/PZDFtXSiJtNFNItknnpeSwxMh1ccvdGCLtja0A1UnSM0C7PUdt/fvp ocZS5W5WpsnRm8vF0nmwQpzo8wY7aZKZQOq6Y6vmuc88bU9NS4XuzXs0M+n3ValB7S OYWw/ewx+9F6li4Dw+p7EmG81r5Sf2hr5T3fcIBVq+Lpb+8ahEWKDCCLEjbFmlY7Rj TuXWMcS6dcbj1pXXPnm7X5+7Nk1vhEvoOE/Lvtg7oQkOnKfngUGBGarqzwqz7JxaLp 4CYv8r5CgWnE7ACy4divsE003f/QuAvcqayLyTlpz4vOgWs2ChfR3bFGO13IbqPWzw Glkw9CyiU8mJw== From: Vineet Gupta <Vineet.Gupta1@synopsys.com> To: libc-alpha@sourceware.org Cc: linux-snps-arc@lists.infradead.org, Vineet Gupta <Vineet.Gupta1@synopsys.com> Subject: [PATCH v3 01/17] gcc PR 88409: miscompilation due to missing cc clobber in longlong.h macros Date: Fri, 6 Mar 2020 10:24:03 -0800 Message-Id: <20200306182419.13945-2-vgupta@synopsys.com> In-Reply-To: <20200306182419.13945-1-vgupta@synopsys.com> References: <20200306182419.13945-1-vgupta@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Commit Message
Vineet Gupta
March 6, 2020, 6:24 p.m. UTC
simple test such as below was failing.
| void main(int argc, char *argv[])
| {
| size_t total_time = 115424; // expected 115.424
| double secs = (double)total_time/(double)1000;
| printf("%s %d %lf\n", "secs", total_time, secs); // prints 113.504
| printf("%d\n", (size_t)secs);
| }
The printf eventually called into glibc stdlib/divrem.c:__mpn_divrem()
which uses the __arc__ specific inline asm macros from longlong.h which
were causing miscompilation.
include/
2019-03-28 Vineet Gupta <vgupta@synopsys.com>
PR 89877
* longlong.h [__arc__] (add_ssaaaa): Add cc clobber
(sub_ddmmss): Likewise.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
stdlib/longlong.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
If this gets longlong.h back in sync with changes made in the GCC version, then please commit.
On 3/6/20 4:12 PM, Joseph Myers wrote: > If this gets longlong.h back in sync with changes made in the GCC version, > then please commit. Yes it does. The only differences now are in the initial licensing header due to glibc's variant bumping year and the http -> https. BTW, I don't think I asked for commit access before. I just rechecked MAINTAINERS wiki page and seems like someone needs to grant me that. Thx for taking a look. -Vineet
On 06/03/2020 21.24, Vineet Gupta wrote: > simple test such as below was failing. > > | void main(int argc, char *argv[]) > | { > | size_t total_time = 115424; // expected 115.424 > | double secs = (double)total_time/(double)1000; > | printf("%s %d %lf\n", "secs", total_time, secs); // prints 113.504 > | printf("%d\n", (size_t)secs); > | } > > The printf eventually called into glibc stdlib/divrem.c:__mpn_divrem() > which uses the __arc__ specific inline asm macros from longlong.h which > were causing miscompilation. > > include/ > 2019-03-28 Vineet Gupta <vgupta@synopsys.com> > > PR 89877 > > * longlong.h [__arc__] (add_ssaaaa): Add cc clobber > (sub_ddmmss): Likewise. Is PR number in subject (88409) wrong? The one in Changelog (89877) seems to be right.
On 3/9/20 8:23 AM, Alexander Cherepanov wrote: >> >> PR 89877 >> >> * longlong.h [__arc__] (add_ssaaaa): Add cc clobber >> (sub_ddmmss): Likewise. > > Is PR number in subject (88409) wrong? The one in Changelog (89877) seems to be > right. Yes you are right. I'll fix this up. Thx, -Vineet
On 3/6/20 4:21 PM, Vineet Gupta wrote: > > BTW, I don't think I asked for commit access before. I just rechecked MAINTAINERS > wiki page and seems like someone needs to grant me that. Hi Joseph, Carlos I'm trying to setup my sourceware account etc and the form below [1] needs "email address of person who approved request". Whats the typical procedure for getting that ? Thx, -Vineet [1] https://sourceware.org/cgi-bin/pdw/ps_form.cgi
On 3/10/20 1:23 PM, Vineet Gupta wrote: > On 3/6/20 4:21 PM, Vineet Gupta wrote: >> >> BTW, I don't think I asked for commit access before. I just rechecked MAINTAINERS >> wiki page and seems like someone needs to grant me that. > > Hi Joseph, Carlos > > I'm trying to setup my sourceware account etc and the form below [1] needs "email > address of person who approved request". Whats the typical procedure for getting > that ? Please take a look at the following page: "Becoming a maintainer (developer)": https://sourceware.org/glibc/wiki/MAINTAINERS#Becoming_a_maintainer_.28developer.29 ~~~ 5. Ask for commit access. * Ask one of the project stewards to authorize your commit access. * If the project steward authorizes you for commit access follow these instructions to create a sourceware account with commit access to the glibc repository. ~~~ Joseph and I are both stewards. "Project stewards (GNU package maintainers)" https://sourceware.org/glibc/wiki/MAINTAINERS#Project_stewards_.28GNU_package_maintainers.29 I would be happy to authorize your commit access. I assume your intent is to be one of the machine maintainers for ARC? > Thx, > -Vineet > > [1] https://sourceware.org/cgi-bin/pdw/ps_form.cgi >
On 3/10/20 10:57 AM, Carlos O'Donell via Libc-alpha wrote: > Please take a look at the following page: > > "Becoming a maintainer (developer)": > https://sourceware.org/glibc/wiki/MAINTAINERS#Becoming_a_maintainer_.28developer.29 > ~~~ > 5. Ask for commit access. > > * Ask one of the project stewards to authorize your commit access. > > * If the project steward authorizes you for commit access follow these > instructions to create a sourceware account with commit access to the > glibc repository. > ~~~ > > Joseph and I are both stewards. > "Project stewards (GNU package maintainers)" > https://sourceware.org/glibc/wiki/MAINTAINERS#Project_stewards_.28GNU_package_maintainers.29 > > I would be happy to authorize your commit access. > > I assume your intent is to be one of the machine maintainers for ARC? Yeah, this email was my indirect way of asking for commit access :-) Indeed this is for ARC glibc machine maintainer. Thx, -Vineet
On 3/10/20 2:08 PM, Vineet Gupta wrote: > On 3/10/20 10:57 AM, Carlos O'Donell via Libc-alpha wrote: >> Please take a look at the following page: >> >> "Becoming a maintainer (developer)": >> https://sourceware.org/glibc/wiki/MAINTAINERS#Becoming_a_maintainer_.28developer.29 >> ~~~ >> 5. Ask for commit access. >> >> * Ask one of the project stewards to authorize your commit access. >> >> * If the project steward authorizes you for commit access follow these >> instructions to create a sourceware account with commit access to the >> glibc repository. >> ~~~ >> >> Joseph and I are both stewards. >> "Project stewards (GNU package maintainers)" >> https://sourceware.org/glibc/wiki/MAINTAINERS#Project_stewards_.28GNU_package_maintainers.29 >> >> I would be happy to authorize your commit access. >> >> I assume your intent is to be one of the machine maintainers for ARC? > > Yeah, this email was my indirect way of asking for commit access :-) > Indeed this is for ARC glibc machine maintainer. Please submit the request then and include my email.
On 3/6/20 4:12 PM, Joseph Myers wrote: > If this gets longlong.h back in sync with changes made in the GCC version, > then please commit. This is now committed (my first commit yay !) Thx, -Vineet
diff --git a/stdlib/longlong.h b/stdlib/longlong.h index ee4aac1bb5a0..638b7894d48c 100644 --- a/stdlib/longlong.h +++ b/stdlib/longlong.h @@ -199,7 +199,8 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype); : "%r" ((USItype) (ah)), \ "rICal" ((USItype) (bh)), \ "%r" ((USItype) (al)), \ - "rICal" ((USItype) (bl))) + "rICal" ((USItype) (bl)) \ + : "cc") #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ __asm__ ("sub.f %1, %4, %5\n\tsbc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ @@ -207,7 +208,8 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype); : "r" ((USItype) (ah)), \ "rICal" ((USItype) (bh)), \ "r" ((USItype) (al)), \ - "rICal" ((USItype) (bl))) + "rICal" ((USItype) (bl)) \ + : "cc") #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v) #ifdef __ARC_NORM__