This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
[M16C-ELF] : Problem with double and float data types.
- From: "Ina Pandit" <InaP at KPITCummins dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 23 Dec 2005 19:04:41 +0530
- Subject: [M16C-ELF] : Problem with double and float data types.
Hi,
I have downloaded latest GCC and Binutils sources from FSF for M16C
port. Using these sources, I could successfully build the cross
toolchain i.e. m32c-elf-*.
I have observed the following behavior while using "float" and
"double" data types for m16c target. Any computation involving
a "float" or a "double" data type does not work on the m16c hardware.
However, the correct values can be observed using GDB simulator.
For example, the following code:
#include<stdio.h>
int main(void)
{
float f1 = 3.0;
printf("\n f1 = %f \n",f1);
f1 += 2.0;
printf("\n f1 = %f \n",f1);
return 0;
}
prints the expected values of "f1" using gdb simulator.
However, the above code does not work on hardware.
Only the initial value of "f1",i.e. 3.0 is output on the serial port.
But the value after computation i.e. 5.0 in not output.
Similar behavior is observed when "double" data type is used.
Please note that for outputting these characters on the serial port
we have modified the printf() function a bit.
Also the option "-msim" is used to print the output on the console
using gdb simulator. But, even without this option ( with no printf()
function in the code) the values can be watched by debugging the
code using gdb.
Thanks in advance.
Regards,
Ina Pandit
KPIT Cummins InfoSystems Ltd.
Pune, India
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series.
The following site also offers free technical support to its users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU tools were released on October 12, 2005.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~