defaults.h (UNALIGNED_SHORT_ASM_OP, [...]): Move from ...

* defaults.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
	UNALIGNED_DOUBLE_INT_ASM_OP, ASM_BYTE_OP): Move from ...
	* dwarf2asm.c: ... here.
	* dwarfout.c: Remove them.

	* varasm.c (assemble_integer): Add align parameter.
	(assemble_real, output_constant, output_constructor): Likewise.
	* output.h: Update decls.
	* dwarf2asm.c, final.c, varasm.c, config/darwin.c, config/nextstep.c,
	config/alpha/alpha.c, config/arm/arm.md, config/clipper/clipper.c,
	config/m88k/m88k.c, config/mcore/mcore.md, config/mips/mips.h,
	config/mips/mips.md, config/pa/pa.c, config/rs6000/rs6000.c,
	config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.md:
	Update all callers.

	* final.c (end_final): Abort profile block generation if we
	havn't layed it out properly.
	* output.h (assemble_eh_integer): Remove stale decl.
	* varasm.c (assemble_zeros): Tidy; use assemble_integer.
	(min_align): New.
	(assemble_integer): Handle unaligned data.
	(assemble_real): Abort on unaligned data.
	(output_constructor): Don't assume ASM_OUTPUT_ALIGN 0 does
	anything useful.
	(default_dtor_section_asm_out_destructor): Use assemble_align.
	(default_named_section_asm_out_constructor): Likewise.
	(default_ctor_section_asm_out_constructor): Likewise.
	* config/darwin.c (machopic_asm_out_constructor): Likewise.
	(machopic_asm_out_destructor): Likewise.
	* config/nextstep.c (nextstep_asm_out_constructor): Likewise.
	(nextstep_asm_out_destructor): Likewise.
	* config/alpha/alpha.c (vms_asm_out_constructor): Likewise.
	(vms_asm_out_destructor): Likewise.

        * java/class.c (emit_register_classes): Add align parameter to
        call to assemble_integer.

From-SVN: r44992
This commit is contained in:
Richard Henderson 2001-08-17 17:53:20 -07:00 committed by Richard Henderson
parent 920ae24b35
commit c8af3574e3
23 changed files with 374 additions and 261 deletions

View File

@ -1,3 +1,39 @@
2001-08-17 Richard Henderson <rth@redhat.com>
* defaults.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP,
UNALIGNED_DOUBLE_INT_ASM_OP, ASM_BYTE_OP): Move from ...
* dwarf2asm.c: ... here.
* dwarfout.c: Remove them.
* varasm.c (assemble_integer): Add align parameter.
(assemble_real, output_constant, output_constructor): Likewise.
* output.h: Update decls.
* dwarf2asm.c, final.c, varasm.c, config/darwin.c, config/nextstep.c,
config/alpha/alpha.c, config/arm/arm.md, config/clipper/clipper.c,
config/m88k/m88k.c, config/mcore/mcore.md, config/mips/mips.h,
config/mips/mips.md, config/pa/pa.c, config/rs6000/rs6000.c,
config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.md:
Update all callers.
* final.c (end_final): Abort profile block generation if we
havn't layed it out properly.
* output.h (assemble_eh_integer): Remove stale decl.
* varasm.c (assemble_zeros): Tidy; use assemble_integer.
(min_align): New.
(assemble_integer): Handle unaligned data.
(assemble_real): Abort on unaligned data.
(output_constructor): Don't assume ASM_OUTPUT_ALIGN 0 does
anything useful.
(default_dtor_section_asm_out_destructor): Use assemble_align.
(default_named_section_asm_out_constructor): Likewise.
(default_ctor_section_asm_out_constructor): Likewise.
* config/darwin.c (machopic_asm_out_constructor): Likewise.
(machopic_asm_out_destructor): Likewise.
* config/nextstep.c (nextstep_asm_out_constructor): Likewise.
(nextstep_asm_out_destructor): Likewise.
* config/alpha/alpha.c (vms_asm_out_constructor): Likewise.
(vms_asm_out_destructor): Likewise.
2001-08-17 Richard Henderson <rth@redhat.com> 2001-08-17 Richard Henderson <rth@redhat.com>
* config/mips/iris6.h (TARGET_IRIX6): New. * config/mips/iris6.h (TARGET_IRIX6): New.

View File

@ -6595,7 +6595,8 @@ vms_asm_out_constructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
ctors_section (); ctors_section ();
assemble_integer (symbol, UNITS_PER_WORD, 1); assemble_align (BITS_PER_WORD);
assemble_integer (symbol, UNITS_PER_WORD, BITS_PER_WORD, 1);
} }
static void static void
@ -6604,7 +6605,8 @@ vms_asm_out_destructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
dtors_section (); dtors_section ();
assemble_integer (symbol, UNITS_PER_WORD, 1); assemble_align (BITS_PER_WORD);
assemble_integer (symbol, UNITS_PER_WORD, BITS_PER_WORD, 1);
} }
#else #else

View File

@ -9064,7 +9064,7 @@
"TARGET_THUMB" "TARGET_THUMB"
"* "*
making_const_table = TRUE; making_const_table = TRUE;
assemble_integer (operands[0], 1, 1); assemble_integer (operands[0], 1, BITS_PER_WORD, 1);
assemble_zeros (3); assemble_zeros (3);
return \"\"; return \"\";
" "
@ -9076,7 +9076,7 @@
"TARGET_THUMB" "TARGET_THUMB"
"* "*
making_const_table = TRUE; making_const_table = TRUE;
assemble_integer (operands[0], 2, 1); assemble_integer (operands[0], 2, BITS_PER_WORD, 1);
assemble_zeros (2); assemble_zeros (2);
return \"\"; return \"\";
" "
@ -9095,11 +9095,11 @@
{ {
union real_extract u; union real_extract u;
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, GET_MODE (operands[0])); assemble_real (u.d, GET_MODE (operands[0]), BITS_PER_WORD);
break; break;
} }
default: default:
assemble_integer (operands[0], 4, 1); assemble_integer (operands[0], 4, BITS_PER_WORD, 1);
break; break;
} }
return \"\"; return \"\";
@ -9119,11 +9119,11 @@
{ {
union real_extract u; union real_extract u;
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, GET_MODE (operands[0])); assemble_real (u.d, GET_MODE (operands[0]), BITS_PER_WORD);
break; break;
} }
default: default:
assemble_integer (operands[0], 8, 1); assemble_integer (operands[0], 8, BITS_PER_WORD, 1);
break; break;
} }
return \"\"; return \"\";

View File

@ -712,6 +712,6 @@ clix_asm_out_destructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
fini_section (); fini_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }

View File

@ -924,10 +924,11 @@ machopic_finish (asm_out_file)
) )
{ {
data_section (); data_section ();
assemble_align (UNITS_PER_WORD * BITS_PER_UNIT); assemble_align (GET_MODE_ALIGNMENT (Pmode));
assemble_label (lazy_name); assemble_label (lazy_name);
assemble_integer (gen_rtx (SYMBOL_REF, Pmode, sym_name), assemble_integer (gen_rtx (SYMBOL_REF, Pmode, sym_name),
GET_MODE_SIZE (Pmode), 1); GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
} }
else else
{ {
@ -939,7 +940,8 @@ machopic_finish (asm_out_file)
assemble_name (asm_out_file, sym_name); assemble_name (asm_out_file, sym_name);
fprintf (asm_out_file, "\n"); fprintf (asm_out_file, "\n");
assemble_integer (const0_rtx, GET_MODE_SIZE (Pmode), 1); assemble_integer (const0_rtx, GET_MODE_SIZE (Pmode),
GET_MODE_ALIGNMENT (Pmode), 1);
} }
} }
} }
@ -1117,7 +1119,8 @@ machopic_asm_out_constructor (symbol, priority)
mod_init_section (); mod_init_section ();
else else
constructor_section (); constructor_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
if (!flag_pic) if (!flag_pic)
fprintf (asm_out_file, ".reference .constructors_used\n"); fprintf (asm_out_file, ".reference .constructors_used\n");
@ -1132,7 +1135,8 @@ machopic_asm_out_destructor (symbol, priority)
mod_term_section (); mod_term_section ();
else else
destructor_section (); destructor_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
if (!flag_pic) if (!flag_pic)
fprintf (asm_out_file, ".reference .destructors_used\n"); fprintf (asm_out_file, ".reference .destructors_used\n");

View File

@ -3311,8 +3311,8 @@ m88k_svr3_asm_out_destructor (symbol, priority)
int i; int i;
fini_section (); fini_section ();
assemble_integer (symbol, UNITS_PER_WORD, 1); assemble_integer (symbol, UNITS_PER_WORD, BITS_PER_WORD, 1);
for (i = 1; i < 4; i++) for (i = 1; i < 4; i++)
assemble_integer (constm1_rtx, UNITS_PER_WORD, 1); assemble_integer (constm1_rtx, UNITS_PER_WORD, BITS_PER_WORD, 1);
} }
#endif #endif

View File

@ -3409,7 +3409,7 @@
"" ""
"* "*
{ {
assemble_integer (operands[0], 4, 1); assemble_integer (operands[0], 4, BITS_PER_WORD, 1);
return \"\"; return \"\";
}" }"
[(set_attr "length" "4")]) [(set_attr "length" "4")])

View File

@ -4304,9 +4304,9 @@ do { \
else \ else \
{ \ { \
assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \ assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \
UNITS_PER_WORD, 1); \ UNITS_PER_WORD, BITS_PER_WORD, 1); \
assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \ assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \
UNITS_PER_WORD, 1); \ UNITS_PER_WORD, BITS_PER_WORD, 1); \
} \ } \
} while (0) } while (0)

View File

@ -10382,7 +10382,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
"TARGET_MIPS16" "TARGET_MIPS16"
"* "*
{ {
assemble_integer (operands[0], 1, 1); assemble_integer (operands[0], 1, BITS_PER_UNIT, 1);
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")
@ -10394,7 +10394,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
"TARGET_MIPS16" "TARGET_MIPS16"
"* "*
{ {
assemble_integer (operands[0], 2, 1); assemble_integer (operands[0], 2, BITS_PER_UNIT * 2, 1);
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")
@ -10406,7 +10406,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
"TARGET_MIPS16" "TARGET_MIPS16"
"* "*
{ {
assemble_integer (operands[0], 4, 1); assemble_integer (operands[0], 4, BITS_PER_UNIT * 4, 1);
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")
@ -10418,7 +10418,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
"TARGET_MIPS16" "TARGET_MIPS16"
"* "*
{ {
assemble_integer (operands[0], 8, 1); assemble_integer (operands[0], 8, BITS_PER_UNIT * 8, 1);
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")
@ -10435,7 +10435,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
if (GET_CODE (operands[0]) != CONST_DOUBLE) if (GET_CODE (operands[0]) != CONST_DOUBLE)
abort (); abort ();
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, SFmode); assemble_real (u.d, SFmode, GET_MODE_ALIGNMENT (SFmode));
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")
@ -10452,7 +10452,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
if (GET_CODE (operands[0]) != CONST_DOUBLE) if (GET_CODE (operands[0]) != CONST_DOUBLE)
abort (); abort ();
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, DFmode); assemble_real (u.d, DFmode, GET_MODE_ALIGNMENT (DFmode));
return \"\"; return \"\";
}" }"
[(set_attr "type" "unknown") [(set_attr "type" "unknown")

View File

@ -96,7 +96,8 @@ nextstep_asm_out_constructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
constructor_section (); constructor_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
fprintf (asm_out_file, ".reference .constructors_used\n"); fprintf (asm_out_file, ".reference .constructors_used\n");
} }
@ -106,7 +107,8 @@ nextstep_asm_out_destructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
destructor_section (); destructor_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
fprintf (asm_out_file, ".reference .destructors_used\n"); fprintf (asm_out_file, ".reference .destructors_used\n");
} }

View File

@ -4377,8 +4377,8 @@ output_deferred_plabels (file)
for (i = 0; i < n_deferred_plabels; i++) for (i = 0; i < n_deferred_plabels; i++)
{ {
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label)); ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (deferred_plabels[i].internal_label));
assemble_integer (gen_rtx_SYMBOL_REF (VOIDmode, assemble_integer (gen_rtx_SYMBOL_REF (Pmode, deferred_plabels[i].name),
deferred_plabels[i].name), 4, 1); 4, 32, 1);
} }
} }

View File

@ -8745,7 +8745,7 @@ rs6000_elf_asm_out_constructor (symbol, priority)
fputs (")@fixup\n", asm_out_file); fputs (")@fixup\n", asm_out_file);
} }
else else
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
static void static void
@ -8776,7 +8776,7 @@ rs6000_elf_asm_out_destructor (symbol, priority)
fputs (")@fixup\n", asm_out_file); fputs (")@fixup\n", asm_out_file);
} }
else else
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
#endif #endif

View File

@ -2475,9 +2475,9 @@ do { \
if (TARGET_32BIT) \ if (TARGET_32BIT) \
{ \ { \
assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \ assemble_integer (operand_subword ((VALUE), 0, 0, DImode), \
UNITS_PER_WORD, 1); \ UNITS_PER_WORD, BITS_PER_WORD, 1); \
assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \ assemble_integer (operand_subword ((VALUE), 1, 0, DImode), \
UNITS_PER_WORD, 1); \ UNITS_PER_WORD, BITS_PER_WORD, 1); \
} \ } \
else \ else \
{ \ { \

View File

@ -1830,28 +1830,29 @@ extern int s390_nr_constants;
} \ } \
\ \
/* Output the value of the constant itself. */ \ /* Output the value of the constant itself. */ \
switch (GET_MODE_CLASS (pool->mode)) \ switch (GET_MODE_CLASS (MODE)) \
{ \ { \
case MODE_FLOAT: \ case MODE_FLOAT: \
if (GET_CODE (x) != CONST_DOUBLE) \ if (GET_CODE (EXP) != CONST_DOUBLE) \
abort (); \ abort (); \
\ \
memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u); \ memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (EXP), sizeof u); \
assemble_real (u.d, pool->mode); \ assemble_real (u.d, MODE, ALIGN); \
break; \ break; \
\ \
case MODE_INT: \ case MODE_INT: \
case MODE_PARTIAL_INT: \ case MODE_PARTIAL_INT: \
if (flag_pic && (GET_CODE (x) == CONST || \ if (flag_pic \
GET_CODE (x) == SYMBOL_REF || \ && (GET_CODE (EXP) == CONST \
GET_CODE (x) == LABEL_REF )) \ || GET_CODE (EXP) == SYMBOL_REF \
|| GET_CODE (EXP) == LABEL_REF )) \
{ \ { \
fprintf (FILE, "%s\t",TARGET_64BIT ? ASM_QUAD : ASM_LONG); \ fprintf (FILE, "%s\t",TARGET_64BIT ? ASM_QUAD : ASM_LONG); \
s390_output_symbolic_const (FILE, x); \ s390_output_symbolic_const (FILE, EXP); \
fputc ('\n', (FILE)); \ fputc ('\n', (FILE)); \
} \ } \
else \ else \
assemble_integer (x, GET_MODE_SIZE (pool->mode), 1); \ assemble_integer (EXP, GET_MODE_SIZE (MODE), ALIGN, 1); \
break; \ break; \
\ \
default: \ default: \

View File

@ -4131,7 +4131,7 @@
"* "*
{ {
if (operands[1] != const0_rtx) if (operands[1] != const0_rtx)
assemble_integer (operands[0], 2, 1); assemble_integer (operands[0], 2, BITS_PER_UNIT * 2, 1);
return \"\"; return \"\";
}" }"
[(set_attr "length" "2") [(set_attr "length" "2")
@ -4147,7 +4147,7 @@
"* "*
{ {
if (operands[1] != const0_rtx) if (operands[1] != const0_rtx)
assemble_integer (operands[0], 4, 1); assemble_integer (operands[0], 4, BITS_PER_UNIT * 4, 1);
return \"\"; return \"\";
}" }"
[(set_attr "length" "4") [(set_attr "length" "4")
@ -4163,7 +4163,7 @@
"* "*
{ {
if (operands[1] != const0_rtx) if (operands[1] != const0_rtx)
assemble_integer (operands[0], 8, 1); assemble_integer (operands[0], 8, BITS_PER_UNIT * 8, 1);
return \"\"; return \"\";
}" }"
[(set_attr "length" "8") [(set_attr "length" "8")
@ -4182,7 +4182,7 @@
{ {
union real_extract u; union real_extract u;
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, SFmode); assemble_real (u.d, SFmode, GET_MODE_ALIGNMENT (SFmode));
} }
return \"\"; return \"\";
}" }"
@ -4202,7 +4202,7 @@
{ {
union real_extract u; union real_extract u;
memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u); memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
assemble_real (u.d, DFmode); assemble_real (u.d, DFmode, GET_MODE_ALIGNMENT (DFmode));
} }
return \"\"; return \"\";
}" }"

View File

@ -383,4 +383,21 @@ do { \
#define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true #define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true
#endif #endif
/* GAS and SYSV4 assemblers accept these. */
#ifdef OBJECT_FORMAT_ELF
#ifndef UNALIGNED_SHORT_ASM_OP
#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
#endif
#ifndef UNALIGNED_INT_ASM_OP
#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
#endif
#ifndef UNALIGNED_DOUBLE_INT_ASM_OP
#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
#endif
#endif /* OBJECT_FORMAT_ELF */
#ifndef ASM_BYTE_OP
#define ASM_BYTE_OP "\t.byte\t"
#endif
#endif /* ! GCC_DEFAULTS_H */ #endif /* ! GCC_DEFAULTS_H */

View File

@ -37,26 +37,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_COMMENT_START ";#" #define ASM_COMMENT_START ";#"
#endif #endif
/* Definitions of defaults for assembler-dependent names of various
pseudo-ops and section names. These may be overridden in the tm.h
file (if necessary) for a particular assembler. */
#ifdef OBJECT_FORMAT_ELF
#ifndef UNALIGNED_SHORT_ASM_OP
#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
#endif
#ifndef UNALIGNED_INT_ASM_OP
#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
#endif
#ifndef UNALIGNED_DOUBLE_INT_ASM_OP
#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
#endif
#endif /* OBJECT_FORMAT_ELF */
#ifndef ASM_BYTE_OP
#define ASM_BYTE_OP "\t.byte\t"
#endif
/* We don't have unaligned support, let's hope the normal output works for /* We don't have unaligned support, let's hope the normal output works for
.debug_frame. But we know it won't work for .debug_info. */ .debug_frame. But we know it won't work for .debug_info. */
#if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO) #if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
@ -64,6 +44,9 @@ Boston, MA 02111-1307, USA. */
#endif #endif
/* Despite the fact that assemble_integer handles unaligned data,
continue emitting things by hand when possible, since that makes
the assembler commentary come out prettier. */
#ifdef UNALIGNED_INT_ASM_OP #ifdef UNALIGNED_INT_ASM_OP
static const char * unaligned_integer_asm_op PARAMS ((int)); static const char * unaligned_integer_asm_op PARAMS ((int));
@ -123,7 +106,7 @@ dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
fputs (unaligned_integer_asm_op (size), asm_out_file); fputs (unaligned_integer_asm_op (size), asm_out_file);
fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value); fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
#else #else
assemble_integer (GEN_INT (value), size, 1); assemble_integer (GEN_INT (value), size, BITS_PER_UNIT, 1);
#endif #endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
@ -168,10 +151,9 @@ dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
fputc ('-', asm_out_file); fputc ('-', asm_out_file);
assemble_name (asm_out_file, lab2); assemble_name (asm_out_file, lab2);
#else #else
assemble_integer (gen_rtx_MINUS (smallest_mode_for_size (size, MODE_INT), assemble_integer (gen_rtx_MINUS (Pmode, gen_rtx_SYMBOL_REF (Pmode, lab1),
gen_rtx_SYMBOL_REF (Pmode, lab1),
gen_rtx_SYMBOL_REF (Pmode, lab2)), gen_rtx_SYMBOL_REF (Pmode, lab2)),
size, 1); size, BITS_PER_UNIT, 1);
#endif #endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
@ -216,7 +198,7 @@ dw2_asm_output_offset VPARAMS ((int size, const char *label,
fputs (unaligned_integer_asm_op (size), asm_out_file); fputs (unaligned_integer_asm_op (size), asm_out_file);
assemble_name (asm_out_file, label); assemble_name (asm_out_file, label);
#else #else
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, BITS_PER_UNIT, 1);
#endif #endif
#endif #endif
@ -300,7 +282,7 @@ dw2_asm_output_addr VPARAMS ((int size, const char *label,
fputs (unaligned_integer_asm_op (size), asm_out_file); fputs (unaligned_integer_asm_op (size), asm_out_file);
assemble_name (asm_out_file, label); assemble_name (asm_out_file, label);
#else #else
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, BITS_PER_UNIT, 1);
#endif #endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
@ -338,7 +320,7 @@ dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
fputs (unaligned_integer_asm_op (size), asm_out_file); fputs (unaligned_integer_asm_op (size), asm_out_file);
output_addr_const (asm_out_file, addr); output_addr_const (asm_out_file, addr);
#else #else
assemble_integer (addr, size, 1); assemble_integer (addr, size, BITS_PER_UNIT, 1);
#endif #endif
if (flag_debug_asm && comment) if (flag_debug_asm && comment)
@ -898,7 +880,7 @@ dw2_output_indirect_constant_1 (node, data)
sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym); sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
ASM_OUTPUT_LABEL (asm_out_file, label); ASM_OUTPUT_LABEL (asm_out_file, label);
assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, BITS_PER_UNIT, 1);
return 0; return 0;
} }
@ -956,7 +938,7 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
/* NULL is _always_ represented as a plain zero. */ /* NULL is _always_ represented as a plain zero. */
if (addr == const0_rtx) if (addr == const0_rtx)
assemble_integer (addr, size, 1); assemble_integer (addr, size, BITS_PER_UNIT, 1);
else else
{ {
restart: restart:
@ -989,7 +971,7 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
fputs (unaligned_integer_asm_op (size), asm_out_file); fputs (unaligned_integer_asm_op (size), asm_out_file);
output_addr_const (asm_out_file, addr); output_addr_const (asm_out_file, addr);
#else #else
assemble_integer (addr, size, 1); assemble_integer (addr, size, BITS_PER_UNIT, 1);
#endif #endif
break; break;

View File

@ -948,15 +948,6 @@ static void retry_incomplete_types PARAMS ((void));
#ifndef VERSION_ASM_OP #ifndef VERSION_ASM_OP
#define VERSION_ASM_OP "\t.version\t" #define VERSION_ASM_OP "\t.version\t"
#endif #endif
#ifndef UNALIGNED_SHORT_ASM_OP
#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
#endif
#ifndef UNALIGNED_INT_ASM_OP
#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
#endif
#ifndef ASM_BYTE_OP
#define ASM_BYTE_OP "\t.byte\t"
#endif
#ifndef SET_ASM_OP #ifndef SET_ASM_OP
#define SET_ASM_OP "\t.set\t" #define SET_ASM_OP "\t.set\t"
#endif #endif

View File

@ -291,6 +291,7 @@ end_final (filename)
int long_bytes = LONG_TYPE_SIZE / BITS_PER_UNIT; int long_bytes = LONG_TYPE_SIZE / BITS_PER_UNIT;
int gcov_type_bytes = GCOV_TYPE_SIZE / BITS_PER_UNIT; int gcov_type_bytes = GCOV_TYPE_SIZE / BITS_PER_UNIT;
int pointer_bytes = POINTER_SIZE / BITS_PER_UNIT; int pointer_bytes = POINTER_SIZE / BITS_PER_UNIT;
unsigned int align2 = LONG_TYPE_SIZE;
if (profile_block_flag) if (profile_block_flag)
size = long_bytes * count_basic_blocks; size = long_bytes * count_basic_blocks;
@ -302,6 +303,12 @@ end_final (filename)
rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
* (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
/* ??? This _really_ ought to be done with a structure layout
and with assemble_constructor. If long_bytes != pointer_bytes
we'll be emitting unaligned data at some point. */
if (long_bytes != pointer_bytes)
abort ();
data_section (); data_section ();
/* Output the main header, of 11 words: /* Output the main header, of 11 words:
@ -323,70 +330,74 @@ end_final (filename)
ASM_OUTPUT_ALIGN (asm_out_file, align); ASM_OUTPUT_ALIGN (asm_out_file, align);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 0); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 0);
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
/* address of filename */ /* Zero word. */
assemble_integer (const0_rtx, long_bytes, align2, 1);
/* Address of filename. */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes,
align2, 1);
/* address of count table */ /* Address of count table. */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes,
align2, 1);
/* count of the # of basic blocks or # of instrumented arcs */ /* Count of the # of basic blocks or # of instrumented arcs. */
if (profile_block_flag) if (profile_block_flag)
assemble_integer (GEN_INT (count_basic_blocks), long_bytes, 1); assemble_integer (GEN_INT (profile_block_flag
else ? count_basic_blocks
assemble_integer (GEN_INT (count_instrumented_edges), long_bytes, 1); : count_instrumented_edges),
long_bytes, align2, 1);
/* zero word (link field) */ /* Zero word (link field). */
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
/* address of basic block start address table */ /* address of basic block start address table */
if (profile_block_flag) if (profile_block_flag)
{ {
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
1); pointer_bytes, align2, 1);
} }
else else
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
/* byte count for extended structure. */ /* Byte count for extended structure. */
assemble_integer (GEN_INT (11 * UNITS_PER_WORD), long_bytes, 1); assemble_integer (GEN_INT (11 * UNITS_PER_WORD), long_bytes, align2, 1);
/* address of function name table */ /* Address of function name table. */
if (profile_block_flag) if (profile_block_flag)
{ {
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
1); pointer_bytes, align2, 1);
} }
else else
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
/* address of line number and filename tables if debugging. */ /* Address of line number and filename tables if debugging. */
if (write_symbols != NO_DEBUG && profile_block_flag) if (write_symbols != NO_DEBUG && profile_block_flag)
{ {
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1); pointer_bytes, align2, 1);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1); pointer_bytes, align2, 1);
} }
else else
{ {
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
} }
/* space for extension ptr (link field) */ /* Space for extension ptr (link field). */
assemble_integer (const0_rtx, UNITS_PER_WORD, 1); assemble_integer (const0_rtx, UNITS_PER_WORD, align2, 1);
/* Output the file name changing the suffix to .d for Sun tcov /* Output the file name changing the suffix to .d for
compatibility. */ Sun tcov compatibility. */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 1); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 1);
{ {
char *cwd = getpwd (); char *cwd = getpwd ();
@ -460,7 +471,7 @@ end_final (filename)
{ {
ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i); ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1); pointer_bytes, align2, 1);
} }
} }
@ -475,14 +486,14 @@ end_final (filename)
ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", ASM_GENERATE_INTERNAL_LABEL (name, "LPBC",
ptr->func_label_num); ptr->func_label_num);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1); pointer_bytes, align2, 1);
} }
else else
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
} }
for (; i < count_basic_blocks; i++) for (; i < count_basic_blocks; i++)
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
} }
if (write_symbols != NO_DEBUG && profile_block_flag) if (write_symbols != NO_DEBUG && profile_block_flag)
@ -490,10 +501,10 @@ end_final (filename)
/* Output the table of line numbers. */ /* Output the table of line numbers. */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 5); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 5);
for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++) for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++)
assemble_integer (GEN_INT (ptr->line_num), long_bytes, 1); assemble_integer (GEN_INT (ptr->line_num), long_bytes, align2, 1);
for (; i < count_basic_blocks; i++) for (; i < count_basic_blocks; i++)
assemble_integer (const0_rtx, long_bytes, 1); assemble_integer (const0_rtx, long_bytes, align2, 1);
/* Output the table of file names. */ /* Output the table of file names. */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 6); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 6);
@ -504,14 +515,14 @@ end_final (filename)
ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", ASM_GENERATE_INTERNAL_LABEL (name, "LPBC",
ptr->file_label_num); ptr->file_label_num);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
pointer_bytes, 1); pointer_bytes, align2, 1);
} }
else else
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
} }
for (; i < count_basic_blocks; i++) for (; i < count_basic_blocks; i++)
assemble_integer (const0_rtx, pointer_bytes, 1); assemble_integer (const0_rtx, pointer_bytes, align2, 1);
} }
/* End with the address of the table of addresses, /* End with the address of the table of addresses,
@ -519,8 +530,8 @@ end_final (filename)
if (profile_block_flag) if (profile_block_flag)
{ {
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name),
1); pointer_bytes, align2, 1);
} }
} }
} }
@ -1684,7 +1695,7 @@ profile_function (file)
data_section (); data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no); ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, 1); assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
#endif #endif
function_section (current_function_decl); function_section (current_function_decl);

View File

@ -1,3 +1,8 @@
2001-08-17 Richard Henderson <rth@redhat.com>
* class.c (emit_register_classes): Add align parameter to
call to assemble_integer.
2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com> 2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com>
* jcf-parse.c (load_class): New locals saved and class_loaded. If * jcf-parse.c (load_class): New locals saved and class_loaded. If

View File

@ -1893,7 +1893,7 @@ emit_register_classes ()
assemble_align (POINTER_SIZE); assemble_align (POINTER_SIZE);
for (t = registered_class; t; t = TREE_CHAIN (t)) for (t = registered_class; t; t = TREE_CHAIN (t))
assemble_integer (XEXP (DECL_RTL (t), 0), assemble_integer (XEXP (DECL_RTL (t), 0),
POINTER_SIZE / BITS_PER_UNIT, 1); POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
#else #else
abort (); abort ();
#endif #endif

View File

@ -287,18 +287,17 @@ extern void assemble_eh_label PARAMS ((const char *));
extern void assemble_name PARAMS ((FILE *, const char *)); extern void assemble_name PARAMS ((FILE *, const char *));
#ifdef RTX_CODE #ifdef RTX_CODE
/* Assemble the integer constant X into an object of SIZE bytes. /* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
X must be either a CONST_INT or CONST_DOUBLE. the alignment of the integer in bits. Return 1 if we were able to output
the constant, otherwise 0. If FORCE is non-zero, abort if we can't output
Return 1 if we were able to output the constant, otherwise 0. If FORCE is the constant. */
non-zero, abort if we can't output the constant. */ extern int assemble_integer PARAMS ((rtx, unsigned, unsigned, int));
extern int assemble_integer PARAMS ((rtx, int, int));
extern int assemble_eh_integer PARAMS ((rtx, int, int));
#ifdef REAL_VALUE_TYPE #ifdef REAL_VALUE_TYPE
/* Assemble the floating-point constant D into an object of size MODE. */ /* Assemble the floating-point constant D into an object of size MODE. */
extern void assemble_real PARAMS ((REAL_VALUE_TYPE, extern void assemble_real PARAMS ((REAL_VALUE_TYPE,
enum machine_mode)); enum machine_mode,
unsigned));
#endif #endif
#endif #endif
@ -341,8 +340,10 @@ extern tree initializer_constant_valid_p PARAMS ((tree, tree));
Assumes output_addressed_constants has been done on EXP already. Assumes output_addressed_constants has been done on EXP already.
Generate exactly SIZE bytes of assembler data, padding at the end Generate exactly SIZE bytes of assembler data, padding at the end
with zeros if necessary. SIZE must always be specified. */ with zeros if necessary. SIZE must always be specified.
extern void output_constant PARAMS ((tree, int));
ALIGN is the alignment in bits that may be assumed for the data. */
extern void output_constant PARAMS ((tree, int, unsigned));
#endif #endif
#ifdef RTX_CODE #ifdef RTX_CODE

View File

@ -161,7 +161,8 @@ static int mark_constant PARAMS ((rtx *current_rtx, void *data));
static int output_addressed_constants PARAMS ((tree)); static int output_addressed_constants PARAMS ((tree));
static void output_after_function_constants PARAMS ((void)); static void output_after_function_constants PARAMS ((void));
static unsigned HOST_WIDE_INT array_size_for_constructor PARAMS ((tree)); static unsigned HOST_WIDE_INT array_size_for_constructor PARAMS ((tree));
static void output_constructor PARAMS ((tree, int)); static unsigned min_align PARAMS ((unsigned, unsigned));
static void output_constructor PARAMS ((tree, int, unsigned));
#ifdef ASM_WEAKEN_LABEL #ifdef ASM_WEAKEN_LABEL
static void remove_from_pending_weak_list PARAMS ((const char *)); static void remove_from_pending_weak_list PARAMS ((const char *));
#endif #endif
@ -952,7 +953,7 @@ default_named_section_asm_out_destructor (symbol, priority)
named_section_flags (section, SECTION_WRITE); named_section_flags (section, SECTION_WRITE);
assemble_align (POINTER_SIZE); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
#ifdef DTORS_SECTION_ASM_OP #ifdef DTORS_SECTION_ASM_OP
@ -973,7 +974,8 @@ default_dtor_section_asm_out_destructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
dtors_section (); dtors_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
#endif #endif
@ -1012,7 +1014,8 @@ default_named_section_asm_out_constructor (symbol, priority)
} }
named_section_flags (section, SECTION_WRITE); named_section_flags (section, SECTION_WRITE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
#ifdef CTORS_SECTION_ASM_OP #ifdef CTORS_SECTION_ASM_OP
@ -1033,7 +1036,8 @@ default_ctor_section_asm_out_constructor (symbol, priority)
int priority ATTRIBUTE_UNUSED; int priority ATTRIBUTE_UNUSED;
{ {
ctors_section (); ctors_section ();
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
} }
#endif #endif
@ -1172,29 +1176,8 @@ assemble_zeros (size)
if (ASM_NO_SKIP_IN_TEXT && in_text_section ()) if (ASM_NO_SKIP_IN_TEXT && in_text_section ())
{ {
int i; int i;
for (i = 0; i < size; i++)
for (i = 0; i < size - 20; i += 20) assemble_integer (const0_rtx, 1, BITS_PER_UNIT, 1);
{
#ifdef ASM_BYTE_OP
fprintf (asm_out_file,
"%s0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n", ASM_BYTE_OP);
#else
fprintf (asm_out_file,
"\tbyte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n");
#endif
}
if (i < size)
{
#ifdef ASM_BYTE_OP
fprintf (asm_out_file, "%s0", ASM_BYTE_OP);
#else
fprintf (asm_out_file, "\tbyte 0");
#endif
i++;
for (; i < size; i++)
fprintf (asm_out_file, ",0");
fprintf (asm_out_file, "\n");
}
} }
else else
#endif #endif
@ -1584,7 +1567,8 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if (DECL_INITIAL (decl)) if (DECL_INITIAL (decl))
/* Output the actual data. */ /* Output the actual data. */
output_constant (DECL_INITIAL (decl), output_constant (DECL_INITIAL (decl),
tree_low_cst (DECL_SIZE_UNIT (decl), 1)); tree_low_cst (DECL_SIZE_UNIT (decl), 1),
align);
else else
/* Leave space for it. */ /* Leave space for it. */
assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1)); assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1));
@ -1801,21 +1785,32 @@ assemble_trampoline_template ()
} }
#endif #endif
/* Assemble the integer constant X into an object of SIZE bytes. /* A and B are either alignments or offsets. Return the minimum alignment
X must be either a CONST_INT or CONST_DOUBLE. that may be assumed after adding the two together. */
Return 1 if we were able to output the constant, otherwise 0. If FORCE is static inline unsigned
non-zero, abort if we can't output the constant. */ min_align (a, b)
unsigned int a, b;
{
return (a | b) & -(a | b);
}
/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
the alignment of the integer in bits. Return 1 if we were able to output
the constant, otherwise 0. If FORCE is non-zero, abort if we can't output
the constant. */
int int
assemble_integer (x, size, force) assemble_integer (x, size, align, force)
rtx x; rtx x;
int size; unsigned int size;
unsigned int align;
int force; int force;
{ {
/* First try to use the standard 1, 2, 4, 8, and 16 byte /* First try to use the standard 1, 2, 4, 8, and 16 byte
ASM_OUTPUT... macros. */ ASM_OUTPUT... macros. */
if (align >= size * BITS_PER_UNIT)
switch (size) switch (size)
{ {
#ifdef ASM_OUTPUT_CHAR #ifdef ASM_OUTPUT_CHAR
@ -1823,31 +1818,58 @@ assemble_integer (x, size, force)
ASM_OUTPUT_CHAR (asm_out_file, x); ASM_OUTPUT_CHAR (asm_out_file, x);
return 1; return 1;
#endif #endif
#ifdef ASM_OUTPUT_SHORT #ifdef ASM_OUTPUT_SHORT
case 2: case 2:
ASM_OUTPUT_SHORT (asm_out_file, x); ASM_OUTPUT_SHORT (asm_out_file, x);
return 1; return 1;
#endif #endif
#ifdef ASM_OUTPUT_INT #ifdef ASM_OUTPUT_INT
case 4: case 4:
ASM_OUTPUT_INT (asm_out_file, x); ASM_OUTPUT_INT (asm_out_file, x);
return 1; return 1;
#endif #endif
#ifdef ASM_OUTPUT_DOUBLE_INT #ifdef ASM_OUTPUT_DOUBLE_INT
case 8: case 8:
ASM_OUTPUT_DOUBLE_INT (asm_out_file, x); ASM_OUTPUT_DOUBLE_INT (asm_out_file, x);
return 1; return 1;
#endif #endif
#ifdef ASM_OUTPUT_QUADRUPLE_INT #ifdef ASM_OUTPUT_QUADRUPLE_INT
case 16: case 16:
ASM_OUTPUT_QUADRUPLE_INT (asm_out_file, x); ASM_OUTPUT_QUADRUPLE_INT (asm_out_file, x);
return 1; return 1;
#endif #endif
} }
else
{
const char *asm_op = NULL;
switch (size)
{
#ifdef UNALIGNED_SHORT_ASM_OP
case 2:
asm_op = UNALIGNED_SHORT_ASM_OP;
break;
#endif
#ifdef UNALIGNED_INT_ASM_OP
case 4:
asm_op = UNALIGNED_INT_ASM_OP;
break;
#endif
#ifdef UNALIGNED_DOUBLE_INT_ASM_OP
case 8:
asm_op = UNALIGNED_DOUBLE_INT_ASM_OP;
break;
#endif
}
if (asm_op)
{
fputs (asm_op, asm_out_file);
output_addr_const (asm_out_file, x);
fputc ('\n', asm_out_file);
return 1;
}
}
/* If we couldn't do it that way, there are two other possibilities: First, /* If we couldn't do it that way, there are two other possibilities: First,
if the machine can output an explicit byte and this is a 1 byte constant, if the machine can output an explicit byte and this is a 1 byte constant,
@ -1861,24 +1883,22 @@ assemble_integer (x, size, force)
} }
#endif #endif
/* Finally, if SIZE is larger than a single word, try to output the constant /* If SIZE is larger than a single word, try to output the constant
one word at a time. */ one word at a time. */
if (size > UNITS_PER_WORD) if (size > UNITS_PER_WORD)
{ {
int i;
enum machine_mode mode enum machine_mode mode
= mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
rtx word; unsigned align2 = min_align (align, BITS_PER_WORD);
unsigned int i;
for (i = 0; i < size / UNITS_PER_WORD; i++) for (i = 0; i < size / UNITS_PER_WORD; i++)
{ {
word = operand_subword (x, i, 0, mode); rtx word = operand_subword (x, i, 0, mode);
if (word == 0) if (word == 0)
break; break;
if (! assemble_integer (word, UNITS_PER_WORD, align2, 0))
if (! assemble_integer (word, UNITS_PER_WORD, 0))
break; break;
} }
@ -1890,6 +1910,32 @@ assemble_integer (x, size, force)
abort (); abort ();
} }
/* If unaligned, and this is a constant, emit it one byte at a time. */
if (align < size * BITS_PER_UNIT)
{
enum machine_mode omode, imode;
unsigned int i;
omode = mode_for_size (BITS_PER_UNIT, MODE_INT, 0);
imode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
for (i = 0; i < size; i++)
{
rtx byte = simplify_subreg (omode, x, imode, i);
if (byte == 0)
break;
if (! assemble_integer (byte, 1, BITS_PER_UNIT, 0))
break;
}
if (i == size)
return 1;
/* If we output at least one byte and then could not finish,
there is no valid way to continue. */
if (i > 0)
abort ();
}
if (force) if (force)
abort (); abort ();
@ -1953,14 +1999,25 @@ assemble_real_1 (p)
} }
void void
assemble_real (d, mode) assemble_real (d, mode, align)
REAL_VALUE_TYPE d; REAL_VALUE_TYPE d;
enum machine_mode mode; enum machine_mode mode;
unsigned int align;
{ {
struct assemble_real_args args; struct assemble_real_args args;
args.d = &d; args.d = &d;
args.mode = mode; args.mode = mode;
/* We cannot emit unaligned floating point constants. This is slightly
complicated in that we don't know what "unaligned" means exactly. */
#ifdef BIGGEST_FIELD_ALIGNMENT
if (align >= BIGGEST_FIELD_ALIGNMENT)
;
else
#endif
if (align < GET_MODE_ALIGNMENT (mode))
abort ();
if (do_float_handler (assemble_real_1, (PTR) &args)) if (do_float_handler (assemble_real_1, (PTR) &args))
return; return;
@ -3280,7 +3337,8 @@ output_constant_def_contents (exp, reloc, labelno)
(TREE_CODE (exp) == STRING_CST (TREE_CODE (exp) == STRING_CST
? MAX (TREE_STRING_LENGTH (exp), ? MAX (TREE_STRING_LENGTH (exp),
int_size_in_bytes (TREE_TYPE (exp))) int_size_in_bytes (TREE_TYPE (exp)))
: int_size_in_bytes (TREE_TYPE (exp)))); : int_size_in_bytes (TREE_TYPE (exp))),
align);
} }
@ -3841,12 +3899,12 @@ output_constant_pool (fnname, fndecl)
abort (); abort ();
memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u); memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u);
assemble_real (u.d, pool->mode); assemble_real (u.d, pool->mode, pool->align);
break; break;
case MODE_INT: case MODE_INT:
case MODE_PARTIAL_INT: case MODE_PARTIAL_INT:
assemble_integer (x, GET_MODE_SIZE (pool->mode), 1); assemble_integer (x, GET_MODE_SIZE (pool->mode), pool->align, 1);
break; break;
default: default:
@ -3856,7 +3914,6 @@ output_constant_pool (fnname, fndecl)
#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY #ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY
done: ; done: ;
#endif #endif
} }
#ifdef ASM_OUTPUT_POOL_EPILOGUE #ifdef ASM_OUTPUT_POOL_EPILOGUE
@ -4258,12 +4315,15 @@ initializer_constant_valid_p (value, endtype)
There a case in which we would fail to output exactly SIZE bytes: There a case in which we would fail to output exactly SIZE bytes:
for a structure constructor that wants to produce more than SIZE bytes. for a structure constructor that wants to produce more than SIZE bytes.
But such constructors will never be generated for any possible input. */ But such constructors will never be generated for any possible input.
ALIGN is the alignment of the data in bits. */
void void
output_constant (exp, size) output_constant (exp, size, align)
register tree exp; tree exp;
register int size; int size;
unsigned int align;
{ {
register enum tree_code code = TREE_CODE (TREE_TYPE (exp)); register enum tree_code code = TREE_CODE (TREE_TYPE (exp));
@ -4318,7 +4378,7 @@ output_constant (exp, size)
if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode, if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode,
EXPAND_INITIALIZER), EXPAND_INITIALIZER),
size, 0)) size, align, 0))
error ("initializer for integer value is too complicated"); error ("initializer for integer value is too complicated");
size = 0; size = 0;
break; break;
@ -4328,20 +4388,22 @@ output_constant (exp, size)
error ("initializer for floating value is not a floating constant"); error ("initializer for floating value is not a floating constant");
assemble_real (TREE_REAL_CST (exp), assemble_real (TREE_REAL_CST (exp),
mode_for_size (size * BITS_PER_UNIT, MODE_FLOAT, 0)); mode_for_size (size * BITS_PER_UNIT, MODE_FLOAT, 0),
align);
size = 0; size = 0;
break; break;
case COMPLEX_TYPE: case COMPLEX_TYPE:
output_constant (TREE_REALPART (exp), size / 2); output_constant (TREE_REALPART (exp), size / 2, align);
output_constant (TREE_IMAGPART (exp), size / 2); output_constant (TREE_IMAGPART (exp), size / 2,
min_align (align, BITS_PER_UNIT * (size / 2)));
size -= (size / 2) * 2; size -= (size / 2) * 2;
break; break;
case ARRAY_TYPE: case ARRAY_TYPE:
if (TREE_CODE (exp) == CONSTRUCTOR) if (TREE_CODE (exp) == CONSTRUCTOR)
{ {
output_constructor (exp, size); output_constructor (exp, size, align);
return; return;
} }
else if (TREE_CODE (exp) == STRING_CST) else if (TREE_CODE (exp) == STRING_CST)
@ -4364,7 +4426,7 @@ output_constant (exp, size)
case RECORD_TYPE: case RECORD_TYPE:
case UNION_TYPE: case UNION_TYPE:
if (TREE_CODE (exp) == CONSTRUCTOR) if (TREE_CODE (exp) == CONSTRUCTOR)
output_constructor (exp, size); output_constructor (exp, size, align);
else else
abort (); abort ();
return; return;
@ -4373,7 +4435,7 @@ output_constant (exp, size)
if (TREE_CODE (exp) == INTEGER_CST) if (TREE_CODE (exp) == INTEGER_CST)
assemble_integer (expand_expr (exp, NULL_RTX, assemble_integer (expand_expr (exp, NULL_RTX,
VOIDmode, EXPAND_INITIALIZER), VOIDmode, EXPAND_INITIALIZER),
size, 1); size, align, 1);
else if (TREE_CODE (exp) == CONSTRUCTOR) else if (TREE_CODE (exp) == CONSTRUCTOR)
{ {
unsigned char *buffer = (unsigned char *) alloca (size); unsigned char *buffer = (unsigned char *) alloca (size);
@ -4434,9 +4496,10 @@ array_size_for_constructor (val)
Generate at least SIZE bytes, padding if necessary. */ Generate at least SIZE bytes, padding if necessary. */
static void static void
output_constructor (exp, size) output_constructor (exp, size, align)
tree exp; tree exp;
int size; int size;
unsigned int align;
{ {
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
register tree link, field = 0; register tree link, field = 0;
@ -4496,6 +4559,7 @@ output_constructor (exp, size)
HOST_WIDE_INT lo_index = tree_low_cst (TREE_OPERAND (index, 0), 0); HOST_WIDE_INT lo_index = tree_low_cst (TREE_OPERAND (index, 0), 0);
HOST_WIDE_INT hi_index = tree_low_cst (TREE_OPERAND (index, 1), 0); HOST_WIDE_INT hi_index = tree_low_cst (TREE_OPERAND (index, 1), 0);
HOST_WIDE_INT index; HOST_WIDE_INT index;
unsigned int align2 = min_align (align, fieldsize * BITS_PER_UNIT);
for (index = lo_index; index <= hi_index; index++) for (index = lo_index; index <= hi_index; index++)
{ {
@ -4503,7 +4567,7 @@ output_constructor (exp, size)
if (val == 0) if (val == 0)
assemble_zeros (fieldsize); assemble_zeros (fieldsize);
else else
output_constant (val, fieldsize); output_constant (val, fieldsize, align2);
/* Count its size. */ /* Count its size. */
total_bytes += fieldsize; total_bytes += fieldsize;
@ -4517,6 +4581,7 @@ output_constructor (exp, size)
/* Since this structure is static, /* Since this structure is static,
we know the positions are constant. */ we know the positions are constant. */
HOST_WIDE_INT pos = field ? int_byte_position (field) : 0; HOST_WIDE_INT pos = field ? int_byte_position (field) : 0;
unsigned int align2;
if (index != 0) if (index != 0)
pos = (tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (val)), 1) pos = (tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (val)), 1)
@ -4539,12 +4604,8 @@ output_constructor (exp, size)
total_bytes = pos; total_bytes = pos;
} }
else if (field != 0 && DECL_PACKED (field)) /* Find the alignment of this element. */
/* Some assemblers automaticallly align a datum according to its align2 = min_align (align, BITS_PER_UNIT * pos);
size if no align directive is specified. The datum, however,
may be declared with 'packed' attribute, so we have to disable
such a feature. */
ASM_OUTPUT_ALIGN (asm_out_file, 0);
/* Determine size this element should occupy. */ /* Determine size this element should occupy. */
if (field) if (field)
@ -4581,7 +4642,7 @@ output_constructor (exp, size)
if (val == 0) if (val == 0)
assemble_zeros (fieldsize); assemble_zeros (fieldsize);
else else
output_constant (val, fieldsize); output_constant (val, fieldsize, align2);
/* Count its size. */ /* Count its size. */
total_bytes += fieldsize; total_bytes += fieldsize;