On Thu, Jan 26, 2017 at 3:17 PM, Martin Sebor <mse...@gmail.com> wrote:
>> Hi,
>>
>> With this patch all my builds for aarch64/arm failed:
>> /gcc/gimple-ssa-sprintf.c: In function
>> ‘<unnamed>::fmtresult<unnamed>::format_floating(const<unnamed>::direc
>> tive&, tree_node*)’:
>> /gcc/gimple-ssa-sprintf.c:1643: error: ‘XFmode’ was not declared in this
>> scope
>>
>> Is this fixed later in the series?
>
>
> It isn't.  I just reproduced it with an aarch64 cross-compiler so
> I hope to be able to fix it quickly.

This actually broke any non-x86 targeted GCC.

Even the current code is wrong:
#ifdef HAVE_XFmode
          /* When L is specified use long double, otherwise double.  */
          unsigned fmtprec
            = (dir.modifier == FMT_LEN_L
               ? REAL_MODE_FORMAT (XFmode)->p
               : REAL_MODE_FORMAT (DFmode)->p);
#elif defined HAVE_DFmode
          /* No long double support, use double precision for both.  */
          unsigned fmtprec = REAL_MODE_FORMAT (DFmode)->p;
#else
          /* No long double or double support.  */
          unsigned fmtprec = 0;
#endif


Shouldn't this be based instead on long_double_type_node instead?
Because different targets might have an option to select different
modes.

So it just becomes something like which simplifies the mess you have currently:
          /* When L is specified use long double, otherwise double.  */
          unsigned fmtprec
            = (dir.modifier == FMT_LEN_L
               ? REAL_MODE_FORMAT (TYPE_MODE (long_double_type_node))->p
               : REAL_MODE_FORMAT (TYPE_MODE ((double_type_node))->p);


Thanks,
Andrew

>
> Martin
>

Reply via email to