[Bug middle-end/104522] ICE: in real_to_decimal_for_mode with -O -fdump-tree-all-details and long double

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 14 11:08:03 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104522

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #4)
> But I do wonder whether real_from_target needs fixing to handle invalid
> input gracefully which is ultimatively decode_ieee_extended?

long double foo (void)
{
  union { int i[4]; long double ld; } __tmp
    = { .i = { 0x1, 0, 0x4000, 0 } };
  return __tmp.ld;
}

This will fail compilation (-O -dP), without -dP (which avoids printing), the
constant in the memory is wrong:

.LC0:
        .long   1
        .long   0
        .long   0  <--- here should be 16384
        .long   0


More information about the Gcc-bugs mailing list