From aabf07cd5dc314135adde89830a86be157d7596b Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Tue, 3 Aug 2021 13:53:02 -0600 Subject: [PATCH] Disable a test case in ILP32 [PR101688]. Resolves: PR testsuite/101688 - g++.dg/warn/Wstringop-overflow-4.C fails on 32-bit archs with new jump threader gcc/testsuite: PR testsuite/101688 * g++.dg/warn/Wstringop-overflow-4.C: Disable a test case in ILP32. --- gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C index 121239ac1dbc..c80977d3043a 100644 --- a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C +++ b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C @@ -145,7 +145,12 @@ void test_strcpy_new_int16_t (size_t n, const size_t vals[]) T (S (9), new int16_t[r_imin_imax * 2 + 1]); int r_0_imax = SR (0, INT_MAX); - T (S (1), new int16_t[r_0_imax]); + + if (sizeof (int) < sizeof (size_t)) + /* The code below might emit a warning when int is the same size + as size_t as a result of threading. See PR 101688 comment #2. */ + T (S (1), new int16_t[r_0_imax]); + T (S (2), new int16_t[r_0_imax + 1]); T (S (9), new int16_t[r_0_imax * 2 + 1]); -- 2.47.2