From owner-freebsd-current Sun Apr 9 2:33:59 2000 Delivered-To: freebsd-current@freebsd.org Received: from rccr1.rccr.cremona.it (rccr1.rccr.cremona.it [194.20.53.49]) by hub.freebsd.org (Postfix) with ESMTP id C880D37B764 for ; Sun, 9 Apr 2000 02:33:17 -0700 (PDT) (envelope-from mirko.viviani@rccr.cremona.it) Received: from rccr.cremona.it (modem-1-2.rccr.cremona.it [192.168.2.12]) by rccr1.rccr.cremona.it (8.9.3/8.9.3) with ESMTP id LAA25754; Sun, 9 Apr 2000 11:27:43 +0200 Received: (from mirko@localhost) by rccr.cremona.it (8.9.3/8.9.3) id LAA02968; Sun, 9 Apr 2000 11:31:03 +0200 (MET DST) Message-Id: <200004090931.LAA02968@rccr.cremona.it> MIME-Version: 1.0 (NeXT Mail 3.3 v148.2.1) Content-Type: multipart/alternative; boundary=NeXT-Mail-29933908-1 Content-Transfer-Encoding: 7bit In-Reply-To: X-Nextstep-Mailer: Mail 3.3 (Enhance 2.1) Received: by NeXT.Mailer (1.148.2.1) From: Mirko Viviani Date: Sun, 9 Apr 2000 11:31:03 +0200 To: Mike Heffner Subject: Re: 4.0 possible compiler bug ? Cc: current@FreeBSD.org Reply-To: mirko.viviani@rccr.cremona.it References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --NeXT-Mail-29933908-1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 08 Apr 2000, Mike Heffner wrote: > | I'm testing the __builtin_apply() to make a patch to GNUstep, but I'm > | getting > | in troubles. > > Since you're on the subject, there are also two other bugs with > __builtin_apply() in FBSD that I know of. Always better... :( > The easy hack to fix 2 is to remove FP_X_INV from the floating point mask > -- but this is not the right way to do it. 1 can be fixed by passing a > pointer of a float. Exactly how to do that ? > I tried investigating into it a while back, but didn't have any luck. I > know that 2 isn't a problem in 3-stable. If we'are not able to fix it I'm forced to change OS... I need GNUstep. I have tested the prg with NEXTSTEP cc 2.5.8 that uses the same behaviour for these things, it does not crash and return a pointer for the struct on the stack. CC differences: argframe: NS 8 bytes, FBSD 16 bytes struct on the stack: NS up to 4 bytes, FBSD up to 8 bytes. If it helps someone here is the asm generated by cc on NS. [An attachment was originally included here] --- Bye, Mirko (NeXTmail, MIME) --NeXT-Mail-29933908-1 Content-Type: multipart/mixed; boundary=NeXT-Mail-1209868928-2 Content-Transfer-Encoding: 7bit --NeXT-Mail-1209868928-2 Content-Type: text/enriched; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 08 Apr 2000, Mike Heffner wrote: > | I'm testing the __builtin_apply() to make a patch to GNUstep, but I'm > | getting > | in troubles. > > Since you're on the subject, there are also two other bugs with > __builtin_apply() in FBSD that I know of. Always better... :( > The easy hack to fix 2 is to remove FP_X_INV from the floating point mask > -- but this is not the right way to do it. 1 can be fixed by passing a > pointer of a float. Exactly how to do that ? > I tried investigating into it a while back, but didn't have any luck. I > know that 2 isn't a problem in 3-stable. If we'are not able to fix it I'm forced to change OS... I need GNUstep. I have tested the prg with NEXTSTEP cc 2.5.8 that uses the same behaviour for these things, it does not crash and return a pointer for the struct on the stack. CC differences: argframe: NS 8 bytes, FBSD 16 bytes struct on the stack: NS up to 4 bytes, FBSD up to 8 bytes. If it helps someone here is the asm generated by cc on NS. --NeXT-Mail-1209868928-2 Content-Type: application/octet-stream; name=contest_i.S; x-unix-mode=0600 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=contest_i.S .globl _value .data .align 2 _value: .long _p .text .align 2,0x90 .globl _floatValue _floatValue: pushl %ebp movl %esp,%ebp pushl %ebx movl %ebx,%eax movb $32,_p movb $3,_p+1 movb $4,_p+2 movb $33,_p+3 movb $-2,_p+9 movl $_p,%edx movl (%edx),%ecx movl %ecx,(%eax) movl 4(%edx),%ecx movl %ecx,4(%eax) movw 8(%edx),%cx movw %cx,8(%eax) jmp L1 .align 2,0x90 L1: movl %eax,%eax movl -4(%ebp),%ebx movl %ebp,%esp popl %ebp ret .cstring LC0: .ascii "%02x \0" LC1: .ascii "\12\0" .text .align 2,0x90 .globl _main _main: pushl %ebp movl %esp,%ebp subl $140,%esp pushl %edi pushl %esi pushl %ebx leal 8(%ebp),%ecx movl %ecx,-24(%ebp) movl %ebx,%ecx movl %ecx,-20(%ebp) leal -24(%ebp),%ecx movl $_floatValue,-8(%ebp) movl %ecx,-16(%ebp) movl -16(%ebp),%ecx movl $0,(%ecx) movl -16(%ebp),%ebx movl (%ebx),%ecx movl %esp,%esi movl %esp,%ecx movl -16(%ebp),%ebx addl $4,%ebx movl (%ebx),%ecx movl %ecx,%ebx movl -8(%ebp),%ecx leal -140(%ebp),%edi call *%ecx movl %eax,(%edi) movl %edx,4(%edi) fnsave 8(%edi) movl %esi,%esp leal -140(%ebp),%eax movl %eax,-12(%ebp) movl $0,-4(%ebp) L3: cmpl $39,-4(%ebp) jg L4 movl -12(%ebp),%eax addl -4(%ebp),%eax movzbl (%eax),%edx pushl %edx pushl $LC0 call _printf addl $8,%esp L5: incl -4(%ebp) jmp L3 .align 2,0x90 L4: pushl $LC1 call _printf addl $4,%esp movl $0,-4(%ebp) L6: cmpl $3,-4(%ebp) jg L7 movl -4(%ebp),%eax addl $_value,%eax movzbl (%eax),%edx pushl %edx pushl $LC0 call _printf addl $8,%esp L8: incl -4(%ebp) jmp L6 .align 2,0x90 L7: pushl $LC1 call _printf addl $4,%esp pushl $0 call _exit addl $4,%esp .align 2,0x90 L2: leal -152(%ebp),%esp popl %ebx popl %esi popl %edi movl %ebp,%esp popl %ebp ret .comm _p,12 --NeXT-Mail-1209868928-2 Content-Type: text/enriched; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline --- Bye, Mirko < (NeXTmail, MIME) < --NeXT-Mail-1209868928-2-- --NeXT-Mail-29933908-1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message