dwarf2out.c (expand_builtin_dwarf_reg_size): Fix to work with more than three size ranges.

* dwarf2out.c (expand_builtin_dwarf_reg_size): Fix to work
	with more than three size ranges.
	* flow.c (sbitmap_copy): Use bcopy to copy bitmap.
	* rtl.c (mode_name): Add a null string at the end of the array.
	(mode_wider_mode): Change type to unsigned char.
	(mode_mask_array): New variable.
 	(init_rtl): Update for mode_wider_mode type change.
	* rtl.h (mode_wider_mode): Change type to unsigned char.
	(mode_mask_array): Declare.
	(GET_MODE_MASK): Use mode_mask_array.

From-SVN: r22717
This commit is contained in:
John Carr 1998-10-01 16:47:41 +00:00 committed by John Carr
parent 3ce1534782
commit 913f68c116
5 changed files with 51 additions and 28 deletions

View File

@ -1,3 +1,19 @@
Thu Oct 1 19:20:09 1998 John Carr <jfc@mit.edu>
* dwarf2out.c (expand_builtin_dwarf_reg_size): Fix to work
with more than three size ranges.
* flow.c (sbitmap_copy): Use bcopy to copy bitmap.
* rtl.c (mode_name): Add a null string at the end of the array.
(mode_wider_mode): Change type to unsigned char.
(mode_mask_array): New variable.
(init_rtl): Update for mode_wider_mode type change.
* rtl.h (mode_wider_mode): Change type to unsigned char.
(mode_mask_array): Declare.
(GET_MODE_MASK): Use mode_mask_array.
Thu Oct 1 15:56:01 1998 Gavin Romig-Koch <gavin@cygnus.com>
* calls.c (expand_call) : Encapsulate code into

View File

@ -642,24 +642,26 @@ expand_builtin_dwarf_reg_size (reg_tree, target)
}
else
{
int last_end = 100;
--n_ranges;
t = build_int_2 (ranges[n_ranges].size, 0);
size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
for (; n_ranges--; )
do
{
if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end)
- DWARF_FRAME_REGNUM (ranges[n_ranges].beg))
!= ranges[n_ranges].end - ranges[n_ranges].beg)
int beg = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
int end = DWARF_FRAME_REGNUM (ranges[n_ranges].end);
if (beg < 0)
continue;
if (end >= last_end)
abort ();
if (DWARF_FRAME_REGNUM (ranges[n_ranges].beg) >= size)
last_end = end;
if (end - beg != ranges[n_ranges].end - ranges[n_ranges].beg)
abort ();
size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
build_int_2 (DWARF_FRAME_REGNUM
(ranges[n_ranges].end), 0)));
build_int_2 (end, 0)));
t = fold (build (COND_EXPR, integer_type_node, t2,
build_int_2 (ranges[n_ranges].size, 0), t));
}
while (--n_ranges > 0);
}
return expand_expr (t, target, Pmode, 0);
}

View File

@ -3605,13 +3605,7 @@ void
sbitmap_copy (dst, src)
sbitmap dst, src;
{
int i;
sbitmap_ptr d,s;
s = src->elms;
d = dst->elms;
for (i = 0; i < dst->size; i++)
*d++ = *s++;
bcopy (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
}
/* Zero all elements in a bitmap. */

View File

@ -196,14 +196,14 @@ extern int mode_unit_size[];
/* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */
#define GET_MODE_MASK(MODE) \
((GET_MODE_BITSIZE (MODE) >= HOST_BITS_PER_WIDE_INT) \
?(HOST_WIDE_INT) ~0 : (((HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (MODE)) - 1))
extern const unsigned HOST_WIDE_INT mode_mask_array[];
#define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
extern enum machine_mode mode_wider_mode[];
#define GET_MODE_WIDER_MODE(MODE) (mode_wider_mode[(int) (MODE)])
extern unsigned char mode_wider_mode[];
#define GET_MODE_WIDER_MODE(MODE) ((enum machine_mode)mode_wider_mode[(int) (MODE)])
/* Return the mode for data of a given size SIZE and mode class CLASS.
If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.

View File

@ -58,13 +58,15 @@ char *rtx_name[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) NAME,
char *mode_name[(int) MAX_MACHINE_MODE] = {
char *mode_name[(int) MAX_MACHINE_MODE + 1] = {
#include "machmode.def"
#ifdef EXTRA_CC_MODES
EXTRA_CC_NAMES
EXTRA_CC_NAMES,
#endif
/* Add an extra field to avoid a core dump if someone tries to convert
MAX_MACHINE_MODE to a string. */
""
};
#undef DEF_MACHMODE
@ -107,14 +109,23 @@ int mode_unit_size[(int) MAX_MACHINE_MODE] = {
use this. */
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) \
(enum machine_mode) WIDER,
(unsigned char) WIDER,
enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = {
unsigned char mode_wider_mode[(int) MAX_MACHINE_MODE] = {
#include "machmode.def" /* machine modes are documented here */
};
#undef DEF_MACHMODE
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) \
((SIZE) * BITS_PER_UNIT >= HOST_BITS_PER_WIDE_INT) ? ~(unsigned HOST_WIDE_INT)0 : ((unsigned HOST_WIDE_INT) 1 << (SIZE) * BITS_PER_UNIT) - 1,
/* Indexed by machine mode, gives mask of significant bits in mode. */
const unsigned HOST_WIDE_INT mode_mask_array[(int) MAX_MACHINE_MODE] = {
#include "machmode.def"
};
/* Indexed by mode class, gives the narrowest mode for each class. */
enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS];
@ -892,8 +903,8 @@ init_rtl ()
mode_class[i] = MODE_CC;
mode_size[i] = mode_size[(int) CCmode];
mode_unit_size[i] = mode_unit_size[(int) CCmode];
mode_wider_mode[i - 1] = (enum machine_mode) i;
mode_wider_mode[i] = VOIDmode;
mode_wider_mode[i - 1] = i;
mode_wider_mode[i] = (unsigned char)VOIDmode;
}
#endif