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]

[PATCH] sh64-unknown-linux-gnu build failure (Was: Re: [patch] sh:Move predicates to predicates.md. (take 2))


> I've tried to test x86 cross sh64-linux,
> but the genuine CVS (May 30 21:43:42 UTC) failed to build:
> 
> /ext3/suzaku/home/kkojima/xsh-gcc-orig/./gcc/xgcc -B/ext3/suzaku/home/kkojima/xsh-gcc-orig/./gcc/ -B/usr/local/sh64-unknown-linux-gnu/bin/ -B/usr/local/sh64-unknown-linux-gnu/lib/ -isystem /usr/local/sh64-unknown-linux-gnu/include -isystem /usr/local/sh64-unknown-linux-gnu/sys-include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fpic -DNO_FPSCR_VALUES -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../ORIG/gcc/gcc -I../../ORIG/gcc/gcc/. -I../../ORIG/gcc/gcc/../include -I../../ORIG/gcc/gcc/../libcpp/include  -DL_udivmoddi4 -fvisibility=hidden -DHIDE_EXPORTS -fexceptions -fnon-call-exceptions -c ../../ORIG/gcc/gcc/libgcc2.c -o libgcc/./_udivmoddi4.o
> ../../ORIG/gcc/gcc/libgcc2.c: In function '__udivmoddi4':
> ../../ORIG/gcc/gcc/libgcc2.c:1037: error: unrecognizable insn:
> (insn 787 786 788 16 ../../ORIG/gcc/gcc/libgcc2.c:904 (set (reg:SI 131 tr3)
>         (plus:SI (reg:SI 131 tr3)
>             (reg:SI 12 r12))) -1 (nil)
>     (nil))
> ../../ORIG/gcc/gcc/libgcc2.c:1037: internal compiler error: in extract_insn, at recog.c:2082
> 
> I'm in binary searching to see when it started.

Although I suspect that there is another problem about this ICE,
I've found that the .opt transition

http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01471.html

changes TARGET_FPU_DOUBLE so to fail for SHmedia.  The patch has
the following hunk:

--
 /* Nonzero if a double-precision FPU is available.  */
-#define TARGET_FPU_DOUBLE ((target_flags & SH4_BIT) || TARGET_SH2A_DOUBLE)
+#define TARGET_FPU_DOUBLE (TARGET_SH4 || TARGET_SH2A_DOUBLE)
 
 /* Nonzero if an FPU is available.  */
 #define TARGET_FPU_ANY (TARGET_SH2E || TARGET_FPU_DOUBLE)
 
 /* Nonzero if we should generate code using type 4 insns.  */
-#define TARGET_SH4 ((target_flags & SH4_BIT) && (target_flags & SH1_BIT))
+#undef TARGET_SH4
+#define TARGET_SH4 ((target_flags & MASK_SH4) != 0 && TARGET_SH1)
--

and TARGET_FPU_DOUBLE is now expanded to

(((target_flags & MASK_SH4) != 0 && (target_flags & MASK_SH1) != 0)
 || ((target_flags & MASK_HARD_SH2A_DOUBLE) != 0)
     && ((target_flags & MASK_HARD_SH2A) != 0))

which doesn't stand for SHmedia.  The appended patch restores
the original TARGET_FPU_DOUBLE and gets rid of the build failure
for x86 cross sh64-unknown-linux-gnu on mainline anyway.
Tested also with "make -k check" with no new failures for x86 cross
sh4-unknown-linux-gnu.  Ok for mainline if it's successfully tested
on native sh4-unknown-linux-gnu?

Regards,
	kaz
--
2005-06-01  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.h (TARGET_FPU_DOUBLE): Use MASK_SH4.

diff -up ORIG/gcc/gcc/config/sh/sh.h LOCAL/gcc/gcc/config/sh/sh.h
--- ORIG/gcc/gcc/config/sh/sh.h	2005-05-19 06:09:36.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.h	2005-06-01 14:22:22.878031617 +0900
@@ -174,7 +174,8 @@ do { \
 #define TARGET_HARVARD (TARGET_HARD_SH4 || TARGET_SH5)
 
 /* Nonzero if a double-precision FPU is available.  */
-#define TARGET_FPU_DOUBLE (TARGET_SH4 || TARGET_SH2A_DOUBLE)
+#define TARGET_FPU_DOUBLE \
+  ((target_flags & MASK_SH4) != 0 || TARGET_SH2A_DOUBLE)
 
 /* Nonzero if an FPU is available.  */
 #define TARGET_FPU_ANY (TARGET_SH2E || TARGET_FPU_DOUBLE)


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