* [PATCH] bug-assign-op0.c: fix test on 32-bit builds
@ 2020-08-11 3:15 Ramsay Jones
2020-08-11 4:45 ` Luc Van Oostenryck
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2020-08-11 3:15 UTC (permalink / raw)
To: Luc Van Oostenryck; +Cc: Sparse Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Luc,
Tonight my 32-bit build/test run on 32-bit Linux failed this test.
The first version of this patch was a simple one-liner to add an
'-m64' argument to the test-linearize 'check-command'. This seems
to be the usual fix for this, but I thought I would try something
different. ;-)
If you prefer the one-liner, then go with that (I tested it on 32-bit
Linux, but not on 64-bit Linux - I can't imagine that it would fail!).
ATB,
Ramsay Jones
validation/linear/bug-assign-op0.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/validation/linear/bug-assign-op0.c b/validation/linear/bug-assign-op0.c
index b351bb51..3a2bef3c 100644
--- a/validation/linear/bug-assign-op0.c
+++ b/validation/linear/bug-assign-op0.c
@@ -10,7 +10,7 @@ unsigned int lsr(unsigned int u)
return u;
}
-int divr(int s, unsigned long u)
+int divr(int s, unsigned long long u)
{
extern int use(int, unsigned);
int t = s;
@@ -19,25 +19,25 @@ int divr(int s, unsigned long u)
return use(s, u);
}
-int sdivul(int s, unsigned long u)
+int sdivul(int s, unsigned long long u)
{
s /= u; // divu
return s;
}
-unsigned int udivsl(unsigned int u, long s)
+unsigned int udivsl(unsigned int u, long long s)
{
u /= s; // divs
return u;
}
-int uldivs(int s, unsigned long u)
+int uldivs(int s, unsigned long long u)
{
u /= s; // divu
return u;
}
-unsigned int sldivu(unsigned int u, long s)
+unsigned int sldivu(unsigned int u, long long s)
{
s /= u; // divs
return s;
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bug-assign-op0.c: fix test on 32-bit builds
2020-08-11 3:15 [PATCH] bug-assign-op0.c: fix test on 32-bit builds Ramsay Jones
@ 2020-08-11 4:45 ` Luc Van Oostenryck
0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2020-08-11 4:45 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Sparse Mailing-list
On Tue, Aug 11, 2020 at 04:15:23AM +0100, Ramsay Jones wrote:
>
Hi Ramsay,
>
> Tonight my 32-bit build/test run on 32-bit Linux failed this test.
Yeah :( When writing I thought "I must make them 64bit ones" but ...
> The first version of this patch was a simple one-liner to add an
> '-m64' argument to the test-linearize 'check-command'. This seems
> to be the usual fix for this, but I thought I would try something
> different. ;-)
>
> If you prefer the one-liner, then go with that (I tested it on 32-bit
> Linux, but not on 64-bit Linux - I can't imagine that it would fail!).
No no, it's fine so when 64-bit vars are needed. Usnig -m64 is only
OK when 'long' is needed and that these long need
Many thanks for reporting and fixing this.
-- Luc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-11 4:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 3:15 [PATCH] bug-assign-op0.c: fix test on 32-bit builds Ramsay Jones
2020-08-11 4:45 ` Luc Van Oostenryck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).