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

--- Comment #4 from Alexander Cherepanov <ch3root at openwall dot com> ---
(In reply to Richard Biener from comment #3)
> shows we're constant folding this to
> 
>   __builtin_printf ("%lf\n",
> 3.36210314311209350626267781732175260259807934484647124011e-4932);

Unfortunately, in this form, it's not clear whether normalization already
happened or not (unlike with clang which prints such numbers as hex).

OTOH I would not expect problems with only one variable after pr71522 was
fixed.

> 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;

After inserting `#pragma GCC unroll 16` in my testcase I get something else:

main ()
{
  <bb 2> [local count: 63136024]:
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 0);
  printf ("%02x ", 1);
  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;

}

Please note 16 values being printed instead of 12, "1" printed in exponent and
zeroes in padding (exactly as in the description of this pr). I'm testing on
x86-64.

Reply via email to