Openembedded Devel Discussions
 help / color / mirror / Atom feed
* powerpc-g++ 4.2.4 problem casting long long to double
@ 2010-05-19  9:38 Vitus Jensen
  2010-05-19 11:21 ` Gary Thomas
  0 siblings, 1 reply; 19+ messages in thread
From: Vitus Jensen @ 2010-05-19  9:38 UTC (permalink / raw)
  To: openembedded-devel

Hello!

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?


MACHINE bluepro (ppc603e, used in n1200, efika, lite5200, storcenter)
DISTRO angstrom
BRANCH stable

Openembedded is used to build images and QT4 SDKs for this machine which 
work fine otherwise.  The compiler version used is the default for 
angstrom (4.2.4), that default and the gcc recipe is identical between 
stable and dev branches.

ppc405 uses the older 4.1.1 gcc which shows the identical behaviour when 
selected via ANGSTROM_GCC_VERSION.  4.3.2 and 4.3.3 failed to link but 
created the same assembler code otherwise.

How can I analyse this situation further?  I'm particular interested in 
how different __floatdidf versions get used dependend on frontend, the 
source of __floatdidf is in the gcc sourcetree and I expected it to be 
compiled just once.

Vitus


PS: fp-int-convert-long-double.c from the testsuite fails too, if
compiled via powerpc-angstrom-linux-g++

-- 
Vitus Jensen, Hannover, Germany, Universe (current)
pgp public key available from keyservers



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-06-09 13:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox