Commit 913f68c1 by John Carr Committed by John Carr

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
parent 3ce15347
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> Thu Oct 1 15:56:01 1998 Gavin Romig-Koch <gavin@cygnus.com>
* calls.c (expand_call) : Encapsulate code into * calls.c (expand_call) : Encapsulate code into
......
...@@ -642,24 +642,26 @@ expand_builtin_dwarf_reg_size (reg_tree, target) ...@@ -642,24 +642,26 @@ expand_builtin_dwarf_reg_size (reg_tree, target)
} }
else else
{ {
int last_end = 100;
--n_ranges; --n_ranges;
t = build_int_2 (ranges[n_ranges].size, 0); t = build_int_2 (ranges[n_ranges].size, 0);
size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg); do
for (; n_ranges--; )
{ {
if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end) int beg = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
- DWARF_FRAME_REGNUM (ranges[n_ranges].beg)) int end = DWARF_FRAME_REGNUM (ranges[n_ranges].end);
!= ranges[n_ranges].end - ranges[n_ranges].beg) if (beg < 0)
continue;
if (end >= last_end)
abort (); 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 (); abort ();
size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
t2 = fold (build (LE_EXPR, integer_type_node, reg_tree, t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
build_int_2 (DWARF_FRAME_REGNUM build_int_2 (end, 0)));
(ranges[n_ranges].end), 0)));
t = fold (build (COND_EXPR, integer_type_node, t2, t = fold (build (COND_EXPR, integer_type_node, t2,
build_int_2 (ranges[n_ranges].size, 0), t)); build_int_2 (ranges[n_ranges].size, 0), t));
} }
while (--n_ranges > 0);
} }
return expand_expr (t, target, Pmode, 0); return expand_expr (t, target, Pmode, 0);
} }
......
...@@ -3605,13 +3605,7 @@ void ...@@ -3605,13 +3605,7 @@ void
sbitmap_copy (dst, src) sbitmap_copy (dst, src)
sbitmap dst, src; sbitmap dst, src;
{ {
int i; bcopy (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
sbitmap_ptr d,s;
s = src->elms;
d = dst->elms;
for (i = 0; i < dst->size; i++)
*d++ = *s++;
} }
/* Zero all elements in a bitmap. */ /* Zero all elements in a bitmap. */
......
...@@ -196,14 +196,14 @@ extern int mode_unit_size[]; ...@@ -196,14 +196,14 @@ extern int mode_unit_size[];
/* Get a bitmask containing 1 for all bits in a word /* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */ that fit within mode MODE. */
#define GET_MODE_MASK(MODE) \ extern const unsigned HOST_WIDE_INT mode_mask_array[];
((GET_MODE_BITSIZE (MODE) >= HOST_BITS_PER_WIDE_INT) \
?(HOST_WIDE_INT) ~0 : (((HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (MODE)) - 1)) #define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */ /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
extern enum machine_mode mode_wider_mode[]; extern unsigned char mode_wider_mode[];
#define GET_MODE_WIDER_MODE(MODE) (mode_wider_mode[(int) (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. /* 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. If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
......
...@@ -58,13 +58,15 @@ char *rtx_name[] = { ...@@ -58,13 +58,15 @@ char *rtx_name[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) 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" #include "machmode.def"
#ifdef EXTRA_CC_MODES #ifdef EXTRA_CC_MODES
EXTRA_CC_NAMES EXTRA_CC_NAMES,
#endif #endif
/* Add an extra field to avoid a core dump if someone tries to convert
MAX_MACHINE_MODE to a string. */
""
}; };
#undef DEF_MACHMODE #undef DEF_MACHMODE
...@@ -107,14 +109,23 @@ int mode_unit_size[(int) MAX_MACHINE_MODE] = { ...@@ -107,14 +109,23 @@ int mode_unit_size[(int) MAX_MACHINE_MODE] = {
use this. */ use this. */
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) \ #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 */ #include "machmode.def" /* machine modes are documented here */
}; };
#undef DEF_MACHMODE #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. */ /* Indexed by mode class, gives the narrowest mode for each class. */
enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS]; enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS];
...@@ -892,8 +903,8 @@ init_rtl () ...@@ -892,8 +903,8 @@ init_rtl ()
mode_class[i] = MODE_CC; mode_class[i] = MODE_CC;
mode_size[i] = mode_size[(int) CCmode]; mode_size[i] = mode_size[(int) CCmode];
mode_unit_size[i] = mode_unit_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 - 1] = i;
mode_wider_mode[i] = VOIDmode; mode_wider_mode[i] = (unsigned char)VOIDmode;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment