public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2427] testsuite: Unbreak pr110557.cc where long is 32-bit
@ 2023-07-11 8:08 Xi Ruoyao
0 siblings, 0 replies; only message in thread
From: Xi Ruoyao @ 2023-07-11 8:08 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:312839653b8295599c63cae90278a87af528edad
commit r14-2427-g312839653b8295599c63cae90278a87af528edad
Author: Xi Ruoyao <xry111@xry111.site>
Date: Tue Jul 11 15:55:54 2023 +0800
testsuite: Unbreak pr110557.cc where long is 32-bit
On ports with 32-bit long, the test produced excess errors:
gcc/testsuite/g++.dg/vect/pr110557.cc:12:8: warning: width of
'Item::y' exceeds its type
Reported-by: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
gcc/testsuite/ChangeLog:
* g++.dg/vect/pr110557.cc: Use long long instead of long for
64-bit type.
(test): Remove an unnecessary cast.
Diff:
---
gcc/testsuite/g++.dg/vect/pr110557.cc | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/gcc/testsuite/g++.dg/vect/pr110557.cc b/gcc/testsuite/g++.dg/vect/pr110557.cc
index e1fbe1caac4..effb67e2df3 100644
--- a/gcc/testsuite/g++.dg/vect/pr110557.cc
+++ b/gcc/testsuite/g++.dg/vect/pr110557.cc
@@ -1,7 +1,9 @@
// { dg-additional-options "-mavx" { target { avx_runtime } } }
-static inline long
-min (long a, long b)
+typedef long long i64;
+
+static inline i64
+min (i64 a, i64 b)
{
return a < b ? a : b;
}
@@ -9,16 +11,16 @@ min (long a, long b)
struct Item
{
int x : 8;
- long y : 55;
+ i64 y : 55;
bool z : 1;
};
-__attribute__ ((noipa)) long
+__attribute__ ((noipa)) i64
test (Item *a, int cnt)
{
- long size = 0;
+ i64 size = 0;
for (int i = 0; i < cnt; i++)
- size = min ((long)a[i].y, size);
+ size = min (a[i].y, size);
return size;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-07-11 8:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11 8:08 [gcc r14-2427] testsuite: Unbreak pr110557.cc where long is 32-bit Xi Ruoyao
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 read-only IMAP folder(s) and NNTP newsgroup(s).