From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119263 invoked by alias); 3 Apr 2019 17:28:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 119115 invoked by uid 89); 3 Apr 2019 17:28:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=folks X-HELO: smtprelay.synopsys.com Received: from us01smtprelay-2.synopsys.com (HELO smtprelay.synopsys.com) (198.182.60.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Apr 2019 17:28:09 +0000 Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 8894A10C23EE; Wed, 3 Apr 2019 10:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1554312487; bh=8zwUt2pVQ6FrkRrALTqePjWl5p77zdjErFXFHd7f/AU=; h=From:To:CC:Subject:Date:References:From; b=gpbsI7rDUxoTxM5ik8VHy63yb4aCjEbr/OkIGk76GCUWAe6IVoD5ThUJ/u+18u/gT T0A4mGDo93beWe5Ar4yDNl4evpVZFcfjfe/Ac6ZcK0P41HTn/lnHRm5zckPqSl9wNs BUbQCSnRMBHyWSPePRnM3T+cvGQF2wsO2kiyLyhw+smeKIRXzC62w78t06HuDw9xbM LxPQPvSYoDVGk+N7MSkkoQl5Uzpxhw+jQBUPctNgxyV/3DG3VbN1wOAXnG+iG4PznZ BCkw9LlXcOq2ygTrEBCCIf5+ndMGJvReTSyq7qxNPEO4PE31NmV7XP9WQfhHGW46ly /EeXWExk4MfgA== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 66299A005D; Wed, 3 Apr 2019 17:28:07 +0000 (UTC) Received: from US01WEMBX2.internal.synopsys.com ([fe80::e4b6:5520:9c0d:250b]) by US01WEHTC2.internal.synopsys.com ([10.12.239.237]) with mapi id 14.03.0415.000; Wed, 3 Apr 2019 10:28:07 -0700 From: Vineet Gupta To: Claudiu Zissulescu CC: "gcc-patches@gcc.gnu.org" , "linux-snps-arc@lists.infradead.org" , Claudiu Zissulescu Subject: Re: [PATCH] [ARC] PR 88409: miscompilation due to missing cc clobber in longlong.h macros Date: Wed, 03 Apr 2019 17:28:00 -0000 Message-ID: References: <1554229653-6059-1-git-send-email-vgupta@synopsys.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2019-04/txt/msg00143.txt.bz2 On 4/3/19 2:53 AM, Claudiu Zissulescu wrote: > Pushed, thank you for your contribution, > Claudiu Thx, can this be backported to gcc-8-stable please which is what glibc folk= s use for testing ! -Vineet > > On Tue, Apr 2, 2019 at 9:27 PM Vineet Gupta = wrote: >> simple test such as below was failing. >> >> | void main(int argc, char *argv[]) >> | { >> | size_t total_time =3D 115424; // expected 115= .424 >> | double secs =3D (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 >> >> PR 89877 >> >> * longlong.h [__arc__] (add_ssaaaa): Add cc clobber >> (sub_ddmmss): Likewise. >> >> Signed-off-by: Vineet Gupta >> --- >> include/ChangeLog | 7 +++++++ >> include/longlong.h | 6 ++++-- >> 2 files changed, 11 insertions(+), 2 deletions(-) >> >> diff --git a/include/ChangeLog b/include/ChangeLog >> index be08141deeb9..96d967d10a52 100644 >> --- a/include/ChangeLog >> +++ b/include/ChangeLog >> @@ -1,3 +1,10 @@ >> +2019-03-28 Vineet Gupta >> + >> + PR 89877 >> + >> + * longlong.h [__arc__] (add_ssaaaa): Add cc clobber >> + (sub_ddmmss): Likewise. >> + >> 2019-02-11 Philippe Waroquiers >> >> * splay-tree.h (splay_tree_delete_key_fn): Update comment. >> diff --git a/include/longlong.h b/include/longlong.h >> index 3dd8dc3aa80c..1f0ce4204255 100644 >> --- a/include/longlong.h >> +++ b/include/longlong.h >> @@ -199,7 +199,8 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDI= type, 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" \ >> : "=3Dr" ((USItype) (sh)), = \ >> @@ -207,7 +208,8 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDI= type, 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__ >> -- >> 2.7.4 >>