🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2474

gcc 1.34 barfs if -a and -p are used together on the sparc

#2474
From: "Douglas C. Schmidt"
Date: Mon, 27 Mar 1989 07:03
87 lines
2108 bytes
Consider the following test program:

----------------------------------------
main ()
{
  printf ("hello world\n");
}
----------------------------------------

When compiled with the -a and -p options on a Sun 4/260 running
Sun OS 4.0, the following occurs:

----------------------------------------
gcc version 1.34
 /usr/public/lib/gnu/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix
 -D__sparc__ -D__sun__ -D__unix__ test.c /tmp/cca28201.cpp 
GNU CPP version 1.34
 /usr/public/lib/gnu/gcc-cc1 /tmp/cca28201.cpp -quiet -dumpbase test.c
 -a -version -p -o /tmp/cca28201.s 
GNU C version 1.34 (sparc) compiled by GNU C version 1.33.9.
 as /tmp/cca28201.s -o test.o
as: "/tmp/cca28201.s", line 28: error: redefinition of symbol "LPB0"
----------------------------------------

Here's the asm:

----------------------------------------
gcc_compiled.:
.text
LC0:
	.ascii "hello world\12\0"
	.align 4
.global _main
	.proc 1
_main:
	!#PROLOGUE# 0
	save %sp,-112,%sp
	!#PROLOGUE# 1
	sethi %hi(LPBX0),%o0
	ld [%lo(LPBX0)+%o0],%o1
	tst %o1
	bne LPB0
	nop
	call ___bb_init_func
	nop
LPB0:
.data
	.align 4
LP0:
	.word 0
.text
	sethi %hi(LP0),%o0
	call mcount
	or %lo(LP0),%o0,%o0
LPB0:
	sethi %hi(LPBX2+0),%g1
	ld [%lo(LPBX2+0)+%g1],%g2
	add %g2,1,%g2
	st %g2,[%lo(LPBX2+0)+%g1]
	sethi %hi(LC0),%o0
	or %lo(LC0),%o0,%o0
	call _printf,0
	nop
L1:
	ret
	restore
.data
	.align 4
LPBX0:
	.word 0
	.word LPBX1
	.word LPBX2
	.word 1
	.word 0
	.word LPBX3
LPBX1:
	.ascii "test.c\0"
LPBX2:
	.skip 4
.text
LPBX3:
	.word LPB0
	.word LPBX3
----------------------------------------

Doug
Technical Details
Message-ID: <8903262303.aa15214@PARIS.ICS.UCI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!GLACIER.ICS.UCI.EDU!schmidt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!GLACIER.ICS.UCI.EDU!schmidt
From: schmidt@GLACIER.ICS.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.gcc.bug
Subject: gcc 1.34 barfs if -a and -p are used together on the sparc
Message-ID: <8903262303.aa15214@PARIS.ICS.UCI.EDU>
Date: 27 Mar 89 07:03:20 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 87