* assemble_integer & align
@ 2001-09-22 0:38 Denis Chertykov
2001-09-22 0:48 ` Richard Henderson
0 siblings, 1 reply; 4+ messages in thread
From: Denis Chertykov @ 2001-09-22 0:38 UTC (permalink / raw)
To: gcc; +Cc: Richard Henderson
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assemble_integer & align
2001-09-22 0:38 assemble_integer & align Denis Chertykov
@ 2001-09-22 0:48 ` Richard Henderson
2001-09-22 2:25 ` Denis Chertykov
0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2001-09-22 0:48 UTC (permalink / raw)
To: Denis Chertykov; +Cc: gcc
On Sat, Sep 22, 2001 at 11:38:44AM +0400, Denis Chertykov wrote:
> 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:
Why is your align always 8? Is that BIGGEST_ALIGNMENT?
If so, we can perhaps modify the tests there to take that
into account.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assemble_integer & align
2001-09-22 0:48 ` Richard Henderson
@ 2001-09-22 2:25 ` Denis Chertykov
2001-09-24 13:18 ` Richard Henderson
0 siblings, 1 reply; 4+ messages in thread
From: Denis Chertykov @ 2001-09-22 2:25 UTC (permalink / raw)
To: Richard Henderson; +Cc: Denis Chertykov, gcc
Richard Henderson <rth@redhat.com> writes:
> On Sat, Sep 22, 2001 at 11:38:44AM +0400, Denis Chertykov wrote:
> > 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:
>
> Why is your align always 8? Is that BIGGEST_ALIGNMENT?
Yes. (You can see it in avr/avr.h). AVR is an 8 bit target which isn't
needed in alignments at all.
Denis.
PS: Is you your timezone GMT-7 ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assemble_integer & align
2001-09-22 2:25 ` Denis Chertykov
@ 2001-09-24 13:18 ` Richard Henderson
0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2001-09-24 13:18 UTC (permalink / raw)
To: Denis Chertykov; +Cc: gcc
On Sat, Sep 22, 2001 at 01:19:22PM +0400, Denis Chertykov wrote:
> Yes. (You can see it in avr/avr.h). AVR is an 8 bit target which isn't
> needed in alignments at all.
Oh, duh. This should work for you then. I'll wait for an
success ack before applying though.
> PS: Is you your timezone GMT-7 ?
Yes, until daylight savings time ends in another month or so.
Then we'll be back at GMT-8.
r~
* varasm.c (assemble_integer): Bound aligned data check by
BIGGEST_ALIGNMENT.
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.209
diff -c -p -d -u -r1.209 varasm.c
--- varasm.c 2001/09/22 13:23:14 1.209
+++ varasm.c 2001/09/24 20:11:36
@@ -1913,7 +1913,7 @@ assemble_integer (x, size, align, force)
/* First try to use the standard 1, 2, 4, 8, and 16 byte
ASM_OUTPUT... macros. */
- if (align >= size * BITS_PER_UNIT)
+ if (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT))
switch (size)
{
#ifdef ASM_OUTPUT_CHAR
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-09-24 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-22 0:38 assemble_integer & align Denis Chertykov
2001-09-22 0:48 ` Richard Henderson
2001-09-22 2:25 ` Denis Chertykov
2001-09-24 13:18 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).