From: Richard Sandiford Date: Tue, 10 Mar 2026 12:05:56 +0000 (+0000) Subject: testsuite: Remove -O options from some mips.exp tests X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b5087db30833cc6cea2ae5966dea1a76c028987;p=thirdparty%2Fgcc.git testsuite: Remove -O options from some mips.exp tests Running mips.exp generated several errors like: ERROR: gcc.target/mips/pr118608-1.c -O0 : Unrecognised option: -O2 for " dg-options 2 "-mabi=64 -O2" " mips.exp overrides dg-options with some logic to (try to) enable the transitive closure of features that would be needed to make the dg-options valid for the current test run, downgrading from run to assemble to compile as neecessary. In order to make sure that every relevant option has been considered, this version of dg-options errors out for things that it doesn't recognise. -O options aren't in the list because mips.exp cycles through the usual optimisation options. Instead, dg-skips are used if the test doesn't make sense for a particular -O* option. Removing the -O options makes pr118608-2.c identical to pr118608-1.c and pr118608-4.c identical to pr118608-3.c. gcc/testsuite/ * gcc.target/mips/pr118608-2.c: Delete. * gcc.target/mips/pr118608-4.c: Likewise. * gcc.target/mips/pr123833.c: Remove -O* option. * gcc.target/mips/pr118608-1.c: Likewise. * gcc.target/mips/pr118608-3.c: Likewise, and rename to pr118608-2.c. --- diff --git a/gcc/testsuite/gcc.target/mips/pr118608-1.c b/gcc/testsuite/gcc.target/mips/pr118608-1.c index e7384d7137d..9604b38059e 100644 --- a/gcc/testsuite/gcc.target/mips/pr118608-1.c +++ b/gcc/testsuite/gcc.target/mips/pr118608-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mabi=64 -O2" } */ +/* { dg-options "-mabi=64" } */ #define COUNT 10 diff --git a/gcc/testsuite/gcc.target/mips/pr118608-2.c b/gcc/testsuite/gcc.target/mips/pr118608-2.c index a5bcfda6ca1..d4c3908174d 100644 --- a/gcc/testsuite/gcc.target/mips/pr118608-2.c +++ b/gcc/testsuite/gcc.target/mips/pr118608-2.c @@ -1,5 +1,5 @@ -/* { dg-do run } */ -/* { dg-options "-mabi=64 -Os" } */ +/* { dg-do compile } */ +/* { dg-options "-mabi=64 -march=octeon2" } */ #define COUNT 10 diff --git a/gcc/testsuite/gcc.target/mips/pr118608-3.c b/gcc/testsuite/gcc.target/mips/pr118608-3.c deleted file mode 100644 index f017e4e858c..00000000000 --- a/gcc/testsuite/gcc.target/mips/pr118608-3.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mabi=64 -O2 -march=octeon2" } */ - -#define COUNT 10 - -typedef unsigned short u16; -typedef unsigned int u32; - -typedef struct NeedleAddress -{ - u16 nId; - u16 mId; -} NeedleAddress; - -u32 __attribute__ ((noinline)) prepareNeedle(const u16 upper, const u16 lower) -{ - u32 needleAddress = 0; - NeedleAddress *const addr = (NeedleAddress*)(&needleAddress); - addr->mId = upper; - addr->nId = lower; - return needleAddress; -} - -const u32* __attribute__ ((noinline)) findNeedle(const u32 needle, const u32* begin, const u32* end) -{ - while ( begin != end && needle != *begin ) - { - ++begin; - } - return begin; -} - -int main() -{ - u32 needle = prepareNeedle(0xDCBA, 0xABCD); - - u32 haystack[COUNT] = {}; - for (int i = 0; i < COUNT; i++) - haystack[i] = needle; - - const u32* result = findNeedle(needle, haystack, haystack + COUNT); - if (result == haystack + COUNT) - __builtin_abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.target/mips/pr118608-4.c b/gcc/testsuite/gcc.target/mips/pr118608-4.c deleted file mode 100644 index 4c96e378e0f..00000000000 --- a/gcc/testsuite/gcc.target/mips/pr118608-4.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-mabi=64 -Os -march=octeon2" } */ - -#define COUNT 10 - -typedef unsigned short u16; -typedef unsigned int u32; - -typedef struct NeedleAddress -{ - u16 nId; - u16 mId; -} NeedleAddress; - -u32 __attribute__ ((noinline)) prepareNeedle(const u16 upper, const u16 lower) -{ - u32 needleAddress = 0; - NeedleAddress *const addr = (NeedleAddress*)(&needleAddress); - addr->mId = upper; - addr->nId = lower; - return needleAddress; -} - -const u32* __attribute__ ((noinline)) findNeedle(const u32 needle, const u32* begin, const u32* end) -{ - while ( begin != end && needle != *begin ) - { - ++begin; - } - return begin; -} - -int main() -{ - u32 needle = prepareNeedle(0xDCBA, 0xABCD); - - u32 haystack[COUNT] = {}; - for (int i = 0; i < COUNT; i++) - haystack[i] = needle; - - const u32* result = findNeedle(needle, haystack, haystack + COUNT); - if (result == haystack + COUNT) - __builtin_abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.target/mips/pr123833.c b/gcc/testsuite/gcc.target/mips/pr123833.c index 4d0c9e8eaec..a3d7e4f97f3 100644 --- a/gcc/testsuite/gcc.target/mips/pr123833.c +++ b/gcc/testsuite/gcc.target/mips/pr123833.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -mabi=64 -mhard-float" } */ +/* { dg-options "-mabi=64 -mhard-float" } */ typedef short int16_t; typedef signed char int8_t;