delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/09/12:46:15

From: Eric Rudd <rudd AT cyberoptics DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Possible gcc bug
Date: Tue, 09 Jun 1998 11:03:12 -0500
Organization: CyberOptics
Lines: 37
Message-ID: <357D5CC0.212234B0@cyberoptics.com>
References: <357D578B DOT 1088A0F9 AT cyberoptics DOT com>
Reply-To: rudd AT cyberoptics DOT com
NNTP-Posting-Host: rudd.cyberoptics.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eric Rudd wrote:
> 
> I have isolated what I think is a register-allocation bug in gcc

Sorry, the attachment got lost on my end; here it is:

	.file	"bad.c"
gcc2_compiled.:
___gnu_compiled_c:
.text
	.align 4
.globl _alias
_alias:
	pushl %ebp
	movl %esp,%ebp
	pushl %esi
	pushl %ebx
	movl 8(%ebp),%esi
	movl %esi,%eax
	movl 12(%ebp),%ebx
/APP
	
      xorl  %eax, %eax
      xorl  %edx, %edx
      xorl  %ecx, %ecx
   
/NO_APP
	movl 16(%ebp),%ebx   <= points to arg3
	movl 20(%ebp),%ebx   <= overwrites pointer (??)
	movl %edx,(%ebx)
	movl %eax,(%ebx)     <= writes to *arg4 instead of *arg3
	leal -8(%ebp),%esp
	popl %ebx
	popl %esi
	movl %ebp,%esp
	popl %ebp
	ret

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019