This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Adjust c-c++-common/opaque-vector.c testcase (PR c++/80459)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>, Mike Stump <mikestump at comcast dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Apr 2017 16:00:57 +0200
- Subject: [PATCH] Adjust c-c++-common/opaque-vector.c testcase (PR c++/80459)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E193361E78
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E193361E78
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
The testcase attempts to use long double __attribute__((vector_size (16)))
vector and in addition to that uses __typeof((v<v)[0]).
The preconditions of that are not just that long double has size which is
power of 2 (e.g. satisfied on x86_64 for sizeof, but not really because
it is still actually just 80-bit), but also that the size must not be larger
than 16 (otherwise not even a single element would fit) and because v<v has
type of an integral vector, there also needs to be an integral type of that
size, which is not available e.g. on ILP32 targets when long double is
128-bit but there is no __int128_t.
Tested on x86_64-linux and i686-linux, ok for trunk?
2017-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/80459
* c-c++-common/opaque-vector.c (SIZEOF_MAXINT): Define.
(f): Don't test long double vectors if __SIZEOF_LONG_DOUBLE__
is not power of 2, or is more than 16 or more than SIZEOF_MAXINT.
--- gcc/testsuite/c-c++-common/opaque-vector.c.jj 2013-10-21 09:00:50.000000000 +0200
+++ gcc/testsuite/c-c++-common/opaque-vector.c 2017-04-19 10:24:19.154548627 +0200
@@ -5,6 +5,11 @@
#define T_TEST(TYPE)
#endif
#define T(TYPE) B_TEST(TYPE) T_TEST(TYPE)
+#ifdef __SIZEOF_INT128__
+#define SIZEOF_MAXINT __SIZEOF_INT128__
+#else
+#define SIZEOF_MAXINT __SIZEOF_LONG_LONG__
+#endif
void f ()
{
@@ -15,8 +20,13 @@ void f ()
T_TEST(float)
T_TEST(double)
- /* Avoid trouble with non-power-of-two sizes. */
-#if !defined(__i386__) && !defined(__x86_64__) && !defined(__m68k__) && !defined(__ia64__) && !defined(__hppa__)
+ /* Avoid trouble with non-power-of-two sizes.
+ Also avoid trouble with long double larger than integral types. */
+#if !defined(__i386__) && !defined(__x86_64__) && !defined(__m68k__) \
+ && !defined(__ia64__) && !defined(__hppa__) \
+ && (__SIZEOF_LONG_DOUBLE__ & (__SIZEOF_LONG_DOUBLE__ - 1)) == 0 \
+ && __SIZEOF_LONG_DOUBLE__ <= 16 \
+ && __SIZEOF_LONG_DOUBLE__ <= SIZEOF_MAXINT
T_TEST(long double)
#endif
}
Jakub