From: graham@convex.com (Marv Graham)
Subject: gcc-2.2.2 and gcc-2.3.1 problems on PA-RISC system
Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
Distribution: gnu
Date: Thu, 5 Nov 1992 19:25:25 GMT

% echo $g22
/utah/gcc/bsd-2.2.2/gcc -B/utah/gcc/bsd-2.2.2/
%
% $g22 -S -v hello.c
Reading specs from /utah/gcc/bsd-2.2.2/specs
gcc version 2.2.2
 /utah/gcc/bsd-2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__unix__ -D___HPUX_SOURCE__ -D__hp9000__ -D__hp800__ -D__spectrum__ -D__REVARGV__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__unix -D___HPUX_SOURCE -D__hp9000 -D__hp800 -D__spectrum -D__REVARGV hello.c /utah/gcc/bsd-2.2.2/cc004535.i
GNU CPP version 2.2.2 (hp9000s800)
 /utah/gcc/bsd-2.2.2/cc1 /utah/gcc/bsd-2.2.2/cc004535.i -quiet -dumpbase hello.c -version -o hello.s
GNU C version 2.2.2 (hp9000s800) compiled by CC.
% 
% mv hello.s g22.s
% 
% echo $g23
/utah/gcc/bsd-2.3.1/gcc -B/utah/gcc/bsd-2.3.1/
%
% $g23 -S -v hello.c
Reading specs from /utah/gcc/bsd-2.3.1/specs
gcc version 2.3.1
 /utah/gcc/bsd-2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__unix__ -D___HPUX_SOURCE__ -D__hp9000__ -D__hp800__ -D__spectrum__ -D__REVARGV__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__unix -D___HPUX_SOURCE -D__hp9000 -D__hp800 -D__spectrum -D__REVARGV hello.c /utah/gcc/bsd-2.2.2/cc004539.i
GNU CPP version 2.3.1 (hppa)
 /utah/gcc/bsd-2.3.1/cc1 /utah/gcc/bsd-2.2.2/cc004539.i -quiet -dumpbase hello.c -version -o hello.s
GNU C version 2.3.1 (hppa) compiled by CC.
% 
% mv hello.s g23.s
% 
% gcc-as -v -o g22.o g22.s
GNU assembler version 1.36
%
% gcc-as g23.s
GNU assembler version 1.36
g23.s:20:
% ls -lt
total 654
-rw-rw-r--   1 graham   system       777 Nov 05 12:48 g23.s
-rw-rw-r--   1 graham   system       856 Nov 05 12:27 g22.o
-rw-rw-r--   1 graham   system       713 Nov 05 12:47 g22.s

File g22.s is
	.SPACE $PRIVATE$
	.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
	.SPACE $TEXT$
	.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
	.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
	.IMPORT $global$,DATA
	.IMPORT $$dyncall,MILLICODE
; gcc_compiled.:
	.IMPORT __main,CODE
	.IMPORT printf,CODE
	.SPACE $TEXT$
	.SUBSPA $CODE$

	.align 4
LC$0000
	.STRING "Hello world!\x0a\x00"
	.align 4
	.EXPORT main
	.EXPORT main,PRIV_LEV=3,RTNVAL=GR
main
	.PROC
	.CALLINFO FRAME=128,CALLS,SAVE_RP
	.ENTRY
	stw 2,-20(0,30)
	copy 4,1
	copy 30,4
	stwm 1,128(0,30)
	.CALL 
	bl __main,2
	nop
	ldil L'LC$0000,%r26
	ldo R'LC$0000(%r26),%r26
	.CALL ARGW0=GR
	bl printf,2
	nop
L$0001
	ldo 8(4),30
	ldw -28(0,30),2
	bv 0(2)
	ldwm -8(30),4
	.EXIT
	.PROCEND

gcc-as doesn't like the SUBSPA $BSS$ in g23.s
There are some other lines it doesn't like either, but I don't know what they are.
File g23.s is
	.SPACE $PRIVATE$
	.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
	.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
	.SPACE $TEXT$
	.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
	.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
	.IMPORT $global$,DATA
	.IMPORT $$dyncall,MILLICODE
; gcc_compiled.:
	.IMPORT __main,CODE
	.IMPORT printf,CODE
	.SPACE $TEXT$
	.SUBSPA $CODE$

	.align 4
LC$0000
	.STRING "Hello world!\x0a\x00"
	.align 4
	.EXPORT main,CODE
	.EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
main
	.PROC
	.CALLINFO FRAME=128,CALLS,SAVE_RP
	.ENTRY
	stw 2,-20(0,30)
	copy 4,1
	copy 30,4
	stwm 1,128(0,30)
	.CALL 
	bl __main,2
	nop
	ldil L'LC$0000,%r26
	ldo R'LC$0000(%r26),%r26
	.CALL ARGW0=GR
	bl printf,2
	nop
L$0001
	ldo 8(4),30
	ldw -28(0,30),2
	bv 0(2)
	ldwm -8(30),4
	.EXIT
	.PROCEND

ANOTHER QUESTION/PROBLEM:
An older gcc on the system does this:

% gcc -v hello.c
gcc version 1.37.9
 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dhp700 -DHP700 -Dparisc -D__pa_risc -DPARISC -DBYTE_MSF -DBIT_MSF -D__hp700__ -D__HP700__ -D__parisc__ -D____pa_risc__ -D__PARISC__ -D__BYTE_MSF__ -D__BIT_MSF__ hello.c /utah/gcc/bsd-2.2.2/cc004579.cpp
GNU CPP version 1.37.9
 /usr/local/lib/gcc-cc1 /utah/gcc/bsd-2.2.2/cc004579.cpp -quiet -dumpbase hello.c -version -o /utah/gcc/bsd-2.2.2/cc004579.s
GNU C version 1.39 (hp9000s800) compiled by CC.
default target switches:
 /usr/local/lib/gcc-as -o hello.o /utah/gcc/bsd-2.2.2/cc004579.s
 /usr/local/lib/gcc-ld -u main /usr/local/lib/crt0.o -L/usr/local/lib hello.o /usr/local/lib/libc.a

$g22 uses the system's as and fails:
$g22 -v hello.c
Reading specs from /utah/gcc/bsd-2.2.2/specs
gcc version 2.2.2
 /utah/gcc/bsd-2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__unix__ -D___HPUX_SOURCE__ -D__hp9000__ -D__hp800__ -D__spectrum__ -D__REVARGV__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__unix -D___HPUX_SOURCE -D__hp9000 -D__hp800 -D__spectrum -D__REVARGV hello.c /utah/gcc/bsd-2.2.2/cc004559.i
GNU CPP version 2.2.2 (hp9000s800)
 /utah/gcc/bsd-2.2.2/cc1 /utah/gcc/bsd-2.2.2/cc004559.i -quiet -dumpbase hello.c -version -o /utah/gcc/bsd-2.2.2/cc004559.s
GNU C version 2.2.2 (hp9000s800) compiled by CC.
 as -o hello.o /utah/gcc/bsd-2.2.2/cc004559.s
(00031) 	ldil L'LC$0000,%r26
******* Line 31 : [Error 45]  Illegal relocatable address in source field.
(00032) 	ldo R'LC$0000(%r26),%r26
******* Line 32 : [Error 45]  Illegal relocatable address in source field.
2 errors, no warnings, AS rev 0.36

$g23 also fails:
Reading specs from /utah/gcc/bsd-2.3.1/specs
gcc version 2.3.1
 /utah/gcc/bsd-2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__unix__ -D___HPUX_SOURCE__ -D__hp9000__ -D__hp800__ -D__spectrum__ -D__REVARGV__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__unix -D___HPUX_SOURCE -D__hp9000 -D__hp800 -D__spectrum -D__REVARGV hello.c /utah/gcc/bsd-2.2.2/cc004585.i
GNU CPP version 2.3.1 (hppa)
 /utah/gcc/bsd-2.3.1/cc1 /utah/gcc/bsd-2.2.2/cc004585.i -quiet -dumpbase hello.c -version -o /utah/gcc/bsd-2.2.2/cc004585.s
GNU C version 2.3.1 (hppa) compiled by CC.
 as -o /utah/gcc/bsd-2.2.2/cc0045851.o /utah/gcc/bsd-2.2.2/cc004585.s
(00003) 	.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
******* Line 3 : [Error 92]  Invalid operand
(00032) 	ldil L'LC$0000,%r26
******* Line 32 : [Error 45]  Illegal relocatable address in source field.
(00033) 	ldo R'LC$0000(%r26),%r26
******* Line 33 : [Error 45]  Illegal relocatable address in source field.
3 errors, no warnings, AS rev 0.36

WHAT DO I HAVE TO DO WHERE TO MAKE gcc-2.2.2 (and 2.3.1) USE 
	/usr/local/lib/gcc-as
	/usr/local/lib/gcc-ld		The systen ld fails too..

CURIOUSLY, gcc-as ACCEPTS g22.s, BUT FAILS ON g23.s (EVEN WITH THE $BSS$ LINE REMOVED)

Newsgroups: gnu.gcc.bug