From owner-freebsd-hackers Thu Apr 6 8:15:55 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rccr1.rccr.cremona.it (rccr1.rccr.cremona.it [194.20.53.49]) by hub.freebsd.org (Postfix) with ESMTP id 6E93F37B973; Thu, 6 Apr 2000 08:15:49 -0700 (PDT) (envelope-from mirko.viviani@rccr.cremona.it) Received: from mailman.endymion.com (rccr1.rccr.cremona.it [194.20.53.49] (may be forged)) by rccr1.rccr.cremona.it (8.9.3/8.9.3) with SMTP id RAA10378; Thu, 6 Apr 2000 17:10:44 +0200 Message-Id: <200004061510.RAA10378@rccr1.rccr.cremona.it> To: freebsd-hackers@FreeBSD.org Cc: obrien@FreeBSD.org From: mirko.viviani@rccr.cremona.it Subject: GCC 2.95.2 __builtin_apply() problems... Date: Thu, 6 Apr 2000 17:10:45 +0000 X-Mailer: Endymion MailMan Standard Edition v3.0.2 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ciao! This prg seems to have problems with gcc 2.95.2 under FreeBSD. Here (3.4-stable, egcs from ports) it returns: rey:/tmp/tmp> ./conftest 00 00 00 00 30 56 0d 28 00 00 00 00 00 5e 3a c8 07 40 bf bf 97 bc 04 28 7d 82 04 08 04 cf 8a 06 b4 8f 05 28 40 d0 bf bf 5e 3a c8 43 It should return the 'value' at 'retframe+8' instead of 0. The value is a bit shifted 'retvalue+13' and latest byte missed. If you change the value type from 'float' to 'long double' it works correctly. Any hints ? Thanks. <-*- cut -*-> #include float value = 400.456; float floatValue() { return value; } void main() { int i; char *(imp) = floatValue; void* retframe; void* frame = __builtin_apply_args(); //malloc(116); retframe = __builtin_apply((void(*)(void))imp, frame, 0); for(i=0; i < 40; i++) printf("%02x ", ((unsigned char *)retframe)[i]); printf("\n"); for(i=0; i < 4; i++) printf("%02x ", ((unsigned char *)&value)[i]); printf("\n"); exit(0); } <-*- cut -*-> -- Bye, Mirko (NeXTmail, MIME) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message