🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2620

Optimization problem w/1.34 (Sun-3/280, SunOS 3.5)

#2620
From: Anton Rang
Date: Wed, 10 May 1989 20:25
36 lines
1391 bytes
I haven't tested this with 1.35 yet, but the code:

	static int x, y, z;

	void main(void)
	{
	  x = y = z = -1;
	}

generates this rather non-optimal assembly....

	#NO_APP
	gcc_compiled.:
	.text
		.even
	.globl _main
	_main:
		link a6,#0
		moveq #-1,d0		<-- put negative 1 into register d0
		movel d0,_z
		moveq #-1,d0		<-- do it again
		movel d0,_y
		moveq #-1,d0		<-- and again
		movel d0,_x
		unlk a6
		rts
	.lcomm _z,4
	.lcomm _y,4
	.lcomm _x,4

+---------------------------+------------------------+-------------------+
| Anton Rang (grad student) | "VMS Forever!"         | VOTE on	         |
| Michigan State University | rang@cpswh.cps.msu.edu | rec.music.newage! |
+---------------------------+------------------------+-------------------+
| Send votes for/against rec.music.newage to "rang@cpswh.cps.msu.edu".   |
+---------------------------+------------------------+-------------------+
Technical Details
Message-ID: <2934@cps3xx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gatech!ncar!tank!eecae!cps3xx!rang

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gatech!ncar!tank!eecae!cps3xx!rang
From: rang@cpsin3.cps.msu.edu (Anton Rang)
Newsgroups: gnu.gcc.bug
Subject: Optimization problem w/1.34 (Sun-3/280, SunOS 3.5)
Message-ID: <2934@cps3xx.UUCP>
Date: 10 May 89 20:25:16 GMT
Sender: usenet@cps3xx.UUCP
Reply-To: rang@cpswh.cps.msu.edu (Anton Rang)
Organization: Michigan State University, Computer Science Dept.
Lines: 36