aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorSterling Augustine <saugustine@google.com>2010-02-10 20:18:14 +0000
committerSterling Augustine <saugustine@google.com>2010-02-10 20:18:14 +0000
commit3c83b96e241336be0c3e26c06f2bf901d0fe8edd (patch)
tree518908b5b7448ceacd6682c2861c725ac51dad39 /gas/config
parentcdc51b0748c418670cd15476234146993d202449 (diff)
downloadfsf-binutils-gdb-3c83b96e241336be0c3e26c06f2bf901d0fe8edd.zip
fsf-binutils-gdb-3c83b96e241336be0c3e26c06f2bf901d0fe8edd.tar.gz
fsf-binutils-gdb-3c83b96e241336be0c3e26c06f2bf901d0fe8edd.tar.bz2
2010-02-10 Sterling Augustine <sterling@tensilica.com>
* config/tc-xtensa.c (xtensa_find_unaligned_loops): Rewrite.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-xtensa.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 85a3fe7..8345ecb 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -5016,16 +5016,22 @@ xtensa_find_unaligned_loops (bfd *abfd ATTRIBUTE_UNUSED,
addressT frag_addr;
xtensa_format fmt;
- xtensa_insnbuf_from_chars
- (isa, insnbuf, (unsigned char *) frag->fr_literal, 0);
- fmt = xtensa_format_decode (isa, insnbuf);
- op_size = xtensa_format_length (isa, fmt);
- frag_addr = frag->fr_address % xtensa_fetch_width;
-
- if (frag_addr + op_size > xtensa_fetch_width)
- as_warn_where (frag->fr_file, frag->fr_line,
- _("unaligned loop: %d bytes at 0x%lx"),
- op_size, (long) frag->fr_address);
+ if (frag->fr_fix == 0)
+ frag = next_non_empty_frag (frag);
+
+ if (frag)
+ {
+ xtensa_insnbuf_from_chars
+ (isa, insnbuf, (unsigned char *) frag->fr_literal, 0);
+ fmt = xtensa_format_decode (isa, insnbuf);
+ op_size = xtensa_format_length (isa, fmt);
+ frag_addr = frag->fr_address % xtensa_fetch_width;
+
+ if (frag_addr + op_size > xtensa_fetch_width)
+ as_warn_where (frag->fr_file, frag->fr_line,
+ _("unaligned loop: %d bytes at 0x%lx"),
+ op_size, (long) frag->fr_address);
+ }
}
frag = frag->fr_next;
}