]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This fixes problems with tests that exceed a data type or the maximum stack frame...
authorJoern Rennecke <joern.rennecke@riscy-ip.com>
Mon, 12 Aug 2024 10:13:24 +0000 (11:13 +0100)
committerJoern Rennecke <joern.rennecke@riscy-ip.com>
Mon, 12 Aug 2024 10:27:12 +0000 (11:27 +0100)
Note: GCC has a limitation that a stack frame cannot exceed half the address space.

For two tests the decision to modify or skip them seems not so clear-cut;
I choose to modify gcc.dg/pr47893.c to use types that fit the numbers, as
that seemed to have little impact on the test, and skip gcc.dg/pr115646.c
for 16 bit, as layout of structs with bitfields members can have quite
subtle rules.

gcc/testsuite/
* gcc.dg/pr107523.c: Make sure variables can fit numbers.
* gcc.dg/pr47893.c: Add dg-require-effective-target size20plus clause.
* c-c++-common/torture/builtin-clear-padding-2.c:
dg-require-effective-target size20plus.
* gcc.dg/pr115646.c: dg-require-effective-target int32plus.
* c-c++-common/analyzer/coreutils-sum-pr108666.c:
For c++, expect a warning about exceeding maximum object size
if not size20plus.
* gcc.dg/torture/inline-mem-cpy-1.c:
Like the included file, dg-require-effective-target ptr32plus.
* gcc.dg/torture/inline-mem-cmp-1.c: Likewise.

gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c
gcc/testsuite/gcc.dg/pr107523.c
gcc/testsuite/gcc.dg/pr115646.c
gcc/testsuite/gcc.dg/pr47893.c
gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c
gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c

index dadd27eaf4100f0b8d82ddc3adfc51ff4fe65c77..c41b61dd081d404bb0f9906064637d32609cf1ea 100644 (file)
@@ -35,7 +35,7 @@ bsd_sum_stream(FILE* stream, void* resstream, uintmax_t* length)
   int checksum = 0;
   uintmax_t total_bytes = 0;
   static const size_t buffer_length = 32768;
-  uint8_t* buffer = (uint8_t *) malloc(buffer_length);
+  uint8_t* buffer = (uint8_t *) malloc(buffer_length); /* { dg-warning "argument 1 value '32768' exceeds maximum object size 32767" "" { target { c++ && { ! size20plus } } } } */
 
   if (!buffer)
     return -1;
index 099f202ebc75e6850f3041f60d6143b8ca7428f9..d91b01640dc4ad3a7bf82d76144fba6359b3f273 100644 (file)
@@ -1,5 +1,6 @@
 /* PR libstdc++/88101 */
 /* { dg-do run } */
+/* { dg-require-effective-target size20plus } */
 
 typedef int T __attribute__((aligned (16384)));
 struct S { char a; short b; long double c; T d; T e; long long f; };
index 1e5ed46c6362fcce0fa1a754a5222c2f188d00b7..d6afa131249de9f82d729bc46f4c8b99506e6d59 100644 (file)
@@ -1,10 +1,12 @@
 /* { dg-do run } */
 /* { dg-options "-O2 " } */
 
-int a, b = 1;
-unsigned int c = 1;
+typedef __typeof__(465984011) i32;
+typedef __typeof__(465984011U) u32;
+i32 a, b = 1;
+u32 c = 1;
 int main() {
-  int d = 1, f;
+  i32 d = 1, f;
   if (b)
     d = 0;
   a = -1;
@@ -14,7 +16,7 @@ int main() {
     f = b;
   b = f;
   if (f <= a) {
-    int g = -(a && 1), h = g - f && a, i = ~(c / f) && 1 % (a | h);
+    i32 g = -(a && 1), h = g - f && a, i = ~(c / f) && 1 % (a | h);
     if (c) {
       g = f;
       if (i || (g && (g > -465984012)))
index 247777bc1e459e33f9aacfc4685da988605960da..7938a309513f12d3e429b860d325f8426ca41dc0 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
 
 extern double pow(double x, double y);
 
index 7e1064d03aa99e01bd33fc41054ce6d681c310e1..cb71132665f4486ceb424e9daf8b5f6145decc63 100644 (file)
@@ -3,6 +3,9 @@
 /* { dg-options "-O2" } */
 /* { dg-additional-options "-mtune=atom -fno-omit-frame-pointer -fno-strict-aliasing" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 /* { dg-skip-if "Too much RAM needed" { "avr-*-*" } } */
+/* About 50 KB code, 33 KB stack, too big for byte-addressed
+   von Neumann targets with 16 bit addresses.  */
+/* { dg-require-effective-target size20plus } */
 
 extern void abort (void);
 
index 4bc66597b35a602e06c36718172ae140f2bec328..28b7f750e2d3a9b22a24ad8a190d3e6e172a2a08 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-finline-stringops=memcmp -save-temps -g0 -fno-lto" } */
+/* { dg-require-effective-target ptr32plus } */
 /* { dg-timeout-factor 2 } */
 
 #include "../memcmp-1.c"
index f0752349571b93e8a2f7cbf26b4f7edd9ee8fef3..cf8188925bd64f7b0420419559f3aa46f8b0d7dc 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-finline-stringops=memcpy -save-temps -g0 -fno-lto" } */
 /* { dg-additional-options "-DRUN_FRACTION=11" { target simulator } } */
+/* { dg-require-effective-target ptr32plus } */
 /* { dg-timeout-factor 2 } */
 
 #include "../memcmp-1.c"