dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Do not initialize fields past the register table.

* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Do not initialize
	fields past the register table.

	* i386.c (classify_argument): Properly handle base classes.

From-SVN: r54246
This commit is contained in:
Jan Hubicka 2002-06-04 18:20:30 +02:00 committed by Jan Hubicka
parent dd79d77593
commit 3b6a3a3c16
3 changed files with 71 additions and 8 deletions

View File

@ -1,3 +1,10 @@
Tue Jun 4 18:16:50 CEST 2002 Jan Hubicka <jh@suse.cz>
* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Do not initialize
fields past the register table.
* i386.c (classify_argument): Properly handle base classes.
Tue Jun 4 13:09:18 CEST 2002 Jan Hubicka <jh@suse.cz>
* loop.c (emit_prefetch_instructions): Properly place the address

View File

@ -1675,6 +1675,34 @@ classify_argument (mode, type, classes, bit_offset)
/* Classify each field of record and merge classes. */
if (TREE_CODE (type) == RECORD_TYPE)
{
/* For classes first merge in the field of the subclasses. */
if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL)
{
tree bases = TYPE_BINFO_BASETYPES (type);
int n_bases = TREE_VEC_LENGTH (bases);
int i;
for (i = 0; i < n_bases; ++i)
{
tree binfo = TREE_VEC_ELT (bases, i);
int num;
int offset = tree_low_cst (BINFO_OFFSET (binfo), 0) * 8;
tree type = BINFO_TYPE (binfo);
num = classify_argument (TYPE_MODE (type),
type, subclasses,
(offset + bit_offset) % 256);
if (!num)
return 0;
for (i = 0; i < num; i++)
{
int pos = (offset + bit_offset) / 8 / 8;
classes[i + pos] =
merge_classes (subclasses[i], classes[i + pos]);
}
}
}
/* And now merge the fields of structure. */
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)
@ -1735,6 +1763,33 @@ classify_argument (mode, type, classes, bit_offset)
else if (TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE)
{
/* For classes first merge in the field of the subclasses. */
if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL)
{
tree bases = TYPE_BINFO_BASETYPES (type);
int n_bases = TREE_VEC_LENGTH (bases);
int i;
for (i = 0; i < n_bases; ++i)
{
tree binfo = TREE_VEC_ELT (bases, i);
int num;
int offset = tree_low_cst (BINFO_OFFSET (binfo), 0) * 8;
tree type = BINFO_TYPE (binfo);
num = classify_argument (TYPE_MODE (type),
type, subclasses,
(offset + bit_offset) % 256);
if (!num)
return 0;
for (i = 0; i < num; i++)
{
int pos = (offset + bit_offset) / 8 / 8;
classes[i + pos] =
merge_classes (subclasses[i], classes[i + pos]);
}
}
}
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
if (TREE_CODE (field) == FIELD_DECL)

View File

@ -417,16 +417,17 @@ expand_builtin_init_dwarf_reg_sizes (address)
rtx addr = expand_expr (address, NULL_RTX, VOIDmode, 0);
rtx mem = gen_rtx_MEM (BLKmode, addr);
for (i = 0; i < DWARF_FRAME_REGISTERS; i++)
{
HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS)
{
HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
if (offset < 0)
continue;
if (offset < 0)
continue;
emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
}
emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
}
}
/* Convert a DWARF call frame info. operation to its string name */