This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
floats / Porting GCC on a new arch
- From: Florent DEFAY <spira dot inhabitant at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 25 Feb 2009 11:58:25 +0100
- Subject: floats / Porting GCC on a new arch
Hi,
I have to port GCC on a new arch. I'm working on an i686-pc-linux-gnu
machine so it is cross-compilation.
I read tutorials from IIT of Bombay. I read parts of GCC Internals.
I'm working with gcc-4.3.3 sources. The binutils are already installed
in /home/me/target/.
I am now debugging my cc1 with GDB. I try to compile an empty file this way :
gdb /home/me/target/libexec/gcc/target/4.3.3/cc1 -x command.gdb
...
run -quiet -v a.c -quiet -dumpbase a.c -da -auxbase a -version -o a.s
where a.c is an empty file.
Process stops with
Program received signal SIGSEGV, Segmentation fault.
builtin_define_float_constants (name_prefix=0x83fcaf9 "FLT",
fp_suffix=0x8419523 "F", fp_cast=0x84109dd "%s", type=0xb7d01410) at
../../gcc-4.3.3/gcc/c-cppbuiltin.c:108
108 gcc_assert (fmt->b != 10);
and the back trace is
(gdb) bt
#0 builtin_define_float_constants (name_prefix=0x83fcaf9 "FLT",
fp_suffix=0x8419523 "F", fp_cast=0x84109dd "%s", type=0xb7d01410) at
../../gcc-4.3.3/gcc/c-cppbuiltin.c:108
#1 0x08090324 in c_cpp_builtins (pfile=0x9dd56d0) at
../../gcc-4.3.3/gcc/c-cppbuiltin.c:508
#2 0x08087809 in finish_options () at ../../gcc-4.3.3/gcc/c-opts.c:1508
#3 0x08087a15 in c_common_parse_file (set_yydebug=0) at
../../gcc-4.3.3/gcc/c-opts.c:1288
#4 0x08202297 in toplev_main (argc=13, argv=0xbfb38404) at
../../gcc-4.3.3/gcc/toplev.c:1042
#5 0x080a47d2 in main (argc=788558629, argv=0x66006425) at
../../gcc-4.3.3/gcc/main.c:35
Does it deal with macros in target.h ? My target machine doesn't
support floats operations so I defined these macros :
#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
#undef TARGET_DECIMAL_FLOAT_SUPPORTED_P
#define TARGET_DECIMAL_FLOAT_SUPPORTED_P target_decimal_float_supported_p
// returns always false
#undef TARGET_FIXED_POINT_SUPPORTED_P
#define TARGET_FIXED_POINT_SUPPORTED_P target_fixed_point_supported_p
// returns always false
and that's all about floats.
What should I additionally implement ?
Thank you.
Florent