All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: parisc-linux@parisc-linux.org
Subject: Re: [parisc-linux] FWD: The problematic asm code
Date: Fri, 11 Jan 2002 07:25:04 -0800	[thread overview]
Message-ID: <20020111152452.GD365@tausq.org> (raw)
In-Reply-To: <20020110224338.GK3247@tausq.org>

In reference to a message from Randolph Chung, dated Jan 10:
> Torsten, the Debian ghostscript maintainer, has been working on trying
> to figure out a weird floating-point related (?) problem with the
> ghostscript package on hppa.

As a followup... torsten managed to track this down to a simple test
case:


#include <stdio.h>
void	out(const char *str, double x)
{
	printf("%s: %f\n", str, x);
}
int	main(int argc, char **argv)
{
	void	(*f)(const char *, double) = out;
	f("Calling via function pointer", 3.1415926535);
	out("Calling directly", 3.1415926535);
	return 0;
}

This gives:
% ./realind
Calling via function pointer: 0.000000
Calling directly: 3.141593

The RTL and the disassembly shows that in the function pointer case gcc
tries to load the floating point argument into an integer register.

A bug has been filed against gcc upstream about this.

randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^

  reply	other threads:[~2002-01-11 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-10 22:43 [parisc-linux] FWD: The problematic asm code Randolph Chung
2002-01-11 15:25 ` Randolph Chung [this message]
2002-01-11 22:37   ` John David Anglin

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=20020111152452.GD365@tausq.org \
    --to=randolph@tausq.org \
    --cc=parisc-linux@parisc-linux.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.