Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: openembedded-devel@lists.openembedded.org
Cc: Vitus Jensen <vjensen@gmx.de>
Subject: Re: powerpc-g++ 4.2.4 problem casting long long to double
Date: Wed, 19 May 2010 05:45:55 -0600	[thread overview]
Message-ID: <4BF3CF73.1060506@mlbassoc.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1005191335020.21508@asterix.crazy-teaparty.dyndns.org>

On 05/19/2010 05:41 AM, Vitus Jensen wrote:
> On Wed, 19 May 2010, Gary Thomas wrote:
>
>> On 05/19/2010 03:38 AM, Vitus Jensen wrote:
>>>
>>> We noticed a strange problem with C++ code casting long long variables
>>> to double, as a lot of qt-embedded code is doing.
>>>
>>> =================
>>> double
>>> convert(long long l)
>>> {
>>> return (double)l; // or double(l)
>>> }
>>>
>>> int
>>> main(int argc, char * argv[])
>>> {
>>> long long l = 10;
>>> double f;
>>>
>>> f = convert(l);
>>> printf("convert: %lld => %f\n", l, f);
>>> return 0;
>>> }
>>> ====================
>>>
>>> output:
>>> convert: 10 => 0.000000
>>>
>>> C++ compiled via powerpc-angstrom-linux-g++ gives the above result.
>>> Compiling the same code as C using powerpc-angstrom-linux-gcc works
>>> fine. But when looking at the assembler code both compiler produce
>>> virtually identical output and both call __floatdidf to do the actual
>>> conversion. Very strange, has anyone ever seen similar effects?
>>
>> Is this from a recent tree (i.e. post Richard Purdie's restructuring)?
>>
>> I've seen similar problems with C++ code on Poky which uses the same
>> changes.
>
> No, I'm building everything from the stable branch. There were some
> commits cherry-picked from .dev but those only add Qt 4.5.2.
>
> Poky is ARM only, right? Perhaps it would be helpfull to build a
> compiler from .dev and for a widely used powerpc-platform? How does
> n1200 sound? It uses the same ppc603e.

Actually, Poky also supports PowerPC now :-)

That said, it may or may not be related.  I'll do some investigating.

Thanks for isolating this problem to such a simple example.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------



  reply	other threads:[~2010-05-19 11:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19  9:38 powerpc-g++ 4.2.4 problem casting long long to double Vitus Jensen
2010-05-19 11:21 ` Gary Thomas
2010-05-19 11:41   ` Vitus Jensen
2010-05-19 11:45     ` Gary Thomas [this message]
2010-05-19 15:46     ` Vitus Jensen
2010-05-19 16:48       ` Koen Kooi
2010-05-21 11:12         ` Vitus Jensen
2010-05-21 13:21           ` Vitus Jensen
2010-05-21 13:40             ` Vitus Jensen
2010-05-21 20:37               ` Khem Raj
2010-05-24 16:36                 ` Vitus Jensen
2010-05-24 18:25                   ` Khem Raj
2010-05-25 15:15                     ` Vitus Jensen
2010-05-25 15:52                       ` Khem Raj
2010-05-26  5:34                         ` Vitus Jensen
2010-05-26  6:21                           ` Khem Raj
2010-06-07 19:23                             ` [STABLE] " Vitus Jensen
2010-06-09 12:13                               ` [PATCH][STABLE] gcc-pacpake-cross.inc: Clean up do_install function massively (from Poky) Vitus Jensen
2010-06-09 13:17                                 ` Khem Raj

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=4BF3CF73.1060506@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=vjensen@gmx.de \
    /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