]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite/52641: Fix more of implicit int=32 assumption fallout.
authorGeorg-Johann Lay <avr@gjlay.de>
Mon, 22 May 2023 18:14:51 +0000 (20:14 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Mon, 22 May 2023 18:20:04 +0000 (20:20 +0200)
gcc/testsuite/
PR testsuite/52641
* gcc.c-torture/compile/pr108892.c: Require int32.
* gcc.c-torture/compile/pr98199.c: Require int32plus.
* gcc.dg/analyzer/call-summaries-pr107072.c: Same.
* gcc.dg/analyzer/null-deref-pr105755.c: Same.
* gcc.dg/tree-ssa/pr102232.c: Same.
* gcc.dg/tree-ssa/pr105860.c: Same.
* gcc.dg/tree-ssa/pr96730.c: Same.
* gcc.dg/tree-ssa/pr96779-disabled.c: Same.
* gcc.dg/tree-ssa/pr96779.c: Same.
* gcc.dg/tree-ssa/pr98513.c: Same.
* gcc.dg/tree-ssa/ssa-sink-18.c
* gcc.dg/analyzer/coreutils-cksum-pr108664.c: Require int32plus,
size24plus.
* gcc.dg/analyzer/doom-s_sound-pr108867.c: Require size32plus.
* gcc.dg/analyzer/malloc-CWE-590-examples.c: Same.
* gcc.dg/debug/btf/btf-bitfields-4.c: Same.
* gcc.dg/tree-ssa/pr93435.c: Same.
* gcc.dg/analyzer/null-deref-pr102671-1.c: Require ptr_eq_long:
* gcc.dg/analyzer/null-deref-pr102671-2.c: Same.
* gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:
Same.
* gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c:
Same.
* gcc.dg/tree-ssa/pr103345.c: Use uint32_t.
* gcc.dg/tree-ssa/ssa-ccp-41.c [sizeof(int)==2]: Same.
* gcc.dg/tree-ssa/pr109031-1.c: Use uint16_t, uint32_t.
* gcc.dg/tree-ssa/pr109031-2.c: Same.
* gcc.dg/Warray-bounds-49.c (dg-warning): Discriminate int != short.
* gcc.dg/Warray-bounds-52.c (dg-warning): Discriminate avr.
* gcc.dg/Warray-bounds-33.c: Skip target avr.
* gcc.dg/analyzer/fd-access-mode-target-headers.c: Same.
* gcc.dg/analyzer/flex-with-call-summaries.c: Same.
* gcc.dg/analyzer/isatty-1.c: Same.
* gcc.dg/analyzer/pipe-glibc.c: Same.

31 files changed:
gcc/testsuite/gcc.c-torture/compile/pr108892.c
gcc/testsuite/gcc.c-torture/compile/pr98199.c
gcc/testsuite/gcc.dg/Warray-bounds-33.c
gcc/testsuite/gcc.dg/Warray-bounds-49.c
gcc/testsuite/gcc.dg/Warray-bounds-52.c
gcc/testsuite/gcc.dg/analyzer/call-summaries-pr107072.c
gcc/testsuite/gcc.dg/analyzer/coreutils-cksum-pr108664.c
gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
gcc/testsuite/gcc.dg/analyzer/flex-with-call-summaries.c
gcc/testsuite/gcc.dg/analyzer/isatty-1.c
gcc/testsuite/gcc.dg/analyzer/malloc-CWE-590-examples.c
gcc/testsuite/gcc.dg/analyzer/null-deref-pr102671-1.c
gcc/testsuite/gcc.dg/analyzer/null-deref-pr102671-2.c
gcc/testsuite/gcc.dg/analyzer/null-deref-pr105755.c
gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c
gcc/testsuite/gcc.dg/analyzer/pipe-glibc.c
gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-4.c
gcc/testsuite/gcc.dg/tree-ssa/pr102232.c
gcc/testsuite/gcc.dg/tree-ssa/pr103345.c
gcc/testsuite/gcc.dg/tree-ssa/pr105860.c
gcc/testsuite/gcc.dg/tree-ssa/pr109031-1.c
gcc/testsuite/gcc.dg/tree-ssa/pr109031-2.c
gcc/testsuite/gcc.dg/tree-ssa/pr93435.c
gcc/testsuite/gcc.dg/tree-ssa/pr96730.c
gcc/testsuite/gcc.dg/tree-ssa/pr96779-disabled.c
gcc/testsuite/gcc.dg/tree-ssa/pr96779.c
gcc/testsuite/gcc.dg/tree-ssa/pr98513.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-41.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c

index d7fecd54ecfe1bf9c8ae2647659fbc27481c0792..fb0a258cdbad2dd2e81b571607bedd5993423e9b 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32 } */
+
 typedef char __attribute__((__vector_size__ (64))) U;
 typedef int __attribute__((__vector_size__ (64))) V;
 
index b5c8d204f0e016743610acba370e1fc2bdafddd5..6605d38788c389b90b1e0fc192f75923f503e08d 100644 (file)
@@ -1,4 +1,5 @@
 /* PR tree-optimization/98199 */
+/* { dg-require-effective-target int32plus } */
 
 struct A { long a; short d; int c, f, e, g; };
 struct B { int a, i; short j; struct A k; signed : 20; int e, g; } __attribute__((packed));
index 28f14b4722cb6a5dcf5e80c61860ea38f2653f5d..13efabe33b6ebcb0f51468b081aa7f7c52dd9068 100644 (file)
@@ -2,6 +2,7 @@
    an object of incomplete type
    { dg-do compile }
    { dg-options "-O2 -Wall" }  */
+/* { dg-skip-if "acessing data memory with program memory address" { "avr-*-*" } } */
 
 struct S
 {
index f271dd526b841e739919c873bcf039e7cd1241a2..9335f1507e8e33fb37a8ac75d0b5ac841807cb48 100644 (file)
@@ -17,7 +17,8 @@ void test_a0 (void)
   // The first three elements fit in the tail padding.
   a0.a2[0] = 0; a0.a2[1] = 1; a0.a2[2] = 2;
 
-  a0.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+  a0.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -27,7 +28,8 @@ void test_a1 (void)
 {
   a1.a2[0] = 0; a1.a2[1] = 1; a1.a2[2] = 2;
 
-  a1.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+  a1.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -37,7 +39,8 @@ void test_a2 (void)
 {
   a2.a2[0] = 0; a2.a2[1] = 1; a2.a2[2] = 2;
 
-  a2.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+  a2.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -47,7 +50,8 @@ void test_a3 (void)
 {
   a3.a2[0] = 0; a3.a2[1] = 1; a3.a2[2] = 2;
 
-  a3.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" }
+  a3.a2[3] = 3;     // { dg-warning "array subscript 3 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 3 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -57,7 +61,8 @@ void test_a4 (void)
 {
   a4.a2[0] = 0; a4.a2[1] = 1; a4.a2[2] = 2; a4.a2[3] = 3;
 
-  a4.a2[4] = 4;     // { dg-warning "array subscript 4 is above array bounds of 'short int\\\[]'" }
+  a4.a2[4] = 4;     // { dg-warning "array subscript 4 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 4 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -67,7 +72,8 @@ void test_a5 (void)
 {
   a5.a2[0] = 0; a5.a2[1] = 1; a5.a2[2] = 2; a5.a2[3] = 3; a5.a2[4] = 4;
 
-  a5.a2[5] = 5;     // { dg-warning "array subscript 5 is above array bounds of 'short int\\\[]'" }
+  a5.a2[5] = 5;     // { dg-warning "array subscript 5 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 5 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -78,7 +84,8 @@ void test_a6 (void)
   a6.a2[0] = 0; a6.a2[1] = 1; a6.a2[2] = 2; a6.a2[3] = 3; a6.a2[4] = 4;
   a6.a2[5] = 5;
 
-  a6.a2[6] = 6;     // { dg-warning "array subscript 6 is above array bounds of 'short int\\\[]'" }
+  a6.a2[6] = 6;     // { dg-warning "array subscript 6 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 6 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -89,7 +96,8 @@ void test_a7 (void)
   a7.a2[0] = 0; a7.a2[1] = 1; a7.a2[2] = 2; a7.a2[3] = 3; a7.a2[4] = 4;
   a7.a2[5] = 5; a7.a2[5] = 5; a7.a2[6] = 6;
 
-  a7.a2[7] = 7;     // { dg-warning "array subscript 7 is above array bounds of 'short int\\\[]'" }
+  a7.a2[7] = 7;     // { dg-warning "array subscript 7 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 7 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -100,7 +108,8 @@ void test_a8 (void)
   a8.a2[0] = 0; a8.a2[1] = 1; a8.a2[2] = 2; a8.a2[3] = 3; a8.a2[4] = 4;
   a8.a2[5] = 5; a8.a2[5] = 5; a8.a2[6] = 6; a8.a2[7] = 7;
 
-  a8.a2[8] = 8;     // { dg-warning "array subscript 8 is above array bounds of 'short int\\\[]'" }
+  a8.a2[8] = 8;     // { dg-warning "array subscript 8 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 8 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
 
 
@@ -111,5 +120,6 @@ void test_a9 (void)
   a8.a2[0] = 8; a8.a2[1] = 7; a8.a2[2] = 6; a8.a2[3] = 5; a8.a2[4] = 4;
   a8.a2[5] = 3; a8.a2[5] = 2; a8.a2[6] = 1; a8.a2[7] = 0;
 
-  a8.a2[9] = 8;     // { dg-warning "array subscript 9 is above array bounds of 'short int\\\[]'" }
+  a8.a2[9] = 8;     // { dg-warning "array subscript 9 is above array bounds of 'short int\\\[]'" "" { target { ! short_eq_int } } }
+  // { dg-warning "array subscript 9 is above array bounds of 'int\\\[]'" "" { target { short_eq_int } } .-1 }
 }
index 69dc15ace2dab1204e2d543eadcfc7a8b77f8b5a..d3aab3cbe944ce6e51eb53ca4faf68cf9471d153 100644 (file)
@@ -59,9 +59,9 @@ void ptr_idx_cst (void)
   T (-1, (int[]){ 1 });         // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" }
   T ( 0, (int[]){ 1 });
   T (+1, (int[]){ 1 });         // { dg-warning "array subscript 1 is outside array bounds of 'int\\\[1]'" }
-  T (INT_MIN, (int[]){ 1 });    // { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail ilp32 } }
-  T (INT_MAX, (int[]){ 1 });    // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! ilp32 } } }
-                                // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32" { target ilp32 } .-1 }
+  T (INT_MIN, (int[]){ 1 });    // { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail { ilp32 || avr-*-* } } }
+  T (INT_MAX, (int[]){ 1 });    // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! { ilp32 || avr-*-* } } } }
+                                // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32-or-avr" { target { ilp32 || avr-*-* } } .-1 }
   T (SIZE_MAX, (int[]){ 1 });   // { dg-warning "array subscript -?\[0-9\]+ is outside array bounds of 'int\\\[1]'" }
 }
 
index 1e689b3860c5bd18171af81ebe42ab5a6025a6e2..6e583d0228ffbb7ef58eb723fad2fa9ec5f9d080 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 /* { dg-additional-options "-fanalyzer-call-summaries --param analyzer-min-snodes-for-call-summary=0" } */
 
 /* There need to be at least two calls to a function for the
index 27eef8369e2f83fa9e07b14a39ec4b61b434e116..62698f3d148ea01fb20922052f75417b02b0df15 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target size24plus } */
+
 /* Reduced from coreutils's cksum.c: cksum_slice8 */
 
 typedef long unsigned int size_t;
index ebbfed2982af2a9a52a9c7926381c751dabacc47..ae58f03d3b32aa2da457e613166920c4c4f86a1d 100644 (file)
@@ -1,6 +1,7 @@
 /* Reduced from Doom's linuxdoom-1.10/s_sound.c, which is GPLv2 or later.  */
 
 /* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex" } */
+/* { dg-require-effective-target size32plus } */
 
 typedef struct _IO_FILE FILE;
 extern FILE* stderr;
index cf273b217d17c96775054f093a0abc57c5287122..b57b9fa2279c289ed9ca9613f4430c5a50bbfea7 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-skip-if "" { powerpc*-*-aix* || newlib } } */
+/* { dg-skip-if "" { avr-*-* } } */
 
 #include <sys/stat.h>
 #include <fcntl.h>
index 79f2f8e1879ec2d4bbb5f786650951dc72f6b5a1..45edacf0e53d4104c78370aae49aa4605e0edbe0 100644 (file)
@@ -2,6 +2,7 @@
    script.  */
 
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { "avr-*-*" } } */
 /* { dg-additional-options "-fanalyzer-call-summaries" } */
 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
 
index 389d2cdf3f180c5749bcc1ca02e189642b8c3219..3bb12c0db25b708e0763d584d6b20717371a955a 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "" { "avr-*-*" } } */
 
 #include <errno.h>
 #include "analyzer-decls.h"
index 036f8889a921650fcdf0b88f356c3273e645172f..9434f2df75f06bca38310bab248be203ce2c6831 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-additional-options "-Wno-free-nonheap-object" } */
+/* { dg-require-effective-target size32plus } */
 
 /* Examples adapted from https://cwe.mitre.org/data/definitions/590.html
    which states "Copyright © 2006–2022, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation."
index 12a0a48d6580f5f5a76cfbc755e8a7402256c717..3fe061bdbd8819047b53bc207ccf6d3738ed4d2c 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target ptr_eq_long } */
 /* { dg-additional-options "-O2 -Wno-shift-count-overflow" } */
 
 struct lisp;
index 5108182a6c300b2e5213898673b14b8bd59f798c..298e4839b9805e0972a30b804018694607cfc2c4 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target ptr_eq_long } */
 /* { dg-additional-options "-O2 -Wno-shift-count-overflow" } */
 
 struct lisp;
index f6bf3830908dc06b7c49402868c693f48170d04d..2b0ba292e00c3a20197c42c45607dbe5de654b37 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 /* { dg-additional-options "-Wno-analyzer-too-complex -O2" } */
 
 typedef long int ptrdiff_t;
index 2a9c715c32c40a0be4802b737788dd083552484a..cb46827ab65c5f0227c1a0b286f49e182534050d 100644 (file)
@@ -1,5 +1,6 @@
 /* Reduced from haproxy's src/ssl_sample.c  */
 
+/* { dg-require-effective-target ptr_eq_long } */
 /* { dg-additional-options "-O2" } */
 
 union sample_value {
index d83af19788c489c8fa527b40630f07c5711b2c7d..fbacb6ca2d32524379e171e66b866c959523912b 100644 (file)
@@ -1,5 +1,7 @@
 /* Reduced from haproxy's src/ssl_sample.c  */
 
+/* { dg-require-effective-target ptr_eq_long } */
+
 union sample_value {
   long long int sint;
   /* [...snip...]  */
index 5a794c8c690083d62d020daacbcaa152a175cc23..60558a870b9d7b93aaa637d6509b7756dfe0e679 100644 (file)
@@ -1,5 +1,7 @@
 /* Example of pipe usage from glibc manual.  */
 
+/* { dg-skip-if "" { "avr-*-*" } } */
+
 #include <sys/types.h>
 #include <unistd.h>
 #include <stdio.h>
index af91845726f172eb821c3cc7740904d6572f628c..c00c8b3d87f345c5d9ce33a5d8f37d9bdda375fd 100644 (file)
@@ -10,6 +10,7 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O0 -gbtf -dA" } */
+/* { dg-require-effective-target size32plus } */
 
 /* Struct with 3 members and no bitfield (kind_flag not set).  */
 /* { dg-final { scan-assembler-times "\[\t \]0x4000003\[\t \]+\[^\n\]*btt_info" 1 } } */
index 62bca6922aba94eaeb0260dc255fe2daa2dd7480..59ec52ad199aa7627963aae92de8309abf98386c 100644 (file)
@@ -1,6 +1,7 @@
 /* PR tree-optimization/102232 */
 /* { dg-do run } */
 /* { dg-options "-O -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
 
 int __attribute__ ((noipa)) foo (int a, int b)
 {
@@ -49,4 +50,4 @@ main (void)
 
 /* Verify that multiplication and division has been removed.  */
 /* { dg-final { scan-tree-dump-not " \\* " "optimized" } } */
-/* { dg-final { scan-tree-dump-not " / " "optimized" } } */
\ No newline at end of file
+/* { dg-final { scan-tree-dump-not " / " "optimized" } } */
index dc8810ab5af2f866c8d5138586cec44b44bd096a..87b237bdb53fa2adfa4c284cb0b0eb9ca1466830 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-bswap-details" } */
 
-typedef unsigned int uint32_t;
+typedef __UINT32_TYPE__ uint32_t;
 typedef unsigned char uint8_t;
 
 uint32_t load_le_32_or(const uint8_t *ptr)
index 77bcb4a673931f9541530551c5f894f4bfdd580a..bbfaa45d967251e36112e91d78802112ce0cdd76 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O1" } */
+/* { dg-require-effective-target int32plus } */
 
 struct S1  {
         unsigned int _0;
index 84e1a08be295da4afc751ac5f62ad040796586d6..9e85f108f79752dcc762cc1d5262f303e69fd30a 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 unsigned char uc;
-unsigned short us;
+__UINT16_TYPE__ us;
 
 void testuc() {
   unsigned int g = 0;
@@ -18,9 +18,9 @@ void testuc() {
 }
 
 void testus() {
-  unsigned int g = 0;
-  unsigned int *p1 = &g;
-  unsigned short *p2 = &us;
+  __UINT32_TYPE__ g = 0;
+  __UINT32_TYPE__ *p1 = &g;
+  __UINT16_TYPE__ *p2 = &us;
 
   do {
     (*p1)++;
index 6f28b3b5ed8abeb26d77c6c709537c3f5c56090b..51f4b7a74efdff3c30e0c12ce9e2de13d86757a0 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fwrapv" } */
 signed char sc;
-signed short ss;
+__INT16_TYPE__ ss;
 
 void testsc() {
   unsigned int g = 0;
@@ -18,9 +18,9 @@ void testsc() {
 }
 
 void testss() {
-  unsigned int g = 0;
-  unsigned int *p1 = &g;
-  signed short *p2 = &ss;
+  __UINT32_TYPE__ g = 0;
+  __UINT32_TYPE__ *p1 = &g;
+  __INT16_TYPE__ *p2 = &ss;
 
   do {
     (*p1)++;
index cb8e7495b152d3dc2f6b205f017f7ca0b1ae12ff..ca2e091ed25e15671210fcfeaba3bf64e4ba01b3 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* { dg-require-effective-target size32plus } */
 
 typedef signed char int8_T;
 typedef int int32_T;
index 39a06846529558d36791c86cee8ebf8e97cf9795..8eb2006d0a9ab9109b1a6bc3a0ee0dc0e057da0f 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O1" } */
+/* { dg-require-effective-target int32plus } */
 
 struct a {
   int b;
index 205133d8e0c2210f1f4fa6d544242ac0dc1039fc..968620582afcca87f6a5a43a9e11df2c1a48ec5d 100644 (file)
@@ -1,6 +1,7 @@
 /* PR tree-optimization/96779 */
 /* { dg-do run } */
 /* { dg-options "-O -fdump-tree-optimized -fwrapv" } */
+/* { dg-require-effective-target int32plus } */
 
 #include <stdbool.h>
 
index 0d46e8eeb1502c746f16d62cf0e42c9a4f94092d..03618bf81d27636d6fbc1d26343f45e0235dda00 100644 (file)
@@ -1,6 +1,7 @@
 /* PR tree-optimization/96779 */
 /* { dg-do run } */
 /* { dg-options "-O -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
 
 #include <stdbool.h>
 
index c15d6bd708e9beedac4b9089d9a970e36c0dbbee..859d7ac4ac14ff13e82663255da0b1f61a5451e4 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fgimple" } */
+/* { dg-require-effective-target int32plus } */
 
 __attribute__((noipa))
 void __GIMPLE (ssa,startwith("evrp"))
index d2b054e9355cd975673b359b35b6efa92bf7a607..e0a0b6b8e00a2fcbf70a8dc3edc1564fbf8351f0 100644 (file)
@@ -1,11 +1,15 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
 
+#if __SIZEOF_INT__ == 2
+#define int __INT32_TYPE__
+#endif
+
 int foo(int x)
 {
     int p = x & 24;
     int r = 1 << p; 
-    return r & (1<<17);
+    return r & ((int)1<<17);
 }
 
 /* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
index 9ac0fc6e4de55e298df6ba32e3b8fa15d54ea2a6..fd6c86772127cc1a54869fdc9154036f5a07d644 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-sink-stats" } */
+/* { dg-require-effective-target int32plus } */
 
 #include <stdint.h>