aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@riscy-ip.com>2024-08-12 11:13:24 +0100
committerJoern Rennecke <joern.rennecke@riscy-ip.com>2024-08-12 11:27:12 +0100
commit46bd63d872ffb9733c4fff51033447f26ce56576 (patch)
tree375ebcc0648d4b64ecd2c8962e8f9da268f854fa
parent40b9a7beb79acbea569be3066768cfb62c0f7c31 (diff)
downloadgcc-46bd63d872ffb9733c4fff51033447f26ce56576.zip
gcc-46bd63d872ffb9733c4fff51033447f26ce56576.tar.gz
gcc-46bd63d872ffb9733c4fff51033447f26ce56576.tar.bz2
This fixes problems with tests that exceed a data type or the maximum stack frame size on 16 bit targets.
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.
-rw-r--r--gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c2
-rw-r--r--gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr107523.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr115646.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr47893.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c1
7 files changed, 14 insertions, 5 deletions
diff --git a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
index dadd27e..c41b61d 100644
--- a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
+++ b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
@@ -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;
diff --git a/gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c b/gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c
index 099f202..d91b016 100644
--- a/gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c
+++ b/gcc/testsuite/c-c++-common/torture/builtin-clear-padding-2.c
@@ -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; };
diff --git a/gcc/testsuite/gcc.dg/pr107523.c b/gcc/testsuite/gcc.dg/pr107523.c
index 1e5ed46..d6afa13 100644
--- a/gcc/testsuite/gcc.dg/pr107523.c
+++ b/gcc/testsuite/gcc.dg/pr107523.c
@@ -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)))
diff --git a/gcc/testsuite/gcc.dg/pr115646.c b/gcc/testsuite/gcc.dg/pr115646.c
index 247777b..7938a30 100644
--- a/gcc/testsuite/gcc.dg/pr115646.c
+++ b/gcc/testsuite/gcc.dg/pr115646.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
extern double pow(double x, double y);
diff --git a/gcc/testsuite/gcc.dg/pr47893.c b/gcc/testsuite/gcc.dg/pr47893.c
index 7e1064d..cb71132 100644
--- a/gcc/testsuite/gcc.dg/pr47893.c
+++ b/gcc/testsuite/gcc.dg/pr47893.c
@@ -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);
diff --git a/gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c b/gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c
index 4bc6659..28b7f75 100644
--- a/gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c
+++ b/gcc/testsuite/gcc.dg/torture/inline-mem-cmp-1.c
@@ -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"
diff --git a/gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c b/gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c
index f075234..cf81889 100644
--- a/gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c
+++ b/gcc/testsuite/gcc.dg/torture/inline-mem-cpy-1.c
@@ -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"