removed z80_optimize_expr; redundant since 2006-04-04
authorArnold Metselaar <arnold.metselaar@planet.nl>
Sun, 9 Apr 2006 18:08:08 +0000 (18:08 +0000)
committerArnold Metselaar <arnold.metselaar@planet.nl>
Sun, 9 Apr 2006 18:08:08 +0000 (18:08 +0000)
gas/ChangeLog
gas/config/tc-z80.c
gas/config/tc-z80.h

index 925d033ca80202cef246373313d3bca3c5f2356c..6fcec6b2006316e4d27ac1d015cb7fbd08f4297e 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-09  Arnold Metselaar  <arnold.metselaar@planet.nl>
+
+       * config/tc-z80.c (z80_optimize_expr): Removed; redundant since 2006-04-04.
+       * config/tc-z80.h (z80_optimize_expr, md_optimize_expr): Removed.
+
 2006-04-07  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
 
        * gas/config/tc-avr.c (mcu_types): Add support for attiny261,
index 76d46f55492104e4dbc66b50dc47cb8623445a3b..413e336a2c89194d02ee9b335fe210dd0c50a21e 100644 (file)
@@ -460,70 +460,6 @@ check_mach (int ins_type)
   ins_used |= ins_type;
 }
 
-/* This function tries to subtract two symbols, the generic code does
-   that too, but this function tries harder.
-   The behaviour of this function is not altered by extra
-   fragmentations caused by the code to produce listings.  */
-int
-z80_optimize_expr (expressionS *resultP, operatorT left_op,
-                  expressionS *right)
-{
-  int res, swap, som;
-  fragS *lfrag, *rfrag, *cur;
-
-  res = 0;
-  if (left_op == O_subtract
-      && right->X_op == O_symbol
-      && resultP->X_op == O_symbol)
-    {
-      lfrag = symbol_get_frag (resultP->X_add_symbol);
-      rfrag = symbol_get_frag (right->X_add_symbol);
-
-      if (S_GET_SEGMENT (right->X_add_symbol) !=  undefined_section
-         && (S_GET_SEGMENT (right->X_add_symbol)
-             == S_GET_SEGMENT (resultP->X_add_symbol)))
-       {
-         for (swap = 0; (res == 0) && (swap < 2); ++swap)
-           {
-             if (swap)
-               {
-                 cur = lfrag;
-                 lfrag = rfrag;
-                 rfrag = cur;
-               }
-             else
-               cur = rfrag;
-
-             /* Now som == cur->fr_address - rfrag->address, except
-                the latter may not have been computed yet.  */
-             for (som = 0; cur && cur != lfrag; cur = cur->fr_next)
-               {
-                 if (cur->fr_type == rs_fill) /* Is the size fized?  */
-                   som += cur->fr_fix+cur->fr_offset*cur->fr_var;
-                 else
-                   break;
-               }
-
-             if  (cur == lfrag)
-               {
-                 resultP->X_add_number -= right->X_add_number;
-                 resultP->X_add_number
-                   += (S_GET_VALUE (resultP->X_add_symbol)
-                       - S_GET_VALUE (right->X_add_symbol));
-                 som -= lfrag->fr_address - rfrag->fr_address;
-                 /* Correct the result if the fr_address
-                    fields are not computed yet.  */
-                 resultP->X_add_number += (swap ? -som : som);
-                 resultP->X_op = O_constant;
-                 resultP->X_add_symbol = 0;
-                 res = 1;
-               }
-           }
-       }
-    }
-  return res;
-}
-
 /* Check whether an expression is indirect.  */
 static int
 is_indir (const char *s)
index 0ae318af57590a639f5a4902cda77c1971f3481e..0021fb3943a7881f00bae8f8dd91aaa50d599f0f 100644 (file)
 /* Define some functions to be called by generic code.  */
 #define md_end               z80_md_end
 #define md_start_line_hook() { if (z80_start_line_hook ()) continue; }
-#define md_optimize_expr     z80_optimize_expr
 #define TC_CONS_FIX_NEW z80_cons_fix_new
 
 extern void z80_md_end (void);
 extern int z80_start_line_hook (void);
-extern int z80_optimize_expr (expressionS *, operatorT, expressionS *);
 extern void z80_cons_fix_new (fragS *, int, int, expressionS *);
 
 #define WORKING_DOT_WORD