public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Last of the gas cleanups
@ 2005-01-31 23:40 Ben Elliston
  2005-02-01  0:22 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Elliston @ 2005-01-31 23:40 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 4800 bytes --]

This little patch keeps code wrapped in #if 1 and removes any #else
cases.  Okay for mainline?

Ben

2005-02-01  Ben Elliston  <bje@au.ibm.com>

	* config/obj-coff.c, config/obj-ieee.c, config/tc-alpha.c,
	config/tc-i860.c, config/tc-ia64.c: Keep #if 1 code.

Index: config/obj-coff.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/obj-coff.c,v
retrieving revision 1.76
diff -u -p -u -r1.76 obj-coff.c
--- config/obj-coff.c	31 Jan 2005 23:18:24 -0000	1.76
+++ config/obj-coff.c	31 Jan 2005 23:39:58 -0000
@@ -4189,8 +4189,6 @@ fixup_mdeps (frags, h, this_segment)
     }
 }
 
-#if 1
-
 #ifndef TC_FORCE_RELOCATION
 #define TC_FORCE_RELOCATION(fix) 0
 #endif
@@ -4377,7 +4375,6 @@ fixup_segment (segP, this_segment_type)
 		  sub_symbolP = 0;
 		  fixP->fx_subsy = 0;
 		}
-#endif
 	      else
 		{
 		  as_bad_where (fixP->fx_file, fixP->fx_line,
Index: config/obj-ieee.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/obj-ieee.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 obj-ieee.c
--- config/obj-ieee.c	31 Jan 2005 23:18:24 -0000	1.10
+++ config/obj-ieee.c	31 Jan 2005 23:39:58 -0000
@@ -482,8 +482,6 @@ obj_symbol_new_hook (symbolP)
   symbolP->sy_symbol.sy.the_bfd = abfd;
 }
 
-#if 1
-
 #ifndef SUB_SEGMENT_ALIGN
 #ifdef HANDLE_ALIGN
 /* The last subsegment gets an alignment corresponding to the alignment
@@ -569,8 +567,6 @@ write_object_file ()
   bfd_as_write_hook ();
   bfd_close (abfd);
 }
-
-#endif
 
 H_SET_TEXT_SIZE (a, b)
 {
Index: config/tc-alpha.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/tc-alpha.c,v
retrieving revision 1.63
diff -u -p -u -r1.63 tc-alpha.c
--- config/tc-alpha.c	31 Jan 2005 23:18:25 -0000	1.63
+++ config/tc-alpha.c	31 Jan 2005 23:39:58 -0000
@@ -159,30 +159,17 @@ struct alpha_macro
 /* XXX: The non-shift version appears to trigger a compiler bug when
    cross-assembling from x86 w/ gcc 2.7.2.  */
 
-#if 1
 #define range_signed_16(x) \
 	(((offsetT) (x) >> 15) == 0 || ((offsetT) (x) >> 15) == -1)
 #define range_signed_32(x) \
 	(((offsetT) (x) >> 31) == 0 || ((offsetT) (x) >> 31) == -1)
-#else
-#define range_signed_16(x)	((offsetT) (x) >= -(offsetT) 0x8000 &&	\
-				 (offsetT) (x) <=  (offsetT) 0x7FFF)
-#define range_signed_32(x)	((offsetT) (x) >= -(offsetT) 0x80000000 && \
-				 (offsetT) (x) <=  (offsetT) 0x7FFFFFFF)
-#endif
 
 /* Macros for sign extending from 16- and 32-bits.  */
 /* XXX: The cast macros will work on all the systems that I care about,
    but really a predicate should be found to use the non-cast forms.  */
 
-#if 1
 #define sign_extend_16(x)	((short) (x))
 #define sign_extend_32(x)	((int) (x))
-#else
-#define sign_extend_16(x)	((offsetT) (((x) & 0xFFFF) ^ 0x8000) - 0x8000)
-#define sign_extend_32(x)	((offsetT) (((x) & 0xFFFFFFFF) \
-					   ^ 0x80000000) - 0x80000000)
-#endif
 
 /* Macros to build tokens.  */
 
Index: config/tc-i860.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/tc-i860.c,v
retrieving revision 1.27
diff -u -p -u -r1.27 tc-i860.c
--- config/tc-i860.c	31 Oct 2003 21:33:59 -0000	1.27
+++ config/tc-i860.c	31 Jan 2005 23:39:58 -0000
@@ -454,21 +454,14 @@ static void
 i860_process_insn (char *str)
 {
   char *s;
-  const char *args;
+  const char *args = 0;
   char c;
-  struct i860_opcode *insn;
-  char *args_start;
-  unsigned long opcode;
+  struct i860_opcode *insn = 0;
+  char *args_start = 0;
+  unsigned long opcode = 0;
   unsigned int mask;
   int match = 0;
   int comma = 0;
-
-#if 1 /* For compiler warnings.  */
-  args = 0;
-  insn = 0;
-  args_start = 0;
-  opcode = 0;
-#endif
 
   for (s = str; ISLOWER (*s) || *s == '.' || *s == '3'
        || *s == '2' || *s == '1'; ++s)
Index: config/tc-ia64.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/tc-ia64.c,v
retrieving revision 1.128
diff -u -p -u -r1.128 tc-ia64.c
--- config/tc-ia64.c	31 Jan 2005 23:18:29 -0000	1.128
+++ config/tc-ia64.c	31 Jan 2005 23:39:58 -0000
@@ -11198,16 +11198,11 @@ 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.  */


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Last of the gas cleanups
  2005-01-31 23:40 Last of the gas cleanups Ben Elliston
@ 2005-02-01  0:22 ` Andreas Schwab
  2005-02-01  2:44   ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2005-02-01  0:22 UTC (permalink / raw)
  To: Ben Elliston; +Cc: binutils

"Ben Elliston" <bje@au1.ibm.com> writes:

> Index: config/tc-alpha.c
> ===================================================================
> RCS file: /home/bje/src-cvs/src/gas/config/tc-alpha.c,v
> retrieving revision 1.63
> diff -u -p -u -r1.63 tc-alpha.c
> --- config/tc-alpha.c	31 Jan 2005 23:18:25 -0000	1.63
> +++ config/tc-alpha.c	31 Jan 2005 23:39:58 -0000
> @@ -159,30 +159,17 @@ struct alpha_macro
>  /* XXX: The non-shift version appears to trigger a compiler bug when
>     cross-assembling from x86 w/ gcc 2.7.2.  */
>  
> -#if 1
>  #define range_signed_16(x) \
>  	(((offsetT) (x) >> 15) == 0 || ((offsetT) (x) >> 15) == -1)
>  #define range_signed_32(x) \
>  	(((offsetT) (x) >> 31) == 0 || ((offsetT) (x) >> 31) == -1)
> -#else
> -#define range_signed_16(x)	((offsetT) (x) >= -(offsetT) 0x8000 &&	\
> -				 (offsetT) (x) <=  (offsetT) 0x7FFF)
> -#define range_signed_32(x)	((offsetT) (x) >= -(offsetT) 0x80000000 && \
> -				 (offsetT) (x) <=  (offsetT) 0x7FFFFFFF)
> -#endif
>  
>  /* Macros for sign extending from 16- and 32-bits.  */
>  /* XXX: The cast macros will work on all the systems that I care about,
>     but really a predicate should be found to use the non-cast forms.  */
>  
> -#if 1
>  #define sign_extend_16(x)	((short) (x))
>  #define sign_extend_32(x)	((int) (x))
> -#else
> -#define sign_extend_16(x)	((offsetT) (((x) & 0xFFFF) ^ 0x8000) - 0x8000)
> -#define sign_extend_32(x)	((offsetT) (((x) & 0xFFFFFFFF) \
> -					   ^ 0x80000000) - 0x80000000)
> -#endif

These should probably go the other way round.  The disabled alternatives
are more portable in the long run.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Last of the gas cleanups
  2005-02-01  0:22 ` Andreas Schwab
@ 2005-02-01  2:44   ` Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2005-02-01  2:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Ben Elliston, binutils

On Tue, Feb 01, 2005 at 01:22:21AM +0100, Andreas Schwab wrote:
> "Ben Elliston" <bje@au1.ibm.com> writes:
> 
> > Index: config/tc-alpha.c
> > ===================================================================
> > RCS file: /home/bje/src-cvs/src/gas/config/tc-alpha.c,v
> > retrieving revision 1.63
> > diff -u -p -u -r1.63 tc-alpha.c
> > --- config/tc-alpha.c	31 Jan 2005 23:18:25 -0000	1.63
> > +++ config/tc-alpha.c	31 Jan 2005 23:39:58 -0000
> > @@ -159,30 +159,17 @@ struct alpha_macro
> >  /* XXX: The non-shift version appears to trigger a compiler bug when
> >     cross-assembling from x86 w/ gcc 2.7.2.  */
> >  
> > -#if 1
> >  #define range_signed_16(x) \
> >  	(((offsetT) (x) >> 15) == 0 || ((offsetT) (x) >> 15) == -1)
> >  #define range_signed_32(x) \
> >  	(((offsetT) (x) >> 31) == 0 || ((offsetT) (x) >> 31) == -1)
> > -#else
> > -#define range_signed_16(x)	((offsetT) (x) >= -(offsetT) 0x8000 &&	\
> > -				 (offsetT) (x) <=  (offsetT) 0x7FFF)
> > -#define range_signed_32(x)	((offsetT) (x) >= -(offsetT) 0x80000000 && \
> > -				 (offsetT) (x) <=  (offsetT) 0x7FFFFFFF)
> > -#endif
> >  
> >  /* Macros for sign extending from 16- and 32-bits.  */
> >  /* XXX: The cast macros will work on all the systems that I care about,
> >     but really a predicate should be found to use the non-cast forms.  */
> >  
> > -#if 1
> >  #define sign_extend_16(x)	((short) (x))
> >  #define sign_extend_32(x)	((int) (x))
> > -#else
> > -#define sign_extend_16(x)	((offsetT) (((x) & 0xFFFF) ^ 0x8000) - 0x8000)
> > -#define sign_extend_32(x)	((offsetT) (((x) & 0xFFFFFFFF) \
> > -					   ^ 0x80000000) - 0x80000000)
> > -#endif
> 
> These should probably go the other way round.  The disabled alternatives
> are more portable in the long run.

Agreed, except that the cast to offsetT should be applied to (x) in
sign_extend_*.

> --- config/tc-ia64.c	31 Jan 2005 23:18:29 -0000	1.128
> +++ config/tc-ia64.c	31 Jan 2005 23:39:58 -0000
> @@ -11198,16 +11198,11 @@ 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=3Dar.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.  */

And this patch loses the "It" the comment is referring to.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-01  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-31 23:40 Last of the gas cleanups Ben Elliston
2005-02-01  0:22 ` Andreas Schwab
2005-02-01  2:44   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).