]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/50694 (SH Target: SH2A little endian does not actually work)
authorOleg Endo <oleg.endo@t-online.de>
Sun, 13 Nov 2011 23:00:10 +0000 (23:00 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Sun, 13 Nov 2011 23:00:10 +0000 (23:00 +0000)
PR target/50694
* config/sh/sh.h (IS_LITTLE_ENDIAN_OPTION, UNSUPPORTED_SH2A):
New macros.
(DRIVER_SELF_SPECS): Use new macros to filter out
unsupported options taking the default configuration into
account.
* gcc.target/sh/pr21255-2-ml.c: Skip if -mb or -m5* is
specified.  Remove redundant runtime checks.
* gcc.target/sh/20080410-1.c: Skip if -mb is specified.
Allow for other than -m4.  Fix typos in comments.

From-SVN: r181340

gcc/ChangeLog
gcc/config/sh/sh.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/20080410-1.c
gcc/testsuite/gcc.target/sh/pr21255-2-ml.c

index 2108c87aac32c97c60eb492d7dec7b67ec38778f..e58ef3216b6ce2cea960e60b72a12011610daeb2 100644 (file)
@@ -1,3 +1,12 @@
+2011-11-13  Oleg Endo  <oleg.endo@t-online.de>
+
+       PR target/50694
+       * config/sh/sh.h (IS_LITTLE_ENDIAN_OPTION, UNSUPPORTED_SH2A):
+       New macros.
+       (DRIVER_SELF_SPECS): Use new macros to filter out
+       unsupported options taking the default configuration into
+       account.
+
 2011-11-13  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * doc/install.texi (Specific): Fix anchor for
index cc26e05a7642d993e03b617211a85be394183486..1b98745866e594fde24fbfa9303314def703df52 100644 (file)
@@ -417,7 +417,23 @@ do { \
 #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
 
index 4c4460310efc7ac7f87c6c7f97c670e8fe598101..7fa24e782bbc4cd91971dae684ba5fd79bfd8d3d 100644 (file)
@@ -1,3 +1,10 @@
+2011-11-13  Oleg Endo  <oleg.endo@t-online.de>
+
+       * gcc.target/sh/pr21255-2-ml.c: Skip if -mb or -m5* is
+       specified.  Remove redundant runtime checks.
+       * gcc.target/sh/20080410-1.c: Skip if -mb is specified.
+       Allow for other than -m4.  Fix typos in comments.
+
 2011-11-12  Jason Merrill  <jason@redhat.com>
 
        PR c++/986
index 0ba7792c0780140898ddf83cafe6138a795c90f2..63e517e94d581ba0e0ee7b8fc4ce39451f9d7c11 100644 (file)
@@ -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
index c63a573ea9d95142d5245958341ef1b035ea275c..570e7dd0b50c99bc34f976b1479ce81b55d70c7f 100644 (file)
@@ -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 @@ double
 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;
 }