Catch and ignore empty, ineffectual alignment frags when deciding if a
authorNick Clifton <nickc@redhat.com>
Fri, 6 Jul 2001 08:21:35 +0000 (08:21 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 6 Jul 2001 08:21:35 +0000 (08:21 +0000)
branch can be short.

gas/ChangeLog
gas/config/tc-m68k.c

index 860b8a8e39150756815c99dbfbf1b767efeba1f1..d5d4c18f0ff886480d199a3cff3869106023aa13 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-06  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * config/tc-m68k.c (md_estimate_size_before_relax): Catch and
+       ignore empty, ineffectual alignment frags when deciding if a
+       branch can be short.
+
 2001-07-05  Steve Ellcey  <sje@cup.hp.com>
 
        * config/tc-ia64.c (special_section): Add SPECIAL_SECTION_INIT_ARRAY
index e14c8cb821c06b1eac60ba508d7596c43f84dacc..a15d9f516a93a99a631b2af73774cda4362d5ceb 100644 (file)
@@ -4694,13 +4694,25 @@ md_estimate_size_before_relax (fragP, segment)
          fragS *l;
 
          stop = symbol_get_frag (fragP->fr_symbol);
+
          for (l = fragP->fr_next; l != stop; l = l->fr_next)
-           if (l->fr_fix + l->fr_var != 0)
-             break;
-         if (l == stop)
            {
-             fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
+             /* Catch empty alignment frags whoes fr_offset field
+                is an alignment requirement of 2 bytes.  The check
+                below will misinterpret this as evidence that real
+                code exists between the symbol and the instruction
+                and so will not convert the short jump into a word
+                jump.  */
+             if (l->fr_fix == 0
+                 && l->fr_var == 1
+                 && (l->fr_type == rs_align || l->fr_type == rs_align_code))
+               continue;
+    
+             if (l->fr_fix + l->fr_var != 0)
+               break;
            }
+         if (l == stop)
+           fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
        }
       break;
     default:
This page took 0.031375 seconds and 4 git commands to generate.