[gnu.gcc.bug] Optimization problem w/1.34

rang@cpsin3.cps.msu.edu (Anton Rang) (05/11/89)

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".   |
+---------------------------+------------------------+-------------------+