diff options
author | Richard Henderson <rth@redhat.com> | 2001-08-17 17:53:20 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-08-17 17:53:20 -0700 |
commit | c8af3574e39507d08798c890c034c1935b51885c (patch) | |
tree | 980e4cc8bb27895af2efcfd04f1969c28cccd1f9 /gcc/final.c | |
parent | 920ae24b3528f63f23f9b77dc8600120cdd5658e (diff) | |
download | gcc-c8af3574e39507d08798c890c034c1935b51885c.zip gcc-c8af3574e39507d08798c890c034c1935b51885c.tar.gz gcc-c8af3574e39507d08798c890c034c1935b51885c.tar.bz2 |
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
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 95 |
1 files changed, 53 insertions, 42 deletions
diff --git a/gcc/final.c b/gcc/final.c index d322481..ec57842 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -291,6 +291,7 @@ end_final (filename) int long_bytes = LONG_TYPE_SIZE / BITS_PER_UNIT; int gcov_type_bytes = GCOV_TYPE_SIZE / BITS_PER_UNIT; int pointer_bytes = POINTER_SIZE / BITS_PER_UNIT; + unsigned int align2 = LONG_TYPE_SIZE; if (profile_block_flag) size = long_bytes * count_basic_blocks; @@ -302,6 +303,12 @@ end_final (filename) rounded = (rounded / (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 (); /* Output the main header, of 11 words: @@ -323,70 +330,74 @@ end_final (filename) ASM_OUTPUT_ALIGN (asm_out_file, align); 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); - 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); - 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) - assemble_integer (GEN_INT (count_basic_blocks), long_bytes, 1); - else - assemble_integer (GEN_INT (count_instrumented_edges), long_bytes, 1); + assemble_integer (GEN_INT (profile_block_flag + ? count_basic_blocks + : count_instrumented_edges), + long_bytes, align2, 1); - /* zero word (link field) */ - assemble_integer (const0_rtx, pointer_bytes, 1); + /* Zero word (link field). */ + assemble_integer (const0_rtx, pointer_bytes, align2, 1); /* address of basic block start address table */ if (profile_block_flag) { ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, - 1); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), + pointer_bytes, align2, 1); } else - assemble_integer (const0_rtx, pointer_bytes, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); - /* byte count for extended structure. */ - assemble_integer (GEN_INT (11 * UNITS_PER_WORD), long_bytes, 1); + /* Byte count for extended structure. */ + 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) { ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, - 1); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), + pointer_bytes, align2, 1); } 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) { ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, 1); + pointer_bytes, align2, 1); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, 1); + pointer_bytes, align2, 1); } else { - assemble_integer (const0_rtx, pointer_bytes, 1); - assemble_integer (const0_rtx, pointer_bytes, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); } - /* space for extension ptr (link field) */ - assemble_integer (const0_rtx, UNITS_PER_WORD, 1); + /* Space for extension ptr (link field). */ + assemble_integer (const0_rtx, UNITS_PER_WORD, align2, 1); - /* Output the file name changing the suffix to .d for Sun tcov - compatibility. */ + /* Output the file name changing the suffix to .d for + Sun tcov compatibility. */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 1); { char *cwd = getpwd (); @@ -460,7 +471,7 @@ end_final (filename) { ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i); 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", ptr->func_label_num); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, 1); + pointer_bytes, align2, 1); } else - assemble_integer (const0_rtx, pointer_bytes, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); } 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) @@ -490,10 +501,10 @@ end_final (filename) /* Output the table of line numbers. */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 5); 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++) - assemble_integer (const0_rtx, long_bytes, 1); + assemble_integer (const0_rtx, long_bytes, align2, 1); /* Output the table of file names. */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 6); @@ -504,14 +515,14 @@ end_final (filename) ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", ptr->file_label_num); assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, 1); + pointer_bytes, align2, 1); } else - assemble_integer (const0_rtx, pointer_bytes, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); } 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, @@ -519,8 +530,8 @@ end_final (filename) if (profile_block_flag) { ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, - 1); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), + pointer_bytes, align2, 1); } } } @@ -1684,7 +1695,7 @@ profile_function (file) data_section (); ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); 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 function_section (current_function_decl); |