re PR testsuite/52641 (Test cases fail for 16-bit int targets)
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 2 Feb 2018 11:36:54 +0000 (11:36 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Fri, 2 Feb 2018 11:36:54 +0000 (11:36 +0000)
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.

From-SVN: r257327

21 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20180112-1.c
gcc/testsuite/gcc.c-torture/execute/pr81503.c
gcc/testsuite/gcc.c-torture/execute/pr81913.c
gcc/testsuite/gcc.dg/store_merging_12.c
gcc/testsuite/gcc.dg/torture/pr81814.c
gcc/testsuite/gcc.dg/tree-ssa/loop-niter-1.c
gcc/testsuite/gcc.dg/tree-ssa/loop-niter-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr80803.c
gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr80898.c
gcc/testsuite/gcc.dg/tree-ssa/pr81346-4.c
gcc/testsuite/gcc.dg/tree-ssa/pr81346-5.c
gcc/testsuite/gcc.dg/tree-ssa/pr82363.c
gcc/testsuite/gcc.dg/tree-ssa/pr82574.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-11.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-12.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-15.c
gcc/testsuite/gcc.dg/tree-ssa/vrp114.c
gcc/testsuite/gcc.dg/utf16-4.c

index 15c3e06ff630d4da012eb3e83efa1811496e675b..6bc8ede0314622747d106d529f12ceab763f232a 100644 (file)
@@ -1,3 +1,27 @@
+2018-02-02  Georg-Johann Lay  <avr@gjlay.de>
+
+       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.
+
 2018-02-02  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
 
        PR target/84066
index 6752661ecb6cd602a5531c8d1bf746f2c03bfcc9..d01ac72db88b7ea7c8340738e285e9d7148cde40 100644 (file)
@@ -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 5fc6cb0e83c9215a839348956d1c0168e73509e1..aaa77077fcff8c1dcc7bb79ffa24e6e67edfb5b4 100644 (file)
@@ -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 11eec4e1eafac5142df71be6cffb0d4e1b0218e9..c8338f404abe490a601e704b9a95952566c288cf 100644 (file)
@@ -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 67f23449e9310d60793c6e7e402c82fa959001ef..2a74f3d12b5416e9a91fcf0b19d41d17c369e152 100644 (file)
@@ -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 aaf7c7f304173cf464d75436f76a57902db7d4bc..16868c922fc36820845acaae5a09831383fcbd8b 100644 (file)
@@ -1,5 +1,5 @@
 /* PR middle-end/81814 */
-/* { dg-do run } */
+/* { dg-do run { target int32plus } } */
 
 int
 main ()
index 16c76fe81bc027d3bfce5106ea45db82735ed588..ccfbf1a815ea5fa56e5ad6d8ed59fe3c313025eb 100644 (file)
@@ -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 2377e6caa7286442eddc21cc836e13d42603dd9e..764563662bb030069659404fe6bf7ebe136eb72a 100644 (file)
@@ -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 66834fb31fb4d70fe5692737a02a9b1b6e50739e..29a40c24cee7d6712b7b8dd3bba479851419ae4a 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target int32plus } } */
 /* { dg-options "-O" } */
 
 struct S0
index cb4799c5ced211b6b5089d0f29526fa4e9558ce6..6b245e5e8f74598a5ee133db1783b02b53b02d30 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target int32plus } } */
 /* { dg-options "-O2" } */
 
 struct S0
index ed88f2cbd1a708a67ab635b90f7de4537fa530ff..ca51590d0105a74c5e032dfa126a4033f5d52e84 100644 (file)
@@ -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 f93ad468c3f1774cda5d1fd684f766ccb52ad17d..8c56f26ce34ef4eb5722b55df794be2fb91430e7 100644 (file)
@@ -1,5 +1,5 @@
 /* PR tree-optimization/81346 */
-/* { dg-do run } */
+/* { dg-do run { target int32plus } } */
 /* { dg-options "-O2" } */
 
 #include "pr81346-3.c"
index 14562a11152241cecaadb9bb98cdbff572f4964f..4b822754e4ebc3450fa25f4ad198bd98a0272eae 100644 (file)
@@ -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 6652468976b21027f768533719a4979f45e5253c..baeb9c3a2d12dd08e7c1ac821d6a1550e01bfe7e 100644 (file)
@@ -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 8fc459631ef005aa3bc9fa8f46b8e929e2dacaa2..eb7427b5dfa58130c6af5b5a6136ac7e0f0492e8 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target size32plus } } */
 /* { dg-options "-O3" } */
 
 unsigned char a, b, c, d[200][200];
index 209c40d4c95b3eb549d8639d4d891ac0c5169436..fd99bfbf78900c14b1746be220d5de492aff827a 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do compile } */ 
+/* { dg-do compile { target size32plus } } */ 
 /* { dg-options "-O2 -fdump-tree-dom2-details -w" } */
 
 union tree_node;
index 0f0b51e9b152dd5865746f9f59be0b7a8b0c47c3..8fee2bf646948e3630a9bfff134109559217202a 100644 (file)
@@ -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 f6658a1c246275ef127a20863d5dabe7d91a3c43..b63a6c2365d23ba2d69f9c9fad0ab8bce4433f2b 100644 (file)
@@ -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 66ddc4e664237356441efa7cac1844981a1a4e22..da6921ed6a36f397bef6734d8ab139abd8d9e2fb 100644 (file)
@@ -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 f465005b6715be8492c62ed286c3768a7b84489a..5c2c1a0b500b3290234e975fb826321cf69f0659 100644 (file)
@@ -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 4b203877dde73eb12191a875bd15b21250bab4f4..60e00f60ee4d3f90e907233629351d46f0fff142 100644 (file)
@@ -12,7 +12,7 @@ char16_t      c2 = u'\U00064321';     /* { dg-warning "constant too long" } */
 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 } } } */