This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix for the gas problems when compiled with SunPRO


On Tue, Jun 08, 1999 at 08:13:15PM -0700, Richard Henderson wrote:
> On Tue, Jun 08, 1999 at 07:34:50PM +0200, Jakub Jelinek wrote:
> > I found one bug where set 0xffff, %o1 was mis-assembled, so this patch fixes
> > it, plus it makes compiler happy when sizeof(bfd_vma) is 4 (this could
> > fix H.J.'s bug, at least elf32_sparc only Linux as works just fine).
> 
> SunOS lisa.cygnus.com 5.5.1 Generic_103640-24 sun4u sparc
> 
> .../gas/sparc-solaris/sol-cc.s: Assembler messages:
> .../gas/sparc-solaris/sol-cc.s:10: Error: Illegal operands
> .../gas/sparc-solaris/sol-cc.s:11: Error: Illegal operands
> .../gas/sparc-solaris/sol-cc.s:12: Error: Illegal operands
> .../gas/sparc-solaris/sol-cc.s:14: Error: Illegal operands
> .../gas/sparc-solaris/sol-cc.s:16: Error: Illegal operands
> FAIL: SPARC Solaris cc -g

Ok, I see. In fact gas worked on Solaris 7 if compiled by gcc, but finally I
found similar case on Solaris 2.5.1 compiled with SunPRO.

The issue is someone changed definition of isoctal() macro so that it
evaluates the expression twice. So if the bug did not show up before my
recent patches, it was just a coincidence. In fact I wonder why it worked
when compiled with gcc 2.8 (I was using gas-990422 on Linux).

BTW: Even with this patch in it is desirable to have the set 0xffff, %o1
bug fixed (see my patch from yesterday).

1999-06-09  Jakub Jelinek  <jj@ultra.linux.cz>

	* config/tc-sparc.c (sparc_ip): As isoctal may evaluate argument
	more than once, make sure it is not used with side-effect
	expressions.

--- config/sparc/tc-sparc.c.jj	Wed Jun  9 09:52:07 1999
+++ config/sparc/tc-sparc.c	Wed Jun  9 13:51:52 1999
@@ -1765,7 +1765,8 @@
 		      goto error;
 
 		    case 'g':	/* global register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = c - '0';
 			  break;
@@ -1773,7 +1774,8 @@
 		      goto error;
 
 		    case 'i':	/* in register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = c - '0' + 24;
 			  break;
@@ -1781,7 +1783,8 @@
 		      goto error;
 
 		    case 'l':	/* local register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = (c - '0' + 16);
 			  break;
@@ -1789,7 +1792,8 @@
 		      goto error;
 
 		    case 'o':	/* out register */
-		      if (isoctal (c = *s++))
+		      c = *s++;
+		      if (isoctal (c))
 			{
 			  mask = (c - '0' + 8);
 			  break;


Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux  |  http://ultra.linux.cz/  |  http://ultra.penguin.cz/
Linux version 2.3.4 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]