Hi,

I would like to know more about REAL_MODE_FORMAT and real_format_for_mode.

I'm sorry because I already posted this email in gcc-help mailing-list
but there was no answer and maybe its right place is here ?

I am working on a port of GCC. The new xgcc generated crashes this way :

Program received signal SIGSEGV, Segmentation fault.
builtin_define_float_constants (name_prefix=0x83fcaf9 "FLT",
fp_suffix=0x8419523 "F", fp_cast=0x84109dd "%s", type=0xb7c0a410) at
../../gcc-4.3.3/gcc/c-cppbuiltin.c:108
108       gcc_assert (fmt->b != 10);

because fmt = 0.

This fmt results of
 fmt = REAL_MODE_FORMAT (TYPE_MODE (type));

and REAL_MODE_FORMAT is defined this way :

#define REAL_MODE_FORMAT(MODE)                                          \
 (real_format_for_mode[DECIMAL_FLOAT_MODE_P (MODE)                     \
                       ? ((MODE - MIN_MODE_DECIMAL_FLOAT)              \
                          + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1))     \
                       : (MODE - MIN_MODE_FLOAT)])

But I did not find definition for real_format_for_mode, just an
"extern" in real.h (nothing in real.c) :

extern const struct real_format *
 real_format_for_mode[MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1
                      + MAX_MODE_DECIMAL_FLOAT - MIN_MODE_DECIMAL_FLOAT + 1];


Should I include an implementation of real_format_for_mode in my
target.c ? If I should, how can I do that ? If not, how to avoid this
crash ? Any idea ?

Thank you.

Florent

Reply via email to