This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: backend porting question


Jeffrey A Law <law@cygnus.com> writes:

>   In message <m3vgxg7s7m.fsf@troilus.org>you write:
>   > In my (continuing) efforts to port GCC to a new processor, I'm having
>   > trouble getting GCC to compile software floating-point support for
>   > libgcc2.  In particular, it's using xgcc to compile fp-bit.c, and
>   > complaining about the modes requested by the code.
>   > In file included from fp-bit.c:1:
>   > ../../gcc/gcc/config/fp-bit.h:88: no data type for mode `SF'
>   > ../../gcc/gcc/config/fp-bit.h:89: no data type for mode `DF'
>   > (respectively, those lines are:
>   > typedef float SFtype __attribute__ ((mode (SF)));
>   > typedef float DFtype __attribute__ ((mode (DF)));
>   > )
>   > 
>   > I'm not sure why this is causing problems.  The only thing I can think
>   > of is that it's related to BITS_PER_UNIT being 32 rather than 8, but I
>   > cannot tell what special in the 1750a, c4x, or dsp16xx back-ends
>   > (which are the distributed back-ends with BITS_PER_UNIT > 8) tells GCC
>   > how to do the appropriate type translations.
>   > 
>   > Can anyone tell me how I should get GCC to compile the rest of libgcc2?
> Look at the defintion of doublE_TYPE_SIZE and FLOAT_TYPE_SIZE in 
> tree.c

DOUBLE_TYPE_SIZE and FLOAT_TYPE_SIZE both look sane (BITS_PER_WORD is
32, just like BITS_PER_UNIT) whether I define them in my target macro
file or let tree.c use its defaults.  The backtrace just before the
fatal error looks like this:

#0  type_for_mode (mode=SFmode, unsignedp=0) at ../../gcc/gcc/c-common.c:2345
#1  0x32f0e8 in decl_attributes (node=0xff211a80, attributes=0xff380064,
    prefix_attributes=0x2) at ../../gcc/gcc/c-common.c:724
#2  0x310804 in start_decl (declarator=0xff211a80, declspecs=0x381400,
    initialized=3675136, attributes=0xff1b04a0, prefix_attributes=0x0)
    at ../../gcc/gcc/c-decl.c:3520
#3  0x2ffde0 in yyparse () at c-parse.y:934
#4  0x343e8 in compile_file (name=0xff1b0340 "scratch/_pack_sf.c")
    at ../../gcc/gcc/toplev.c:2312
#5  0x38614 in main (argc=3, argv=0xffbefa2c) at ../../gcc/gcc/toplev.c:4790

(when processing "typedef float SFtype __attribute__ ((mode (SF)));")

When type_for_mode looks at float_type_node and double_type_node, it
sees QFmode.  When it looks at long_double_type_node, it sees HFmode.
None of these are SFmode, so type_for_mode returns 0 to
decl_attributes, which causes the fatal error.

-- Michael

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]