From patchwork Fri Feb 2 11:44:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 868550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-472519-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pwcxmUMX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zXwC85Tqvz9ryQ for ; Fri, 2 Feb 2018 22:45:07 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QhlXG4qt+48r99zI4Ydab2CfbiJpKl64x2Y6GemuuZBgkhLBX8 aIlDu5LDwBEPPGyNm/vvBEiw8A9a7FvWnYF01xdL6/Vc+ubWAAl/h1vjt3qlAYIK n4Cp4iN12bWPmmULHNnHr/j/KvMFRZ+9LZ0pCXziOdefG64JMpVgjA5LU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=brP/H+W5BMMpmBsiL2kFshLeNO8=; b=pwcxmUMXAxDZJiPAlZDY QDFt+OyuNGzsrErNPLiYsNhYWU9IRAp9VAoRdIAdRmLTHfY8br5obRu8b0uhiTDX G47XfJnWkGyhWojV6YINUVsKdMF80buDRkUPBPNw0ZT+IduRXjmtiDIxpA39pufP 8xd3Iod5oRBeW+mLufNcjg0= Received: (qmail 123535 invoked by alias); 2 Feb 2018 11:45:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 122836 invoked by uid 89); 2 Feb 2018 11:44:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=la, La, ua, link_error X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.221) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Feb 2018 11:44:56 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3koxZnKXKoq0dKoR0vVrCTW+haw2CInfdCa X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (ip5f582b93.dynamic.kabel-deutschland.de [95.88.43.147]) by smtp.strato.de (RZmta 42.18 DYNA|AUTH) with ESMTPSA id x00d95u12Birjl2 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Fri, 2 Feb 2018 12:44:53 +0100 (CET) To: gcc-patches From: Georg-Johann Lay Subject: [patch,testsuite,committed] ad PR52641: Adjust more tests to int16 Message-ID: <2a4c4a13-9361-5c7f-cc36-4cf732d22984@gjlay.de> Date: Fri, 2 Feb 2018 12:44:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Again. This change adjusts more tests to work with int16. For tests that cannot be easily adjusted, added int32plus or size32plus filters. https://gcc.gnu.org/r257327 Johann gcc/testsuite/ PR testsuite/52641 * gcc.c-torture/execute/pr81913.c: Use types that also work for int16. * gcc.c-torture/execute/20180112-1.c: Dito. * gcc.c-torture/execute/pr81503.c: Dito. * gcc.dg/store_merging_12.c: Dito. * gcc.dg/tree-ssa/loop-niter-1.c: Dito. * gcc.dg/tree-ssa/loop-niter-2.c: Dito. * gcc.dg/tree-ssa/pr80898.c: Dito. * gcc.dg/tree-ssa/pr82363.c: Dito. * gcc.dg/utf16-4.c: Also allow "short unsigned int" in dg-warning. * gcc.dg/tree-ssa/pr81346-5.c: Special-case int16. * gcc.dg/tree-ssa/ssa-sink-11.c: Dito. * gcc.dg/tree-ssa/ssa-sink-12.c: Dito. * gcc.dg/torture/pr81814.c: Restrict to int32plus. * gcc.dg/tree-ssa/pr80803.c: Dito. * gcc.dg/tree-ssa/pr80898-2.c: Dito. * gcc.dg/tree-ssa/pr81346-4.c: Dito. * gcc.dg/tree-ssa/vrp114.c: Dito. * gcc.dg/tree-ssa/pr82574.c: Restrict to size32plus. * gcc.dg/tree-ssa/ssa-dom-thread-13.c: Dito. * gcc.dg/tree-ssa/ssa-sink-15.c: Dito. Index: gcc.c-torture/execute/20180112-1.c =================================================================== --- gcc.c-torture/execute/20180112-1.c (revision 257284) +++ gcc.c-torture/execute/20180112-1.c (working copy) @@ -3,7 +3,7 @@ extern void abort (void); -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; u32 bug (u32 * result) __attribute__((noinline)); u32 bug (u32 * result) Index: gcc.c-torture/execute/pr81503.c =================================================================== --- gcc.c-torture/execute/pr81503.c (revision 257284) +++ gcc.c-torture/execute/pr81503.c (working copy) @@ -1,11 +1,20 @@ unsigned short a = 41461; unsigned short b = 3419; +#if __SIZEOF_INT__ >= 4 int c = 0; void foo() { if (a + b * ~(0 != 5)) c = -~(b * ~(0 != 5)) + 2147483647; } +#else +__INT32_TYPE__ c = 0; + +void foo() { + if (a + b * ~((__INT32_TYPE__)(0 != 5))) + c = -~(b * ~((__INT32_TYPE__)(0 != 5))) + 2147483647; +} +#endif int main() { foo(); Index: gcc.c-torture/execute/pr81913.c =================================================================== --- gcc.c-torture/execute/pr81913.c (revision 257284) +++ gcc.c-torture/execute/pr81913.c (working copy) @@ -1,7 +1,7 @@ /* PR tree-optimization/81913 */ -typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT8_TYPE__ u8; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) Index: gcc.dg/store_merging_12.c =================================================================== --- gcc.dg/store_merging_12.c (revision 257284) +++ gcc.dg/store_merging_12.c (working copy) @@ -1,6 +1,10 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wall" } */ +#if __SIZEOF_INT__ == 2 +#define int long +#endif + struct S { unsigned int b1:1, b2:1, b3:1, b4:1, b5:1, b6:27; }; void bar (struct S *); void foo (int x) Index: gcc.dg/torture/pr81814.c =================================================================== --- gcc.dg/torture/pr81814.c (revision 257284) +++ gcc.dg/torture/pr81814.c (working copy) @@ -1,5 +1,5 @@ /* PR middle-end/81814 */ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ int main () Index: gcc.dg/tree-ssa/loop-niter-1.c =================================================================== --- gcc.dg/tree-ssa/loop-niter-1.c (revision 257284) +++ gcc.dg/tree-ssa/loop-niter-1.c (working copy) @@ -2,7 +2,7 @@ /* { dg-options "-O2 -fdump-tree-sccp-details" } */ typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) Index: gcc.dg/tree-ssa/loop-niter-2.c =================================================================== --- gcc.dg/tree-ssa/loop-niter-2.c (revision 257284) +++ gcc.dg/tree-ssa/loop-niter-2.c (working copy) @@ -2,7 +2,7 @@ /* { dg-options "-O2 -fdump-tree-sccp-details" } */ typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) Index: gcc.dg/tree-ssa/pr80803.c =================================================================== --- gcc.dg/tree-ssa/pr80803.c (revision 257284) +++ gcc.dg/tree-ssa/pr80803.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O" } */ struct S0 Index: gcc.dg/tree-ssa/pr80898-2.c =================================================================== --- gcc.dg/tree-ssa/pr80898-2.c (revision 257284) +++ gcc.dg/tree-ssa/pr80898-2.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O2" } */ struct S0 Index: gcc.dg/tree-ssa/pr80898.c =================================================================== --- gcc.dg/tree-ssa/pr80898.c (revision 257284) +++ gcc.dg/tree-ssa/pr80898.c (working copy) @@ -2,9 +2,9 @@ /* { dg-options "-O2" } */ struct S0 { - int f0 : 24; - int f1; - int f74; + __INT32_TYPE__ f0 : 24; + __INT32_TYPE__ f1; + __INT32_TYPE__ f74; } a, *c = &a; struct S0 fn1() { struct S0 b = {4, 3}; Index: gcc.dg/tree-ssa/pr81346-4.c =================================================================== --- gcc.dg/tree-ssa/pr81346-4.c (revision 257284) +++ gcc.dg/tree-ssa/pr81346-4.c (working copy) @@ -1,5 +1,5 @@ /* PR tree-optimization/81346 */ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O2" } */ #include "pr81346-3.c" Index: gcc.dg/tree-ssa/pr81346-5.c =================================================================== --- gcc.dg/tree-ssa/pr81346-5.c (revision 257284) +++ gcc.dg/tree-ssa/pr81346-5.c (working copy) @@ -1,7 +1,8 @@ /* PR tree-optimization/81346 */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ -/* { dg-final { scan-tree-dump-times "\\(signed int\\) x" 10 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\(signed int\\) x" 10 "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump-times "\\(signed short\\) x" 10 "optimized" { target int16 } } } */ /* { dg-final { scan-tree-dump-times " <= 0;" 5 "optimized" } } */ /* { dg-final { scan-tree-dump-times " > 0;" 5 "optimized" } } */ Index: gcc.dg/tree-ssa/pr82363.c =================================================================== --- gcc.dg/tree-ssa/pr82363.c (revision 257284) +++ gcc.dg/tree-ssa/pr82363.c (working copy) @@ -1,6 +1,10 @@ /* { dg-do run } */ /* { dg-options "-O" } */ +#if __SIZEOF_INT__ == 2 +#define int __INT32_TYPE__ +#endif + struct A { int b; @@ -34,6 +38,8 @@ test_l (void) __builtin_abort (); } +#undef int + int main () { while (1) Index: gcc.dg/tree-ssa/pr82574.c =================================================================== --- gcc.dg/tree-ssa/pr82574.c (revision 257284) +++ gcc.dg/tree-ssa/pr82574.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target size32plus } } */ /* { dg-options "-O3" } */ unsigned char a, b, c, d[200][200]; Index: gcc.dg/tree-ssa/ssa-dom-thread-13.c =================================================================== --- gcc.dg/tree-ssa/ssa-dom-thread-13.c (revision 257284) +++ gcc.dg/tree-ssa/ssa-dom-thread-13.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -fdump-tree-dom2-details -w" } */ union tree_node; Index: gcc.dg/tree-ssa/ssa-sink-11.c =================================================================== --- gcc.dg/tree-ssa/ssa-sink-11.c (revision 257284) +++ gcc.dg/tree-ssa/ssa-sink-11.c (working copy) @@ -13,4 +13,5 @@ int foo (int v[], int a) return r; } -/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized"} } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 126B\\\]" "optimized" { target int16 } } } */ Index: gcc.dg/tree-ssa/ssa-sink-12.c =================================================================== --- gcc.dg/tree-ssa/ssa-sink-12.c (revision 257284) +++ gcc.dg/tree-ssa/ssa-sink-12.c (working copy) @@ -14,4 +14,5 @@ int foo (int v1[], int v2[]) return r; } -/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized"} } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 126B\\\]" "optimized" { target int16 } } } */ Index: gcc.dg/tree-ssa/ssa-sink-15.c =================================================================== --- gcc.dg/tree-ssa/ssa-sink-15.c (revision 257284) +++ gcc.dg/tree-ssa/ssa-sink-15.c (working copy) @@ -1,5 +1,5 @@ /* PR79725 */ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ _Complex double f(_Complex double x[]) Index: gcc.dg/tree-ssa/vrp114.c =================================================================== --- gcc.dg/tree-ssa/vrp114.c (revision 257284) +++ gcc.dg/tree-ssa/vrp114.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do link } */ +/* { dg-do link { target int32plus } } */ /* { dg-options "-O2 -fdump-tree-fre1 -fdump-tree-evrp" } */ extern void link_error (); Index: gcc.dg/utf16-4.c =================================================================== --- gcc.dg/utf16-4.c (revision 257284) +++ gcc.dg/utf16-4.c (working copy) @@ -12,7 +12,7 @@ char16_t c2 = u'\U00064321'; /* { dg-war char16_t c3 = 'a'; char16_t c4 = U'a'; char16_t c5 = U'\u2029'; -char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to 'char16_t' {aka 'short unsigned int'} changes value from .410401. to .17185." } */ +char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to 'char16_t' {aka '(short )?unsigned int'} changes value from .410401. to .17185." } */ char16_t c7 = L'a'; char16_t c8 = L'\u2029'; char16_t c9 = L'\U00064321'; /* { dg-warning "conversion" "" { target { 4byte_wchar_t } } } */