public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* cast of float to unsigned char bug on ARM with 3.4.5 - when was it fixed?
@ 2008-01-09 16:29 Sam Ravnborg
  2008-01-10 15:23 ` John Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2008-01-09 16:29 UTC (permalink / raw)
  To: gcc-help

The following sample code produces different result depending on
the gcc version and target:

gcc version    target           output
3.4.5          i386             n1: 226 n2: -30.33
4.1.2 (RedHat) i386             n1: 226 n2: -30.33
3.4.5          arm-softfloat    n1: 0 n2: -30.33
4.1.1          arm              n1: 226 n2: -30.33

From the sample code above it is obvious that gcc 3.4.5
on arm-softfloat differs from the rest.

The sample code:
====================
#include <stdio.h>

int main(void)
{
   unsigned char n1;
   float n2;

   n2 = -30.33F;

   n1 = (unsigned char)n2;

   printf("n1: %d n2: %3.2f\n", n1, n2);

  return 0;
}
====================


I have not yet tried with a arm-softfloat gcc > 3.4.5 because Dan Kegel's
crosstool do not have it out-of-the box.

I assume this is a know bug that got fixed in later gcc's.
I have tried searching the gcc bug database with no luck.

Can anyone give a hint of when it was fixed or how I can better look it
up myself?

Thanks in advance,

	Sam

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

end of thread, other threads:[~2008-01-09 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-09 16:29 cast of float to unsigned char bug on ARM with 3.4.5 - when was it fixed? Sam Ravnborg
2008-01-10 15:23 ` John Love-Jensen
2008-01-10 19:57   ` Sam Ravnborg

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 read-only IMAP folder(s) and NNTP newsgroup(s).