This is the mail archive of the gcc@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]

libgcc2 and MIN_UNITS_PER_WORD on ia64


I'm confused about code in libgcc2.h that changes the mode used for
some functions based on MIN_UNITS_PER_WORD.

When I built a cross compiler with host i686-pc-linux-gnu and target
ia64-linux, the libgcc2.c compile failed because it tried to use mode
TI, which is not supported on a 32-bit host.  There is code in
libgcc2.h to use mode TI rather than mode DI in some cases if
MIN_UNITS_PER_WORD (which defaults to UNITS_PER_WORD) is greater than
four.

I am able to build a cross compiler, and also to bootstrap and test a
native ia64-linux compiler (with the 20010312 snapshot) with the
following changes:

1) In gcc/config/ia64/ia64.h, define MIN_UNITS_PER_WORD to be 4 if
   IN_LIBGCC2.

2) In gcc/config/ia64/t-ia64, change the names of the div and mod
   functions in LIB1ASMFUNCS to use one underscore rather than two, and
   in gcc/config/ia64/lib1funcs.asm change the corresponding L_*
   symbols.  After these files were added there was a change to mklibgcc
   to remove function names from LIB2FUNCS that are in LIB1ASMFUNCS.
   Currently the duplicates end up having different names because of the
   mode change in libgcc2.h, but the lib2gcc versions aren't needed.
   With MIN_UNITS_PER_WORD defined to be 8, there are duplicate
   functions (in different .o files) so the the link of libgcc.a fails.

What's the purpose of changing the mode in libgcc2.h? The ia64 compiler
doesn't appear to need mode TI functions in libgcc; what architectures
do need this?  Is MIN_UNITS_PER_WORD the correct value on which to base
the change of modes?

If these changes are appropriate then I can submit a patch, but I'm
waiting for blanket approval from IBM lawyers for submitting ia64 GCC
patches so it might be awhile.

On a related note, libgcc1-test seems useful, but it hasn't been updated
for years and doesn't include tests for long or long long, and doesn't
include tests for the fix* functions or some of the other functions that
can appear in libgcc.

Janis


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