This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

GNU-Toolchain for Hitachi H8/300H Problems/Bugs?


Hi !
I am trying to generate a tool chain for a Hitachi H8/300h 
microcontroller from a PC Linux system.
The Versions used are as suggested by the CrossGCC-FAQ
(www.objsw.com/CrossGCC): binutils-2.9.1, gcc-2.8.1 (with the 
patch cross-gcc-2.8.1.patch applied), newlib-1.8.1. 
The configuration used is: 
host=i686-pc-linux-gnu
target=h8300-hms
prefix=/home/hjd/GNU-Tools/Cross-gcc
i=$prefix/bin

This is what happens:

- building the binutils poses no problem.

- building the gcc according to the FAQ also seems to succed: A 
simple program for flashing a LED works (no crt0 or library used).

- when building newlib the following errors occur, which might be 
due to problems in the compiler sources:

a) during compiling newlib-1.8.1/newlib/libm/math/ef_mod.c a 
compiler error occurs. Looking at the assembler output of the 
compile there were 2 lines where the instructions were not 
seperated by a newline like:
	mov.b	r4l,r4hn	mov.b	r5h,r4l
In line 2341 of gcc-2.8.1/config/h8300/h8300.c appearently there is 
a backslash missing so the above result is obtained. Changing this 
Line from
*assembler_p = "mov.b\t%y0,%z0n\tmov.b ... to
*assembler_p = "mov.b\t%y0,%z0\n\tmov.b ... seems to solve the 
problem.


b) during the same make when compiling 
newlib/libm/math/ef_hypot.c I got:
"h8300-hms-gcc: Internal compiler error: program cc1 got fatal 
signal 6"
The command line from make was:
h8300-hms-gcc -g -O2  -O2 -DSMALL_DTOA -DSMALL_MEMORY -
fno-builtin -I/home/hjd/GNU-Tools/build-newlib/h8300-
hms/newlib/./targ-include -I/home/hjd/GNU-Tools/newlib-
1.8.1/newlib/./libc/include -c ../../../../../newlib-
1.8.1/newlib/libm/math/ef_hypot.c

Line 79 of ef_hypod.c says:
    SET_FLOAT_WORD(t1,0x3f800000L+(k<<23));
When I remove this line or remove only the k<<23 part of it the built 
of newlib completes (so probably no more errors).
SET_FLOAT_WORD is a macro defined in fdlibm.h., the union 
ieee_float_shape_type is also defined there:

typedef union
{
  float value;
  __uint32_t word;
} ieee_float_shape_type;

/* Get a 32 bit int from a float.  */

#define SET_FLOAT_WORD(d,i)					\
do {								\
  ieee_float_shape_type sf_u;					\
  sf_u.word = (i);						\
  (d) = sf_u.value;						\
} while (0)


I tried to calculate k<<23 before passing it to the macro (with 
auxilliary varables and even using multiplication), but the error 
occurs anyway. What is going on here ?
Is maybe a hint in warnings which were issued during the built of the 
gcc compiler which were like:
../gcc-2.8.1/libgcc2.c:2458: warning: cast to pointer from integer of 
different size
../gcc-2.8.1/libgcc2.c:899: warning: left shift count >= width of type
../gcc-2.8.1/libgcc2.c:2592: warning: large integer implicitly 
truncated to unsigned type
Maybe something with the configuration and the size of variables and
regiesters ?

When trying to compile without the Optimization -O2 -O2 (as during 
make) the compiler succeeds. So I used this as a manual 
workaround (the error occurs two times, first as described above 
and second when the lib is built with the -mips32 option for 32-bit 
integers).


Did anybody build the same particular toolchain or has an idea of 
what the problem is and how it can be solved ? Is the way I worked 
around them ok, or are there additional problems ?

Thanks,

Hansjuergen


__________________________________________________________________________
Dr. Hansjuergen Dreuth
Simplify Technologies GmbH, Tulpenweg 2, D-35630 Ehringshausen, Germany
Tel.: (+49) (0)6443-811712, FAX: (+49) (0)6443-811716
Email: hansjuergen.dreuth@simplify-technologies.de
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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