This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix -xauto for ia64 assembler
- From: Jim Wilson <wilson at specifixinc dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: 27 May 2004 13:59:17 -0700
- Subject: Re: PATCH: Fix -xauto for ia64 assembler
- References: <20040520184822.GA16672@lucon.org>
On Thu, 2004-05-20 at 11:48, H. J. Lu wrote:
> * config/tc-ia64.c (remove_marked_resource): Restore the old
> operands when inserting srlz.i/srlz.d.
I had looked at this bug, but didn't get as far as trying to write a
patch. What bothers me here is that we have a structure with a lot of
fields, and we are only moving two of them when we insert the new
instruction. Your patch modifies to code to move one more. Shouldn't
we be moving all of the fields instead of just a few of them?
I can make examples that fail in other ways if I add code that sets some
of the other fields. For example:
mov rr[r3]=r7
[L2:]
ld8 r39 = [r35]
The srlz.d instruction gets added in between the tag L2 and the ld8
instruction. I think it should be added in between the mov and the tag
L2.
Another example:
.text
.global sub#
.proc sub#
sub:
.prologue
mov rr[r3]=r7
.save rp, r4
ld8 r39 = [r35]
.endp sub#
If you assemble this with -xauto, and and look at the unwind info, you
can see that the .save unwind directive now points at the srlz.d
instruction, which is bad. The .save unwind directive must be moved with
the instruction that it belongs to. This is a fake example, as we can't
use .save rp with a ld8, but the problem is real.
It is also not hard to see that the source file and lineno info will get
messed up, as the inserted instruction will appear to be where the ld8
instruction is.
I think we need to copy the entire CURR_SLOT structure when inserting an
instruction. I don't know offhand if this is safe though, and there is
no easy way to test it. I suspect we just need to try it and see if
anything breaks.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com