This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
assemble_integer & align
- To: gcc at gcc dot gnu dot org
- Subject: assemble_integer & align
- From: Denis Chertykov <denisc at overta dot ru>
- Date: Sat, 22 Sep 2001 11:38:44 +0400
- Cc: Richard Henderson <rth at redhat dot com>
Today (after long delay) I have tried to build my port (avr) and have
founded a changes in varasm.c:assemble_integer.
ChangeLog entry was:
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_integer): Handle unaligned data.
Diff was:
...
...
int
-assemble_integer (x, size, force)
+assemble_integer (x, size, align, force)
rtx x;
- int size;
+ unsigned int size;
+ unsigned int align;
int force;
{
/* First try to use the standard 1, 2, 4, 8, and 16 byte
ASM_OUTPUT... macros. */
- switch (size)
- {
+ if (align >= size * BITS_PER_UNIT)
+ switch (size)
+ {
--------------------------------------------------------------------
My main problem is 'if (align >= size * BITS_PER_UNIT)' because my
ALIGN always 8 and if size > 1 then `assemble_integer' will output
all integers as:
...
...
if (asm_op)
{
fputs (asm_op, asm_out_file);
output_addr_const (asm_out_file, x);
fputc ('\n', asm_out_file);
return 1;
}
--------------------------------------------------------
My version of ASM_OUTPUT_SHORT is a port specific.
void
asm_output_short (file, value)
FILE *file;
rtx value;
{
if (SYMBOL_REF_FLAG (value) || GET_CODE (value) == LABEL_REF)
{
fprintf (file, "\t.word pm(");
output_addr_const (file, (value));
fprintf (file, ")\n");
}
else
{
fprintf (file, "\t.word ");
output_addr_const (file, (value));
fprintf (file, "\n");
}
}
----------------------------------------
How can I resolv this problem ?
Denis.