Use word_mode integer with func so that 64-bit integer is used with x32. * gcc.target/i386/pr115749.c (uword): New. (func): Replace unsigned long with uword.
-- H.J.
From bef1df8952cb373dda768c5370fd70479b7ba785 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.to...@gmail.com> Date: Sat, 12 Oct 2024 05:22:52 +0800 Subject: [PATCH] gcc.target/i386/pr115749.c: Use word_mode integer Use word_mode integer with func so that 64-bit integer is used with x32. * gcc.target/i386/pr115749.c (uword): New. (func): Replace unsigned long with uword. Signed-off-by: H.J. Lu <hjl.to...@gmail.com> --- gcc/testsuite/gcc.target/i386/pr115749.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/pr115749.c b/gcc/testsuite/gcc.target/i386/pr115749.c index 82505d603ef..e7946d77861 100644 --- a/gcc/testsuite/gcc.target/i386/pr115749.c +++ b/gcc/testsuite/gcc.target/i386/pr115749.c @@ -4,7 +4,9 @@ /* { dg-final { scan-assembler-times "imul" 2 } } */ /* { dg-final { scan-assembler-not "sal" } } */ -unsigned long func(unsigned long x) +typedef unsigned int uword __attribute__ ((mode (word))); + +uword func(uword x) { return x % 240; } -- 2.47.0