diff -u gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0)
--- gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0)
@@ -1,5 +1,5 @@
 /* { dg-do assemble } */
-/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
 
 extern unsigned int foo2 (short*) __attribute__((pure));
 
@@ -19,2 +19,3 @@
-/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */
+/* { dg-final { object-size text <= 30 { target arm_thumb2 } } } */
 /* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */
diff -u gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0)
--- gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0)
@@ -1,5 +1,5 @@
 /* { dg-do assemble } */
-/* { dg-options "-mthumb -Os -fdump-tree-ivopts -save-temps" } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
 
 extern unsigned int foo (int*) __attribute__((pure));
 
@@ -20,2 +20,3 @@
-/* { dg-final { object-size text <= 36 { target arm_thumb2_ok } } } */
+/* { dg-final { object-size text <= 36 { target arm_thumb2 } } } */
 /* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */
diff -u gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0)
--- gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0)
@@ -1,5 +1,5 @@
 /* { dg-do assemble } */
-/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
 
 extern unsigned int foo (int*) __attribute__((pure));
 
@@ -19,2 +19,3 @@
-/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */
+/* { dg-final { object-size text <= 30 { target arm_thumb2 } } } */
 /* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */
diff -u gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0)
--- gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0)
@@ -1,5 +1,5 @@
 /* { dg-do assemble } */
-/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
 
 extern void foo2 (short*);
 
@@ -17,2 +17,3 @@
-/* { dg-final { object-size text <= 26 { target arm_thumb2_ok } } } */
+/* { dg-final { object-size text <= 26 { target arm_thumb2 } } } */
 /* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */
diff -u gcc/testsuite/gcc.target/arm/ivopts.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts.c (revision 0)
--- gcc/testsuite/gcc.target/arm/ivopts.c (revision 0)
+++ gcc/testsuite/gcc.target/arm/ivopts.c (revision 0)
@@ -1,5 +1,5 @@
 /* { dg-do assemble } */
-/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
 
 void
 tr5 (short array[], int n)
@@ -14,2 +14,5 @@
-/* { dg-final { object-size text <= 20 { target arm_thumb2_ok } } } */
+/* { dg-final { object-size text <= 20 { target arm_thumb2 } } } */
+/* { dg-final { object-size text <= 32 { target { arm_nothumb && { ! arm_iwmmxt_ok } } } } } */
+/* { dg-final { object-size text <= 36 { target { arm_nothumb && arm_iwmmxt_ok }  } } } */
 /* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */
reverted:
--- gcc/testsuite/gcc.target/arm/ivopts-6.c (revision 0)
+++ /dev/null (new file)
@@ -1,15 +0,0 @@
-/* { dg-do assemble } */
-/* { dg-options "-Os -fdump-tree-ivopts -save-temps -marm" } */
-
-void
-tr5 (short array[], int n)
-{
-  int x;
-  if (n > 0)
-    for (x = 0; x < n; x++)
-      array[x] = 0;
-}
-
-/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
-/* { dg-final { object-size text <= 32 } } */
-/* { dg-final { cleanup-tree-dump "ivopts" } } */
only in patch2:
unchanged:
--- gcc/testsuite/lib/target-supports.exp (revision 173734)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -1849,6 +1849,15 @@ proc check_effective_target_arm32 { } {
     }]
 }
 
+# Return 1 is this is an arm target not using Thumb
+proc check_effective_target_arm_nothumb { } {
+    return [check_no_compiler_messages arm_nothumb assembly {
+	#if (defined(__thumb__) || defined(__thumb2__))
+	#error FOO
+	#endif
+    }]
+}
+
 # Return 1 if this is an ARM target that only supports aligned vector accesses
 proc check_effective_target_arm_vect_no_misalign { } {
     return [check_no_compiler_messages arm_vect_no_misalign assembly {
@@ -1994,6 +2003,16 @@ proc check_effective_target_arm_thumb2_o
     } "-mthumb"]
 }
 
+# Return 1 is this is an ARM target where is Thumb-2 used.
+
+proc check_effective_target_arm_thumb2 { } {
+    return [check_no_compiler_messages arm_thumb2 assembly {
+	#if !defined(__thumb2__)
+	#error FOO
+	#endif
+    } ""]
+}
+
 # Return 1 if the target supports executing NEON instructions, 0
 # otherwise.  Cache the result.
 
