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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So

int main()
{
  long double x;

  // make x pseudo-denormal
  x = 0;

  unsigned char *px = (unsigned char *)&x;
  px[7] = 0x80;

  // set padding
  px[10] = 0x80;
  px[11] = 0x80;
  px[12] = 0x80;
  px[13] = 0x80;
  px[14] = 0x80;
  px[15] = 0x80;

  __builtin_printf("%lf\n", x);
  return 0;
}

shows we're constant folding this to

  __builtin_printf ("%lf\n",
3.36210314311209350626267781732175260259807934484647124011e-4932);

now.  When we put #pragma GCC unroll 16 before your testcases loop we
get the following (unrolling and constant folding happens after the
"bad" transform)

main ()
{
  <bb 2> [local count: 82570746]:
  printf ("%02x ", 128);
  printf ("%02x ", 128);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 128);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  __builtin_putchar (10);
  return 0;

Reply via email to