init_integral_libfuncs change breaks xstormy16

DJ Delorie dj@redhat.com
Fri Mar 21 05:30:00 GMT 2003


This patch breaks xstormy16 - "word_mode" is 16 bits so libfuncs like
__ashldi3 don't get enabled any more.

2003-02-09  Richard Henderson  <rth@redhat.com>

        * optabs.c (init_integral_libfuncs): Don't hard-code SImode and
        TImode; select word_mode and twice that.
        (init_floating_libfuncs): Don't hard-code SFmode and TFmode;
        select the modes from float, double, and long double.
        (init_optabs): Remove duplicate initializations.

Perhaps we should ensure that at least 64 bit modes are included,
like this untested patch?

Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.167
diff -p -2 -r1.167 optabs.c
*** optabs.c	9 Mar 2003 01:32:42 -0000	1.167
--- optabs.c	21 Mar 2003 05:00:35 -0000
*************** init_integral_libfuncs (optable, opname,
*** 5345,5350 ****
       int suffix;
  {
    init_libfuncs (optable, word_mode,
! 		 mode_for_size (2*BITS_PER_WORD, MODE_INT, 0),
  		 opname, suffix);
  }
--- 5345,5353 ----
       int suffix;
  {
+   int maxsize = 2*BITS_PER_WORD;
+   if (maxsize < LONG_LONG_TYPE_SIZE)
+     maxsize = LONG_LONG_TYPE_SIZE;
    init_libfuncs (optable, word_mode,
! 		 mode_for_size (maxsize, MODE_INT, 0),
  		 opname, suffix);
  }



More information about the Gcc-patches mailing list