Subject: Re: asm() bugs
To: Taras Ivanenko <ivanenko@ctpa03.mit.edu>
From: Allen Briggs <briggs@puma.bevd.blacksburg.va.us>
List: port-mac68k
Date: 05/14/1996 09:20:48
> When was the last time you checked the *assembler* output of the
> compiler?

How often does anyone but compiler or assembler folks?

> 	asm("	movl	d1, %0
> 		movl	d0, %1"
> !		: "=g" (trapword), "=g" (numbytes)
> +	    :: "d0", "d1");
> 
> and here is the assembler output for this function:
> 
> _mrg_NewPtr:
> 	link a6,#0
> 	moveml #0x2030,sp@-
> 	clrl d2
> #APP
> 		movl	d1, d0
> 		movl	d0, a3
> #NO_APP

This looks like a bug in gcc.  In the asm() statement, d1 and d0
are not bashed.  They're used, but not as destinations for the movls.
The compiler should automatically consider the registers for the
referenced variables to be considered bashed.  Especially as they
are marked as "output" operands.

Any gcc hackers out there?

-allen

-- 
  Allen Briggs - end killing - briggs@bev.net ** MacBSD == NetBSD/mac68k **
   Where does all my time go?  <a href="http://www.netbsd.org/">Guess.</a>