From patchwork Sat Jul 6 13:14:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 1957590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gjlay.de header.i=@gjlay.de header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=Go2+/qhm; dkim=pass header.d=gjlay.de header.i=@gjlay.de header.a=ed25519-sha256 header.s=strato-dkim-0003 header.b=YdN4hHg7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WGW8K50QZz1xr3 for ; Sat, 6 Jul 2024 23:15:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EBED3888C46 for ; Sat, 6 Jul 2024 13:15:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.163]) by sourceware.org (Postfix) with ESMTPS id 926FA3858C98 for ; Sat, 6 Jul 2024 13:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 926FA3858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gjlay.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gjlay.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 926FA3858C98 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=81.169.146.163 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720271691; cv=pass; b=jM8Vz6vOlF52l56CHk9oBs5UwWX00maR+QAfPQ4H8tRCdfnH5kKCpGf4K+fz4GxfkmA+VuvkcPwSSTgATnIWEJ+rwvmfdngqS/p7tDYfMFHPZrGehSHEaI9s05x23A6oPZhua15dYXe8lBI+32bDd8sG1UaQSJc+vyTipDIWGE8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720271691; c=relaxed/simple; bh=v4yqdOgTUoenZ+APyzClJW2B2GvgqillqnJr4GpWPVc=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From: To:Subject; b=B+Uxooltk7Np+Idm3xgXShJtLR7QxFZjjMae7OC3NIxt63Th/yxq5OLbczP1ce+lCm1RHHO/y0Wm82Bx2xJqoZALwda2OH/PUBavob1K31TmQdVTuKeOGhAB2BX63fWrmaD4I7k0bO19+Gp/NMWjJr7SoikIkNhyhAoW9EXK38M= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1720271687; cv=none; d=strato.com; s=strato-dkim-0002; b=tW6cNrmM11XEB2x8kJomja1/z1yPhmA57HhuhUVqzCxhSr/YsGja7UCSlsuG8oaweh DI78GyB/AsiFDG8O8vNRjb1w8QC23hIWnGx5NbIRExYRzFc4I5q219vcZ6OUR1fd9VCV n5wW47hBvd34tibLiTRzGq6RthFuA9LA8ivnvVeyk9GNyA5aIqhNMoABqAHT6+frud0B ju3/RLbfQeZguK1AyrszdbVBGPM0uOXHNh0P8yS+nuWWYIea2DDi1/pwao8yJeUvuPOv KUySr3LNBSpx6c5qGDTK36H6NC9cx3PTQGU56WUf843Nn1vvlb7LPJ0PZXNb9LteaMt5 6oYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1720271687; s=strato-dkim-0002; d=strato.com; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=51WBn/yXsM+KukY51VoDR51ARd17K+WwUNAkIZjQ7OI=; b=YawdDZayNxHMGqgK3U0e13xuF51hi0IYBrs3umbUsECiDn4uzPRtEhyn1B2wxgKHKV jkN8FugNbVpwf4nRGmlwGhZBgFedELUl/9k7lL2ovC3sCLWoc53fCNSM3ZlMwRn7iEJ3 rDI0RqjFzE15rwQfEP/hJ1qvMqiVtPQ8ct3/zZFo8BHckLzH5+HtKScjLcIhhWHby41N x/IsrWWIBVVds0Cr2VViVHR71i7xZlq6C0abb3A1zV+44ApCN6FritnPi47+qKHWdLBt Xus8O7ebqUifR2zzkewt2QQ1sRCck82s2bf8cU4tc8WPoaCMOcPACB7tCk2vJHBan+K+ Q5cQ== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1720271687; s=strato-dkim-0002; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=51WBn/yXsM+KukY51VoDR51ARd17K+WwUNAkIZjQ7OI=; b=Go2+/qhmDPWh3qvrxwWqVfJtnRzv75Z4TeiZmU1qQFOz7tFYhOo4I8N1kaPC/I4e+U wnXT3/NMJW3OEXRCqjdzRm2tWR8o4lhDMZG1EymnP62fERCSKMBQOV3SIyPto9mf5c5z bi8bar9R/et/AUFXwrT8m4UjJkAbnsVmymkrSUlDILG0y2xCBkvub6zb4zuUxcYTp3Ig yN7/rfF6/CrekraWq8kj76YDYAyS9A0TdsbWDF++rsUgJ2VauiMuX322e7+w0VoFKP8d luBNQ5yMV0dXkd3qUEZzNFN89kEwSQgLV5i/S/3gJ1s+7ysbu94RiJLfM2RotkWum+Nr nurQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1720271687; s=strato-dkim-0003; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=51WBn/yXsM+KukY51VoDR51ARd17K+WwUNAkIZjQ7OI=; b=YdN4hHg7FPb9y954PgiBbV0PkEN9K3jlj5Q14qFuev4xYVbFNc/fI3/u2viSQCVDQS M0VpZncDIYk+blgzocCA== X-RZG-AUTH: ":LXoWVUeid/7A29J/hMvvT3koxZnKT7Qq0xotTetVnKkbjtK7q2y9LkX3jYYP" Received: from [192.168.2.102] by smtp.strato.de (RZmta 50.5.0 DYNA|AUTH) with ESMTPSA id x05778066DEkeGj (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sat, 6 Jul 2024 15:14:46 +0200 (CEST) Message-ID: Date: Sat, 6 Jul 2024 15:14:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Georg-Johann Lay Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Subject: [patch,testsuite,applied] PR52641: Fix more sloppy tests. X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Such tests exists because pre-processed sources are used as test cases, like they are provided in PRs. This means they have, say, "unsigned long" instead of size_t, but "unsigned long" is not a correct size_t on some targets. Some of the tests can be transformed back so that they use __SIZE_TYPE__ but for other tests it's not possible to reverse engineer the spirit of the test case. Similar problems are when int32_t is replaced by "int", or intptr_t is replaced by "long", etc. For test cases that use integer constants larger that 16 bits, it is unclear whether the test case still reproduces the same artifact when the constant is replaced by a smaller one; or if it still works when int is replaced by int32_t etc. Johann --- testsuite/52641 - Fix more sloppy tests. PR testsuite/52641 gcc/testsuite/ * gcc.dg/analyzer/torture/boxed-ptr-1.c: Requires size24plus. * gcc.dg/analyzer/torture/pr102692.c: Use intptr_t instead of long. * gcc.dg/ipa/pr102714.c: Use uintptr_t instead of unsigned long. * gcc.dg/torture/pr115387-1.c: Same. * gcc.dg/torture/pr113895-1.c : Same. * gcc.dg/ipa/pr108007.c: Require int32plus. * gcc.dg/ipa/pr109318.c: Same. * gcc.dg/ipa/pr96040.c: Use size_t instead of unsigned long. * gcc.dg/torture/pr113126.c: Use vectors of same dimension. * gcc.dg/tree-ssa/builtin-sprintf-9.c: Requires double64. * gcc.dg/spellcheck-inttypes.c [avr]: Avoid include of inttypes.h. * gcc.dg/analyzer/torture/pr104159.c [avr]: Skip. * gcc.dg/torture/pr84682-2.c [avr]: Skip. * gcc.dg/wtr-conversion-1.c [avr]: Remove avr selector since long double is a 64-bit type by now. diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/boxed-ptr-1.c b/gcc/testsuite/gcc.dg/analyzer/torture/boxed-ptr-1.c index 5bc7151a798..e25d0c31ea5 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/boxed-ptr-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/boxed-ptr-1.c @@ -1,4 +1,5 @@ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ +/* { dg-require-effective-target size24plus } */ #include #include "../analyzer-decls.h" diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c index a6c6bc47896..a1b3bfed047 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c @@ -15,7 +15,7 @@ make_lisp_ptr (void *ptr, int type) static _Bool TAGGEDP (struct lisp *a, unsigned tag) { - return ! (((unsigned) (long) a - tag) & 7); + return ! (((unsigned) (__INTPTR_TYPE__) a - tag) & 7); } static _Bool diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr104159.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr104159.c index ad85d084b39..0c490bd39f2 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/pr104159.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr104159.c @@ -1,4 +1,5 @@ /* { dg-additional-options "-Wno-analyzer-use-of-uninitialized-value -Wno-psabi" } */ +/* { dg-skip-if "incompatible types" { "avr-*-*" } } */ typedef int __attribute__((__vector_size__(4))) T; typedef unsigned __attribute__((__vector_size__(4))) U; diff --git a/gcc/testsuite/gcc.dg/ipa/pr102714.c b/gcc/testsuite/gcc.dg/ipa/pr102714.c index 65dd86f5c15..8ab77a61d75 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr102714.c +++ b/gcc/testsuite/gcc.dg/ipa/pr102714.c @@ -54,16 +54,16 @@ static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attr static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) struct xa_node *entry_to_node(void *ptr) { - return (void *)((unsigned long)ptr & ~2UL); + return (void *)((__UINTPTR_TYPE__)ptr & ~(__UINTPTR_TYPE__)2); } static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) bool radix_tree_is_internal_node(void *ptr) { - return ((unsigned long)ptr & 3UL) == + return ((__UINTPTR_TYPE__)ptr & 3UL) == 2UL; } -static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void *xa_mk_internal(unsigned long v) +static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void *xa_mk_internal(__UINTPTR_TYPE__ v) { return (void *)((v << 2) | 2); } diff --git a/gcc/testsuite/gcc.dg/ipa/pr108007.c b/gcc/testsuite/gcc.dg/ipa/pr108007.c index 77fc95975cf..5bd1c350963 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr108007.c +++ b/gcc/testsuite/gcc.dg/ipa/pr108007.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-Os -fno-dce -fno-tree-dce -g" } */ +/* { dg-require-effective-target int32plus } */ /* This tests that when IPA-SRA removes a LHS of a call statement which, in the original source, is fed into a useless operation which however can trap when diff --git a/gcc/testsuite/gcc.dg/ipa/pr109318.c b/gcc/testsuite/gcc.dg/ipa/pr109318.c index c5d9e3d12c7..68e9f62eb37 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr109318.c +++ b/gcc/testsuite/gcc.dg/ipa/pr109318.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fno-early-inlining" } */ +/* { dg-require-effective-target int32plus } */ #pragma pack(1) struct S { diff --git a/gcc/testsuite/gcc.dg/ipa/pr96040.c b/gcc/testsuite/gcc.dg/ipa/pr96040.c index af7e9c4ed94..9c9b76269a6 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr96040.c +++ b/gcc/testsuite/gcc.dg/ipa/pr96040.c @@ -3,8 +3,8 @@ int puts(const char *); -int snprintf(char *, unsigned long, const char *, ...); -unsigned long strspn(const char *, const char *); +int snprintf(char *, __SIZE_TYPE__, const char *, ...); +__SIZE_TYPE__ strspn(const char *, const char *); struct TValue { union { diff --git a/gcc/testsuite/gcc.dg/spellcheck-inttypes.c b/gcc/testsuite/gcc.dg/spellcheck-inttypes.c index 24e075433fc..084a5cd4314 100644 --- a/gcc/testsuite/gcc.dg/spellcheck-inttypes.c +++ b/gcc/testsuite/gcc.dg/spellcheck-inttypes.c @@ -3,6 +3,13 @@ #ifdef _AIX #define _STD_TYPES_T #endif + +/* Prevent AVR-LibC from implicitly including inttypes.h. */ +#ifdef __AVR__ +#define __INTTYPES_H_ +#include +#endif + #include #include /* Missing . */ diff --git a/gcc/testsuite/gcc.dg/torture/pr113126.c b/gcc/testsuite/gcc.dg/torture/pr113126.c index ffe29799d13..75d05e47972 100644 --- a/gcc/testsuite/gcc.dg/torture/pr113126.c +++ b/gcc/testsuite/gcc.dg/torture/pr113126.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-additional-options "-Wno-psabi" } */ -typedef float __attribute__((__vector_size__ (8))) F; -typedef double __attribute__((__vector_size__ (16))) G; +typedef float __attribute__((__vector_size__ (2 * sizeof(float)))) F; +typedef double __attribute__((__vector_size__ (2 * sizeof(double)))) G; F f; G g; diff --git a/gcc/testsuite/gcc.dg/torture/pr113895-1.c b/gcc/testsuite/gcc.dg/torture/pr113895-1.c index e96cb2f33e1..7ad682338d7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr113895-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr113895-1.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target int32plus } */ int main_i; void transparent_crc(int); diff --git a/gcc/testsuite/gcc.dg/torture/pr115387-1.c b/gcc/testsuite/gcc.dg/torture/pr115387-1.c index d94e935fade..7ff3ced07bf 100644 --- a/gcc/testsuite/gcc.dg/torture/pr115387-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr115387-1.c @@ -3,7 +3,7 @@ #define PRINTF_CHK 0x34 -typedef unsigned long uintptr_t; +typedef __UINTPTR_TYPE__ uintptr_t; struct __printf_buffer { char *write_ptr; diff --git a/gcc/testsuite/gcc.dg/torture/pr84682-2.c b/gcc/testsuite/gcc.dg/torture/pr84682-2.c index 5abda5fd136..f8d15c5e6a3 100644 --- a/gcc/testsuite/gcc.dg/torture/pr84682-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr84682-2.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "impossible register constraint" { "avr-*-*" } } */ int a; void b() { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c index b4a05bbd38a..3be18c7b5dc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-9.c @@ -1,5 +1,6 @@ /* PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN) { dg-do compile } + { dg-require-effective-target double64 } { dg-skip-if "not IEEE float layout" { "pdp11-*-*" } } { dg-options "-O2 -Wall -fdump-tree-optimized" } */ diff --git a/gcc/testsuite/gcc.dg/wtr-conversion-1.c b/gcc/testsuite/gcc.dg/wtr-conversion-1.c index 9d2cd999939..38e8d7d2085 100644 --- a/gcc/testsuite/gcc.dg/wtr-conversion-1.c +++ b/gcc/testsuite/gcc.dg/wtr-conversion-1.c @@ -28,8 +28,8 @@ testfunc1 () foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */ - foo_ld (f); /* { dg-warning "as 'float' rather than 'double'" "small double" { target { "avr-*-*" } } } */ - foo_ld (ld);/* { dg-warning "as 'float' rather than 'double'" "small long double" { target { "avr-*-*" } } } */ + foo_ld (f); + foo_ld (ld); foo_ld (cd);/* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */