[gnu.gcc.bug] GAS-1.25 bug

gnu@GATECH.EDU (11/12/88)

Hello,

    On my system, I am using gas-1.25 with gcc-1.30 on a 68020 based machine.
The problem this report is addressing is when the flag "-m68000" is passed
to gcc saying that we wish to generate m68000 code (versus 68020 code). The
flag that is passed to gas is "-m68010". While this is strange since a 68000
was specified, this detail is not the problem. The problem is that gas
incorrectly generates 68020 style relative branches and subroutine calls
when the 68010 processor is specified. The 68010 does not support "long"
relative branches or subroutine calls (bsr). The fix for this problem resides
in the module "as.c" of gas. Near line 155 of as.c, a test for the flags
-m68000, -m68010 and -m68020 are made. The assignment of a "0" to
"flagseen[a]" for the 68010 case is incorrect; it should be a two (2).
Otherwise 68020 branches are produced. The code changed is from:

			case 'm':
				/* Gas simply ignores this option! */
				if(*arg=='c')
					arg++;
				if(!strcmp(arg,"68000"))
					flagseen[a]=2;
				else if(!strcmp(arg,"68010"))
|					flagseen[a]=0;
				else if(!strcmp(arg,"68020"))
					flagseen[a]=0;
				else
					as_warn("Unknown -m option ignored");
				while(*arg)
					arg++;
				break;

to be:

			case 'm':
				/* Gas simply ignores this option! */
				if(*arg=='c')
					arg++;
				if(!strcmp(arg,"68000"))
					flagseen[a]=2;
				else if(!strcmp(arg,"68010"))
|					flagseen[a]=2;
				else if(!strcmp(arg,"68020"))
					flagseen[a]=0;
				else
					as_warn("Unknown -m option ignored");
				while(*arg)
					arg++;
				break;



Thank you for your attention to this matter. If there are any further
questions, please feel free to call.


Allan G. Schrum
3060 Business Park Drive, Ste. E
Norcross, GA 30071

...!gatech!rebel!didsgn!{gnu|allan}