From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: libc-alpha@sourceware.org
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>,
linux-snps-arc@lists.infradead.org
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 [thread overview]
Message-ID: <20200306182419.13945-2-vgupta@synopsys.com> (raw)
In-Reply-To: <20200306182419.13945-1-vgupta@synopsys.com>
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(-)
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__
--
2.20.1
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
next prev parent reply other threads:[~2020-03-06 18:24 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 18:24 [PATCH v3 00/17] glibc port to ARC processors Vineet Gupta
2020-03-06 18:24 ` Vineet Gupta [this message]
2020-03-07 0:12 ` [PATCH v3 01/17] gcc PR 88409: miscompilation due to missing cc clobber in longlong.h macros Joseph Myers
2020-03-07 0:21 ` Vineet Gupta
2020-03-10 17:23 ` sourceware account access (was Re: [PATCH v3 01/17] gcc PR 88409: miscompilation due to missing cc clobber in longlong.h macros) Vineet Gupta
2020-03-10 17:57 ` Carlos O'Donell
2020-03-10 18:08 ` sourceware account access Vineet Gupta
2020-03-10 18:10 ` Carlos O'Donell
2020-03-11 2:00 ` [PATCH v3 01/17] gcc PR 88409: miscompilation due to missing cc clobber in longlong.h macros Vineet Gupta
[not found] ` <d3d2969f-4370-588b-b9be-a9ae0d38e10e@openwall.com>
2020-03-09 23:38 ` Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 02/17] ARC: add definitions to elf/elf.h Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 03/17] ARC: ABI Implementation Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 04/17] ARC: startup and dynamic linking code Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 05/17] ARC: Thread Local Storage support Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 06/17] ARC: Atomics and Locking primitives Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 07/17] ARC: math soft float support Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 08/17] ARC: hardware floating point support Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 09/17] ARC: Linux Syscall Interface Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 10/17] ARC: Linux ABI Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 11/17] ARC: Linux Startup and Dynamic Loading Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 12/17] ARC: ABI lists Vineet Gupta
2020-03-07 15:20 ` Florian Weimer
2020-03-08 5:45 ` Vineet Gupta
2020-03-09 9:14 ` Florian Weimer
2020-03-06 18:24 ` [PATCH v3 13/17] ARC: Update syscall-names.list for ARC specific syscalls Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 14/17] ARC: Build Infrastructure Vineet Gupta
2020-03-07 0:16 ` Joseph Myers
2020-03-07 0:24 ` Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 15/17] build-many-glibcs.py: Enable ARC builds Vineet Gupta
2020-03-06 18:24 ` [PATCH v3 16/17] NEWS: mention ARC port Vineet Gupta
2020-03-07 0:14 ` Joseph Myers
2020-03-07 0:55 ` Vineet Gupta
2020-03-07 1:08 ` Joseph Myers
2020-03-07 1:26 ` Vineet Gupta
2020-03-07 1:29 ` Joseph Myers
2020-03-06 18:24 ` [PATCH v3 17/17] ARC: changes to enable 64-bit time_t, off_t, ino_t etc Vineet Gupta
2020-03-07 0:19 ` Joseph Myers
2020-03-07 0:37 ` Vineet Gupta
2020-03-07 0:21 ` [PATCH v3 00/17] glibc port to ARC processors Joseph Myers
2020-03-07 0:57 ` Vineet Gupta
2020-03-07 1:10 ` Joseph Myers
2020-03-12 21:23 ` Vineet Gupta
2020-03-12 21:46 ` Joseph Myers
2020-03-23 18:20 ` Vineet Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200306182419.13945-2-vgupta@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-snps-arc@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox