Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!UX.ACSS.UMN.EDU!m4 From: m4@UX.ACSS.UMN.EDU Newsgroups: gnu.gcc.bug Subject: Sun 3, gcc-1.36, (doprnt.c from tahoe library) Message-ID: <8912050439.AA17754@life.ai.mit.edu> Date: 5 Dec 89 04:39:57 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 50 On a Sun3, using gcc version 1.36, notice the generated "movel d0,sp"!!! gcc -ffixed-a2 -ffixed-a3 -ffixed-a4 -ffixed-a5 -ffixed-d3 -S A.c ------ file A.c ------ typedef unsigned char u_char; typedef char *va_list; # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] extern struct _iobuf { int _cnt; unsigned char *_ptr; unsigned char *_base; int _bufsiz; short _flag; char _file; } _iob[]; _doprnt(fmt0, argp, fp) u_char *fmt0; va_list argp; struct _iobuf *fp; { double _double; _double = va_arg(argp, double); _double = -_double; } ------ file A.s -------- #NO_APP gcc_compiled.: .text .even .globl __doprnt __doprnt: link a6,#-12 movel a6@(12),d0 addql #8,d0 movel d0,a6@(-12) movel a6@(-12),a6@(12) movel d0,sp | WOW!!!!! movel sp@(-8),a0 movel sp@(-4),a1 movel a0,a6@(-8) movel a1,a6@(-4) movel #___negdf2,d0 movel a6@(-4),sp@- movel a6@(-8),sp@- jbsr ___negdf2 addqw #8,sp movel d0,d0 movel d1,d1 movel d0,a6@(-8) movel d1,a6@(-4) L1: unlk a6 rts