This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cross target report on gcc 3.1-20020423 (i960)
- From: Jim Wilson <wilson at redhat dot com>
- To: joel dot sherrill at OARcorp dot com
- Cc: gcc at gcc dot gnu dot org
- Date: 07 May 2002 17:02:02 -0400
- Subject: Re: cross target report on gcc 3.1-20020423 (i960)
- References: <3CC80A02.7509839@OARcorp.com><xwuofg6m09a.fsf@tonopah.toronto.redhat.com><3CCAB86C.1055799@OARcorp.com>
I tried some i960 builds yesterday. I'm using a recently checked out
uberbaum tree.
I tried the i960-elf build first. It dies while building newlib with a
gas abort. The file is newlib/libc/stdio/vfprintf.c. The abort is in
cvt_frag_to_fill in write.c. There is a call to relax_cobr which converts
an out-of-range compare-and-branch insn into a compare insn and a branch insn.
Then we return and fail a consistency check because fr_address + fr_fix !=
fr_next->fr_address. I don't know what the problem is. It will take a
little time to investigate.
I tried the i960-coff build next. It fails in libobjc sendmsg.c same as
your build. I got a little carried away discussing enabling/disabling
languages in my last message. We can't do that, but we can disable
individual libraries. The only choice here is to build something that won't
work, or to not build it, so it seems reasonable to not build it. To get it
working, we need an Objective C maintainer to make changes to support long
double properly.
The build then next fails in libffi. libffi does a link test to prove that
the compiler works, but the link fails with a crt0.o not found message.
This is because FLAGS_FOR_TARGET does not have any libgloss support, and
crt0.o is in libgloss. Either libffi shouldn't be doing a link test, or else
we need to add in libgloss support to FLAGS_FOR_TARGET. I didn't want to
deal with this problem, so I disabled libffi.
The build then next fails in boehm-gc. The file include/private/gcconfig.h
does not support i960. I don't know what is involved with adding it, and
probably don't have time to do it, so I just disabled boehm-gc.
The build then next fails in libjava. We hit an abort in c_readstr as called
from store_by_pieces via builtin_memcpy_read_str. This one is a serious
problem. The problem here is that we are trying to optimize memcpy/strcpy
of a constant string by using store-immediate instructions. Unfortunately,
c_readstr only supports constants up to twice the word size. i960 has
instructions to load/move/store 4 registers (16 bytes) at a time. These
instructions use TImode. Constant strings get 16 byte alignment so that
we can use these instructions. So store_by_pieces tries to move 16-bytes
at a time, and c_readstr aborts because a CONST_DOUBLE can hold at most 8
bytes. These i960 instructions don't take immediates larger than 5 bits,
so this is wasted effort, but it isn't immediately obvious how to fix this.
There is an existing testcase gcc.c-torture/execute/20000703-1.c that
reproduces the problem. To reproduce the problem, all you have to do is
take a program that calls strcpy/memcpy with a constant string 15 characters
or longer and compile it with optimization. I'll file a PR for this.
If I disable libjava, the build completes. Since I've now disabled 3 of the
6 java libraries, and since most targets already disable the java libraries,
it makes sense to disable all of them. Thus I'm proposing this as a patch
to get the i960-coff toolchain building.
2002-05-07 Jim Wilson <wilson@redhat.com>
* configure.in (i960-*-*): Disable libobjc and ${libgcj}.
Index: configure.in
===================================================================
RCS file: /cvs/uberbaum/configure.in,v
retrieving revision 1.134
diff -p -r1.134 configure.in
*** configure.in 26 Apr 2002 22:30:19 -0000 1.134
--- configure.in 7 May 2002 20:58:37 -0000
*************** case "${target}" in
*** 912,917 ****
--- 912,930 ----
i[3456]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
+ i960-*-*)
+ # - libobjc doesn't build because encoding.c uses ROUND_TYPE_ALIGN and
+ # ROUND_TYPE_SIZE, but doesn't have any way to handle XFmode.
+ # - libffi doesn't build because it does a link to test the compiler, and
+ # the link fails because crt0.o in in libgloss, and FLASG_FOR_TARGET has no
+ # libgloss support.
+ # - boehm-gc fails because include/private/gcconfig.h does not support
+ # i960 as a valid machine type.
+ # - libjava build fails in c_readstr in builtins.c with mode TImode.
+ # c_readstr only handles modes up to twice the word size. c_readstr was
+ # called from store_by_pieces via builtin_memcpy_read_str.
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+ ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
;;