From: Stuart Adams <sja@brightstareng.com>
To: linuxppc-embedded@lists.linuxppc.org
Cc: Dan Malek <dan@netx4.com>, reekes@kerbango.com
Subject: Re: does soft-float work?
Date: Thu, 11 Nov 1999 19:18:19 -0500 [thread overview]
Message-ID: <382B5CCB.8FB26DD8@brightstareng.com> (raw)
We saw similar problems and found that there was a compiler
bug which emitted bad code when using varargs to pass doubles.
This only occurred when using -mcpu=8xx not with -msoft-float.
For example the following code did not work with egcs-1.1 when using
-mcpu=8xx
------
#include <stdarg.h>
double d = 500.0;
vtst(char *fmt, ...) {
double z;
va_list ap;
va_start(ap,fmt);
z = va_arg(ap,double);
printf("vatst=%d\n",(int)z); // should print 500
}
main() {
vtst("jj",d);
}
------
I have not tried gcc 2.95.X so the bug may have been fixed.
The problem with printf is that libc was probably compiled with
-mcpu=8xx with a version of gcc with this bug. (libc/printf uses varags
to pass doubles internally) We recompiled libc with -msoft-float
and now things work fine.
-- Stuart
-------------------------------------
Stuart Adams
Bright Star Engineering Inc.
19 Enfield Drive
Andover MA 01810 USA
Tel: +1-978-470-8738
Fax: +1-978-470-8878
Email: sja@brightstareng.com
Web: http://www.brightstareng.com/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next reply other threads:[~1999-11-12 0:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-12 0:18 Stuart Adams [this message]
1999-11-19 17:10 ` does soft-float work? Marcus Sundberg
-- strict thread matches above, loose matches on Subject: below --
1999-11-11 21:48 Jim Reekes
1999-11-11 22:44 ` Dan Malek
1999-11-19 17:06 ` Marcus Sundberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=382B5CCB.8FB26DD8@brightstareng.com \
--to=sja@brightstareng.com \
--cc=dan@netx4.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=reekes@kerbango.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).