This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix mips-linux-gnu mips.exp failures


As David mentioned before, quite a few MIPS16 tests fail for
mips-linux-gnu.  The problem is that we run the tests with the
-mabicalls default, and we don't yet support that in combination
with MIPS16.  I said earlier that I wasn't brave enough to actually
reject the combination, but I've since relented: Sandra's patch means
that we now say sorry() whenever the combination arises, instead of
allowing some cases and ICEing on most.

This patch therefore adds a new mips16_attribute target selector.
It also adds a new dg-add-options feature that tries to add options
that enable MIPS16 code generation (-mno-abicalls -fno-pic).  Thus
normal mips-linux-gnu tests do run the compile-only MIPS16 tests
but, for example, --target_board unix/-fpic doesn't.

Also, the patch:

  - Removes a few remaining cases that forced -mips16 or -mno-mips16
    on the command line, instead of using attributes.

  - Removes the special -mno-mips16 handling in mips.exp.

  - Adds -D options to define MIPS and NOMIPS16, instead of having
    to duplicate #defines in every test.  (The previous point meant
    we'd have needed more copies otherwise.)  To make this possible,
    the patch:

    - Makes dg-mips-options add to dg-extra-tool-flags, rather than
      overwrite it.

    - Makes the couple of tests that used dg-options use dg-mips-options
      instead.

Tested on mips-linux-gnu and mipsisa64-elfoabi.  Applied to trunk.

Richard


gcc/
	* doc/sourcebuild.texi: Document dg-add-options mips16_attribute.

gcc/testsuite/
	* lib/target-supports.exp (add_options_for_mips16_attribute)
	(check_effective_target_mips16_attribute): New functions.
	* gcc.target/mips/mips.exp: Define MIPS16 and NOMIPS16 on the
	command line.
	(dg-mips-options) Remove -mno-mips16 handling.  Add options to
	extra_test_flags.
	* gcc.target/mips/asm-1.c (NOMIPS16): Delete.
	* gcc.target/mips/atomic-memory-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/atomic-memory-2.c (NOMIPS16): Likewise.
	* gcc.target/mips/branch-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/dspr2-MULT.c (NOMIPS16): Likewise.
	* gcc.target/mips/dspr2-MULTU.c (NOMIPS16): Likewise.
	* gcc.target/mips/fpcmp-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/fpcmp-2.c (NOMIPS16): Likewise.
	* gcc.target/mips/ins-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/madd-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/maddu-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/mips32-dsp-run.c (NOMIPS16): Likewise.
	* gcc.target/mips/mips32-dspr2-type.c (NOMIPS16): Likewise.
	* gcc.target/mips/msub-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/msubu-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/near-far-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/near-far-4.c (NOMIPS16): Likewise.
	* gcc.target/mips/neg-abs-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/smartmips-lwxs.c (NOMIPS16): Likewise.
	* gcc.target/mips/smartmips-ror-1.c (NOMIPS16): Likewise.
	* gcc.target/mips/smartmips-ror-2.c (NOMIPS16): Likewise.
	* gcc.target/mips/smartmips-ror-3.c (NOMIPS16): Likewise.
	* gcc.target/mips/smartmips-ror-4.c (NOMIPS16): Likewise.
	* gcc.target/mips/pr26765.c: Use dg-mips-options instead of dg-options.
	(NOMIPS16): Delete.
	* gcc.target/mips/20020620-1.c: Use dg-mips-options instead
	of dg-options.
	* gcc.target/mips/call-saved-1.c: Remove -mips16 and -mno-abicalls
	options.  Require { target mips16_attribute } and use dg-add-options
	to add the associated options.
	(foo): Use MIPS16.
	* gcc.target/mips/call-saved-2.c: As for call-saved-1.c.
	* gcc.target/mips/call-saved-3.c: Likewise.
	* gcc.target/mips/code-readable-1.c: Require { target
	mips16_attribute } and use dg-add-options to add the associated
	options.  Remove trailing whitespace.
	(NOMIPS16): Delete.
	* gcc.target/mips/code-readable-2.c: Likewise.
	* gcc.target/mips/code-readable-3.c: Likewise.
	* gcc.target/mips/mips16-attributes-2.c: Likewise.
	* gcc.target/mips/mips16e-extends.c: Remove -mips16 option.
	Require { target mips16_attribute } and use dg-add-options to
	add the associated options.
	(cksum16, cksum8): Use MIPS16.
	* gcc.target/mips/save-restore-1.c: Remove -mips16 option.
	Require { target mips16_attribute } and use dg-add-options to
	add the associated options.
	(foo): Use MIPS16.
	* gcc.target/mips/save-restore-2.c: Likewise.
	* gcc.target/mips/save-restore-3.c: Likewise.
	* gcc.target/mips/save-restore-4.c: Likewise.
	* gcc.target/mips/save-restore-5.c: Likewise.  Also remove
	-mno-abicalls.
	* gcc.target/mips/mips-sched-madd.c: Remove -mno-mips16.
	(foo): Use NOMIPS16.

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	2007-09-22 20:53:07.000000000 +0100
+++ gcc/doc/sourcebuild.texi	2007-09-22 20:53:17.000000000 +0100
@@ -983,6 +983,10 @@ The supported values of @var{feature} ar
 @table @code
 @item c99_runtime
 The target's C99 runtime (both headers and libraries).
+
+@item mips16_attribute
+@code{mips16} function attributes.  Only MIPS targets support this feature,
+and only then in certain modes.
 @end table
 
 @item @{ dg-skip-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @}
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/lib/target-supports.exp	2007-09-22 20:53:17.000000000 +0100
@@ -625,6 +625,23 @@ proc check_effective_target_mips64 { } {
     }]
 }
 
+# Add the options needed for MIPS16 function attributes.  At the moment,
+# we don't support MIPS16 PIC.
+
+proc add_options_for_mips16_attribute { flags } {
+    return "$flags -mno-abicalls -fno-pic"
+}
+
+# Return true if we can force a mode that allows MIPS16 code generation.
+
+proc check_effective_target_mips16_attribute { } {
+    return [check_no_compiler_messages mips16_attributes assembly {
+	#if __PIC__
+	#error FOO
+	#endif
+    } [add_options_for_mips16_attribute ""]]
+}
+
 # Return 1 if the current multilib does not generate PIC by default.
 
 proc check_effective_target_nonpic { } {
Index: gcc/testsuite/gcc.target/mips/mips.exp
===================================================================
--- gcc/testsuite/gcc.target/mips/mips.exp	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips.exp	2007-09-22 20:53:17.000000000 +0100
@@ -122,9 +122,6 @@ proc is_gp32_flag {flag} {
 #	if the other flags don't do so.  Skip the test if the multilib
 #	flags force a 32-bit ABI or a 32-bit architecture.
 #
-#    -mno-mips16
-#	Skip the test for MIPS16 targets.
-#
 #    -march=*
 #    -mips*
 #	Select the target architecture.  Skip the test for MIPS16 targets
@@ -194,11 +191,7 @@ proc dg-mips-options {args} {
     }
     # Handle the other options.
     foreach flag $flags {
-	if {$flag == "-mno-mips16"} {
-	    if {$mips_mips16} {
-		set matches 0
-	    }
-	} elseif {$flag == "-mfp64"} {
+	if {$flag == "-mfp64"} {
 	    if {$mips_isa < 33 || $mips_float != "hard"} {
 		set matches 0
 	    }
@@ -230,7 +223,7 @@ proc dg-mips-options {args} {
 	}
     }
     if {$matches} {
-	set extra_tool_flags $flags
+	append extra_tool_flags " " $flags
     } else {
 	set do_what [list [lindex $do_what 0] "N" "P"]
     }
@@ -239,5 +232,6 @@ proc dg-mips-options {args} {
 setup_mips_tests
 
 dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" \
+    "-DMIPS16=__attribute__((mips16)) -DNOMIPS16=__attribute__((nomips16))"
 dg-finish
Index: gcc/testsuite/gcc.target/mips/asm-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/asm-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/asm-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -3,8 +3,6 @@
 /* { dg-do assemble } */
 /* { dg-mips-options "-O" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 int foo (int n)
 {
   register int k asm ("$16") = n;
Index: gcc/testsuite/gcc.target/mips/atomic-memory-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/atomic-memory-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/atomic-memory-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 extern void abort (void);
 extern void exit (int);
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 int main ()
 {
 #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
Index: gcc/testsuite/gcc.target/mips/atomic-memory-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/atomic-memory-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/atomic-memory-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -3,8 +3,6 @@
 /* { dg-final { scan-assembler "addiu" } } */
 /* { dg-final { scan-assembler-not "subu" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 unsigned long
 f(unsigned long *p)
 {
Index: gcc/testsuite/gcc.target/mips/branch-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/branch-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/branch-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
    followed by a branch on zero.  */
 /* { dg-mips-options "-O2" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 void bar (void);
 NOMIPS16 void f1 (int x) { if (x & 4) bar (); }
 NOMIPS16 void f2 (int x) { if ((x >> 2) & 1) bar (); }
Index: gcc/testsuite/gcc.target/mips/dspr2-MULT.c
===================================================================
--- gcc/testsuite/gcc.target/mips/dspr2-MULT.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/dspr2-MULT.c	2007-09-22 20:53:17.000000000 +0100
@@ -7,8 +7,6 @@
 /* { dg-final { scan-assembler "ac2" } } */
 /* { dg-final { scan-assembler "ac3" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 typedef long long a64;
 a64 a[4];
 int b[4], c[4];
Index: gcc/testsuite/gcc.target/mips/dspr2-MULTU.c
===================================================================
--- gcc/testsuite/gcc.target/mips/dspr2-MULTU.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/dspr2-MULTU.c	2007-09-22 20:53:17.000000000 +0100
@@ -7,8 +7,6 @@
 /* { dg-final { scan-assembler "ac2" } } */
 /* { dg-final { scan-assembler "ac3" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 typedef long long a64;
 a64 a[4];
 unsigned int b[4], c[4];
Index: gcc/testsuite/gcc.target/mips/fpcmp-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/fpcmp-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/fpcmp-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,7 +1,5 @@
 /* We used to use c.lt.fmt instead of c.ule.fmt here.  */
 /* { dg-mips-options "-mhard-float -O2" } */
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 int f1 (float x, float y) { return __builtin_isless (x, y); }
 NOMIPS16 int f2 (double x, double y) { return __builtin_isless (x, y); }
 /* { dg-final { scan-assembler "c\\.ule\\.s" } } */
Index: gcc/testsuite/gcc.target/mips/fpcmp-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/fpcmp-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/fpcmp-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,7 +1,5 @@
 /* We used to use c.le.fmt instead of c.ult.fmt here.  */
 /* { dg-mips-options "-mhard-float -O2" } */
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 int f1 (float x, float y) { return __builtin_islessequal (x, y); }
 NOMIPS16 int f2 (double x, double y) { return __builtin_islessequal (x, y); }
 /* { dg-final { scan-assembler "c\\.ult\\.s" } } */
Index: gcc/testsuite/gcc.target/mips/ins-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/ins-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/ins-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-O -march=mips32r2" } */
 /* { dg-final { scan-assembler "\tins\t" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 struct
 {
   unsigned int i : 2;
Index: gcc/testsuite/gcc.target/mips/madd-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/madd-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/madd-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-O2 -mips32 -mgp32" } */
 /* { dg-final { scan-assembler-times "\tmadd\t" 3 } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 long long
 f1 (int x, int y, long long z)
 {
Index: gcc/testsuite/gcc.target/mips/maddu-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/maddu-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/maddu-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-O2 -mips32 -mgp32" } */
 /* { dg-final { scan-assembler-times "\tmaddu\t" 3 } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 typedef unsigned int ui;
 typedef unsigned long long ull;
 
Index: gcc/testsuite/gcc.target/mips/mips32-dsp-run.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips32-dsp-run.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips32-dsp-run.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-do run { target mipsisa32r2*-*-* } } */
 /* { dg-mips-options "-march=mips32r2 -mdsp -O2" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 #include <stdlib.h>
 #include <stdio.h>
 
Index: gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips32-dspr2-type.c	2007-09-22 20:53:17.000000000 +0100
@@ -3,8 +3,6 @@
 /* { dg-mips-options "-march=mips32r2 -mdspr2" } */
 /* { dg-final { scan-assembler "\tmul.ph\t" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 typedef short v2hi __attribute__ ((vector_size(4)));
 
 NOMIPS16 v2hi mul_v2hi (v2hi a, v2hi b)
Index: gcc/testsuite/gcc.target/mips/msub-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/msub-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/msub-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-O2 -mips32 -mgp32" } */
 /* { dg-final { scan-assembler-times "\tmsub\t" 2 } } */
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 long long
 f1 (int x, int y, long long z)
 {
Index: gcc/testsuite/gcc.target/mips/msubu-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/msubu-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/msubu-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-O2 -mips32 -mgp32" } */
 /* { dg-final { scan-assembler-times "\tmsubu\t" 2 } } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 typedef unsigned int ui;
 typedef unsigned long long ull;
 
Index: gcc/testsuite/gcc.target/mips/near-far-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/near-far-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/near-far-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-mlong-calls -O2" } */
 /* { dg-require-effective-target nonpic } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 extern int long_call_func () __attribute__((long_call));
 NOMIPS16 extern int far_func () __attribute__((far));
 NOMIPS16 extern int near_func () __attribute__((near));
Index: gcc/testsuite/gcc.target/mips/near-far-4.c
===================================================================
--- gcc/testsuite/gcc.target/mips/near-far-4.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/near-far-4.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,8 +2,6 @@
 /* { dg-mips-options "-mno-long-calls -O2" } */
 /* { dg-require-effective-target nonpic } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 extern int long_call_func () __attribute__((long_call));
 NOMIPS16 extern int far_func () __attribute__((far));
 NOMIPS16 extern int near_func () __attribute__((near));
Index: gcc/testsuite/gcc.target/mips/neg-abs-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/neg-abs-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/neg-abs-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -7,8 +7,6 @@
 /* { dg-final { scan-assembler "abs.s" } } */
 /* { dg-final { scan-assembler "abs.d" } } */
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 float f1 (float f) { return -f; }
 NOMIPS16 float f2 (float f) { return __builtin_fabsf (f); }
 NOMIPS16 double d1 (double d) { return -d; }
Index: gcc/testsuite/gcc.target/mips/smartmips-lwxs.c
===================================================================
--- gcc/testsuite/gcc.target/mips/smartmips-lwxs.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/smartmips-lwxs.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-mips-options "-O -msmartmips" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 int scaled_indexed_word_load (int a[], int b)
 {
   return a[b];
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/smartmips-ror-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/smartmips-ror-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-mips-options "-O -msmartmips" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 int rotate_left (unsigned a, unsigned s)
 {
   return (a << s) | (a >> (32 - s));
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/smartmips-ror-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/smartmips-ror-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-mips-options "-O -msmartmips" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 NOMIPS16 int rotate_right (unsigned a, unsigned s)
 {
   return (a >> s) | (a << (32 - s));
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/smartmips-ror-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/smartmips-ror-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-mips-options "-O -msmartmips" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 #define S 13
 
 NOMIPS16 int rotate_left_constant (unsigned a)
Index: gcc/testsuite/gcc.target/mips/smartmips-ror-4.c
===================================================================
--- gcc/testsuite/gcc.target/mips/smartmips-ror-4.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/smartmips-ror-4.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,6 @@
 /* { dg-do compile } */
 /* { dg-mips-options "-O -msmartmips" } */
 
-#define NOMIPS16 __attribute__ ((nomips16)) 
-
 #define S 13
 
 NOMIPS16 int rotate_right_constant (unsigned a)
Index: gcc/testsuite/gcc.target/mips/pr26765.c
===================================================================
--- gcc/testsuite/gcc.target/mips/pr26765.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/pr26765.c	2007-09-22 20:53:17.000000000 +0100
@@ -2,12 +2,10 @@
    This testcase used to trigger an unrecognizable insn.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -w" } */
+/* { dg-mips-options "-O2 -w" } */
 
 __thread int *a = 0;
 
-#define NOMIPS16 __attribute__ ((nomips16))
-
 NOMIPS16 void foo (void)
 {
   extern int *b;
Index: gcc/testsuite/gcc.target/mips/20020620-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/20020620-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/20020620-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,5 +1,5 @@
 /* { dg-do compile { target mips64*-*-* mipsisa64*-*-* } } */
-/* { dg-options "-O2 -mlong64" } */
+/* { dg-mips-options "-O2 -mlong64" } */
 int foo (int *x, int i)
 {
   return x[i] + i;
Index: gcc/testsuite/gcc.target/mips/call-saved-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/call-saved-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/call-saved-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,9 +1,12 @@
 /* Check that we save all call-saved GPRs in a MIPS16 __builtin_eh_return
    function.  */
-/* { dg-mips-options "-mips2 -mips16 -mno-abicalls" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips2" } */
+/* { dg-add-options mips16_attribute } */
 
 void bar (void);
-void
+
+MIPS16 void
 foo (int x)
 {
   __builtin_unwind_init ();
Index: gcc/testsuite/gcc.target/mips/call-saved-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/call-saved-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/call-saved-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,7 +1,9 @@
 /* Check that we save non-MIPS16 GPRs if they are explicitly clobbered.  */
-/* { dg-mips-options "-mips2 -mips16 -mno-abicalls -O2" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips2 -O2" } */
+/* { dg-add-options mips16_attribute } */
 
-void
+MIPS16 void
 foo (void)
 {
   asm volatile ("" ::: "$19", "$23", "$24", "$30");
Index: gcc/testsuite/gcc.target/mips/call-saved-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/call-saved-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/call-saved-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,10 +1,13 @@
 /* Check that we save all call-saved GPRs in a MIPS16 __builtin_setjmp
    function.  */
-/* { dg-mips-options "-mips2 -mips16 -mno-abicalls -O2" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips2 -O2" } */
+/* { dg-add-options mips16_attribute } */
 
 void bar (void);
 extern int buf[];
-void
+
+MIPS16 void
 foo (int x)
 {
   if (__builtin_setjmp (buf) == 0)
Index: gcc/testsuite/gcc.target/mips/code-readable-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/code-readable-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/code-readable-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,8 +1,8 @@
+/* { dg-do compile { target mips16_attribute } } */
 /* { dg-mips-options "-mcode-readable=yes -mgp32" } */
+/* { dg-add-options mips16_attribute } */
 
-#define MIPS16 __attribute__ ((mips16)) 
-
-MIPS16 int 
+MIPS16 int
 foo (int i)
 {
   switch (i)
Index: gcc/testsuite/gcc.target/mips/code-readable-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/code-readable-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/code-readable-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,6 +1,6 @@
+/* { dg-do compile { target mips16_attribute } } */
 /* { dg-mips-options "-mcode-readable=pcrel -mgp32" } */
-
-#define MIPS16 __attribute__ ((mips16))
+/* { dg-add-options mips16_attribute } */
 
 MIPS16 int
 foo (int i)
Index: gcc/testsuite/gcc.target/mips/code-readable-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/code-readable-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/code-readable-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,6 +1,6 @@
+/* { dg-do compile { target mips16_attribute } } */
 /* { dg-mips-options "-mcode-readable=no -mgp32" } */
-
-#define MIPS16 __attribute__ ((mips16))
+/* { dg-add-options mips16_attribute } */
 
 MIPS16 int
 foo (int i)
Index: gcc/testsuite/gcc.target/mips/mips16-attributes-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips16-attributes-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips16-attributes-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,4 +1,6 @@
+/* { dg-do compile { target mips16_attribute } } */
 /* { dg-skip-if "" { *-*-* } { "-mflip-mips16" } { "" } } */
+/* { dg-add-options mips16_attribute } */
 
 void f1 (void);
 void __attribute__((mips16)) f1 (void) {} /* { dg-error "conflicting" } */
Index: gcc/testsuite/gcc.target/mips/mips16e-extends.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips16e-extends.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips16e-extends.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,14 +1,15 @@
-/* { dg-do compile } */
-/* { dg-mips-options "-Os -march=mips32 -mips16" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-Os -march=mips32" } */
+/* { dg-add-options mips16_attribute } */
 
-short cksum16 (unsigned long n)
+MIPS16 short cksum16 (unsigned long n)
 {
   unsigned long l;
   l = validate (n, (n >> 16) + (n & 0xffff));
   return l;
 }
 
-signed char cksum8 (unsigned long n)
+MIPS16 signed char cksum8 (unsigned long n)
 {
   unsigned long l;
   l = validate (n, (n >> 8) + (n & 0xff));
Index: gcc/testsuite/gcc.target/mips/save-restore-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/save-restore-1.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/save-restore-1.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,10 +1,13 @@
 /* Check that we can use the save instruction to save varargs.  */
-/* { dg-mips-options "-mips32r2 -mgp32 -mips16 -O2" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips32r2 -mgp32 -O2" } */
+/* { dg-add-options mips16_attribute } */
+
 #include <stdarg.h>
 
 int bar (int, va_list ap);
 
-int
+MIPS16 int
 foo (int n, ...)
 {
   va_list ap;
Index: gcc/testsuite/gcc.target/mips/save-restore-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/save-restore-2.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/save-restore-2.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,6 +1,9 @@
 /* Check that we can use the save instruction to save spilled arguments.  */
-/* { dg-mips-options "-mips32r2 -mgp32 -mips16 -O2" } */
-void
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips32r2 -mgp32 -O2" } */
+/* { dg-add-options mips16_attribute } */
+
+MIPS16 void
 foo (int *a, int b, int c)
 {
   asm volatile ("" ::: "$2", "$3", "$4", "$5", "$6", "$7", "$8",
Index: gcc/testsuite/gcc.target/mips/save-restore-3.c
===================================================================
--- gcc/testsuite/gcc.target/mips/save-restore-3.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/save-restore-3.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,9 +1,12 @@
 /* Check that we can use the save instruction to save spilled arguments
    when the argument save area is out of range of a direct load or store.  */
-/* { dg-mips-options "-mips32r2 -mgp32 -mips16 -O2" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips32r2 -mgp32 -O2" } */
+/* { dg-add-options mips16_attribute } */
+
 void bar (int *);
 
-void
+MIPS16 void
 foo (int *a, int b, int c)
 {
   int x[0x4000];
Index: gcc/testsuite/gcc.target/mips/save-restore-4.c
===================================================================
--- gcc/testsuite/gcc.target/mips/save-restore-4.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/save-restore-4.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,7 +1,11 @@
 /* Check that we can use the save instruction to save $16, $17 and $31.  */
-/* { dg-mips-options "-mips32r2 -mgp32 -mips16 -O2" } */
+/* { dg-do compile { target mips16_attribute } } */
+/* { dg-mips-options "-mips32r2 -mgp32 -O2" } */
+/* { dg-add-options mips16_attribute } */
+
 void bar (void);
-void
+
+MIPS16 void
 foo (void)
 {
   bar ();
Index: gcc/testsuite/gcc.target/mips/save-restore-5.c
===================================================================
--- gcc/testsuite/gcc.target/mips/save-restore-5.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/save-restore-5.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,11 +1,12 @@
 /* Check that we don't try to save the same register twice.  */
-/* { dg-do assemble } */
-/* { dg-mips-options "-mips32r2 -mgp32 -mips16 -mno-abicalls -O2" } */
+/* { dg-do assemble { target mips16_attribute } } */
+/* { dg-mips-options "-mips32r2 -mgp32 -O2" } */
+/* { dg-add-options mips16_attribute } */
 
 int bar (int, int, int, int);
 void frob (void);
 
-void
+MIPS16 void
 foo (int a1, int a2, int a3, int a4)
 {
   asm volatile ("" ::: "$2", "$3", "$4", "$5", "$6", "$7", "$8",
Index: gcc/testsuite/gcc.target/mips/mips-sched-madd.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips-sched-madd.c	2007-09-22 20:53:07.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/mips-sched-madd.c	2007-09-22 20:53:17.000000000 +0100
@@ -1,9 +1,9 @@
 /* Test for case where another independent multiply insn may interfere
    with a macc chain.  */
 /* { dg-do compile } */
-/* { dg-mips-options "-Os -march=24kf -mno-mips16" } */
+/* { dg-mips-options "-Os -march=24kf" } */
 
-int foo (int a, int b, int c, int d, int e, int f, int g)
+NOMIPS16 int foo (int a, int b, int c, int d, int e, int f, int g)
 {
   int temp;
   int acc;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]