(FWD) Re: ** potential patch for 2.10 ** DEC Alpha bug relatedto AT register

Doug Rabson dfr@nlsystems.com
Wed Jun 7 01:13:00 GMT 2000


David has asked me to comment on this minor patch to binutils to try to
get it included in the 2.10 release. I have been working with the alpha
architecture for several years and I did the original FreeBSD/alpha kernel
port to this architecture.

The background to this fix is that the alpha assembler includes a number
of builtin 'macros' to make life easier for the assembly language
programmer. These macros perform such chores as loading large constants,
performing byte/word sized loads and stores, loading addresses etc.

Since some of these macros require the use of a scratch register, normally
integer register 28 (often called $at) is reserved by the assembler. This
reservation can be controlled with the ".set noat" and ".set
at" directives. The assembler warns about uses of $at when ".set at" is in
effect.

The bug is simple. The code attempts to check for dangerous uses of
register 28 but inadvertantly the test used is also true for $f28 (which
is not used by any macro). This means that any code which uses $f28 will
generate a bogus warning. The patch adjusts the test so that it is only
true for $at.


Index: tc-alpha.c
===================================================================
RCS file: /home/ncvs/src/contrib/binutils/gas/config/tc-alpha.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 tc-alpha.c
--- tc-alpha.c	2000/05/12 23:14:56	1.1.1.3
+++ tc-alpha.c	2000/06/07 08:08:33
@@ -1372,7 +1372,7 @@
 	  else
 	    break;
 
-	  if (!alpha_noat_on && num == AXP_REG_AT)
+	  if (!alpha_noat_on && (num + is_float) == AXP_REG_AT)
 	    as_warn(_("Used $at without \".set noat\""));
 	  return alpha_register_table[num + is_float];
 


-- 
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 20 8442 9037




More information about the Binutils mailing list