===================================================================
@@ -1,5 +1,6 @@
/* { dg-do compile { target "sh*-*-*" } } */
-/* { dg-options "-ml -O2 -fomit-frame-pointer" } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-mb" && "-m5*"} { "" } } */
/* { dg-final { scan-assembler "mov @\\(4,r.\\),r.; mov @r.,r." } } */
double d;
@@ -7,13 +8,6 @@
f (void)
{
double r;
-
-/* If -mb from the target options is passed after -ml from dg-options, we
- end up with th reverse endianness. */
-#if TARGET_SHMEDIA || defined (__BIG_ENDIAN__)
- asm ("mov @(4,r1),r4; mov @r1,r3");
-#else
asm ("mov %S1,%S0; mov %R1,%R0" : "=&r" (r) : "m" (d));
-#endif
return r;
}
===================================================================
@@ -1,8 +1,9 @@
/* { dg-do compile { target "sh-*-*" } } */
-/* { dg-options "-O0 -m4 -ml" } */
+/* { dg-options "-O0" } */
+/* { dg-skip-if "" { "sh*-*-*" } "-mb" "" } */
/* { dg-final { scan-assembler-not "add\tr0,r0" } } */
-/* This test checks that chain reloads conflict. I they don't
+/* This test checks chain reloads conflicts. If they don't
conflict, the same hard register R0 is used for the both reloads
but in this case the second reload needs an intermediate register
(which is the reload register). As the result we have the
===================================================================
@@ -417,8 +417,24 @@
#define SH_DIV_STR_FOR_SIZE "call"
#endif
-#define DRIVER_SELF_SPECS "%{m2a:%{ml:%eSH2a does not support little-endian}}"
+/* SH2A does not support little-endian. Catch such combinations
+ taking into account the default configuration. */
+#if TARGET_ENDIAN_DEFAULT == MASK_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN_OPTION "%{ml:"
+#else
+#define IS_LITTLE_ENDIAN_OPTION "%{!mb:"
+#endif
+
+#if TARGET_CPU_DEFAULT & MASK_HARD_SH2A
+#define UNSUPPORTED_SH2A IS_LITTLE_ENDIAN_OPTION \
+"%{m2a*|!m1:%{!m2*:%{!m3*:%{!m4*:{!m5*:%eSH2a does not support little-endian}}}}}}"
+#else
+#define UNSUPPORTED_SH2A IS_LITTLE_ENDIAN_OPTION \
+"%{m2a*:%eSH2a does not support little-endian}}"
+#endif
+#define DRIVER_SELF_SPECS UNSUPPORTED_SH2A
+
#define ASSEMBLER_DIALECT assembler_dialect
extern int assembler_dialect;