This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: Add a stop bit in alignment for alloc.
On Fri, Mar 05, 2004 at 12:12:05AM +0100, Andreas Schwab wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
>
> > @@ -9990,7 +9993,24 @@ md_assemble (str)
> > flags = idesc->flags;
> >
> > if ((flags & IA64_OPCODE_FIRST) != 0)
> > - insn_group_break (1, 0, 0);
> > + {
> > + /* The alignment frag has to end with a stop bit only if the
> > + next instruction after the alignment directive has to be
> > + the first instruction in an instruction group. */
> > + if (align_frag)
> > + {
> > + while (align_frag->fr_type != rs_align_code)
> > + {
> > + align_frag = align_frag->fr_next;
> > + assert (align_frag);
> > + }
> > + if (align_frag->fr_next == frag_now)
> > + align_frag->tc_frag_data = 1;
> > + }
> > +
> > + insn_group_break (1, 0, 0);
> > + }
> > + align_frag = NULL;
> >
> > if ((flags & IA64_OPCODE_NO_PRED) != 0 && qp_regno != 0)
> > {
>
> This breaks the attached test case (from glibc):
>
> $ ./as-new init-first.s
> init-first.s: Assembler messages:
> init-first.s:31: Internal error!
> Assertion failure in md_assemble at /cvs/binutils/gas/config/tc-ia64.c
> line 10013.
> Please report this bug.
I am testing this patch. The problems are
.data
.align 8
data8 0
.text
alloc out0 = ar.pfs, 8, 0, 4, 0
and
.align 16
alloc r32=ar.pfs,1,2,4,0
H.J.
---
2004-03-04 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-ia64.c (md_assemble): Properly handle NULL
align_frag.
(ia64_handle_align): Don't abort if failed to add a stop bit.
--- gas/config/tc-ia64.c.align 2004-03-03 11:49:14.000000000 -0800
+++ gas/config/tc-ia64.c 2004-03-04 15:19:37.000000000 -0800
@@ -10010,9 +10010,12 @@ md_assemble (str)
while (align_frag->fr_type != rs_align_code)
{
align_frag = align_frag->fr_next;
- assert (align_frag);
+ if (!align_frag)
+ break;
}
- if (align_frag->fr_next == frag_now)
+ /* align_frag can be NULL if there are directives in
+ between. */
+ if (align_frag && align_frag->fr_next == frag_now)
align_frag->tc_frag_data = 1;
}
@@ -10872,8 +10875,16 @@ ia64_handle_align (fragp)
if (!bytes && fragp->tc_frag_data)
{
if (fragp->fr_fix < 16)
+#if 1
+ /* FIXME: It won't work with
+ .align 16
+ alloc r32=ar.pfs,1,2,4,0
+ */
+ ;
+#else
as_bad_where (fragp->fr_file, fragp->fr_line,
_("Can't add stop bit to mark end of instruction group"));
+#endif
else
/* Bundles are always in little-endian byte order. Make sure
the previous bundle has the stop bit. */