[Bug middle-end/77457] Print intended value of constants in assembly output

2016-09-03 Thread b7.10110111 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77457

--- Comment #5 from Ruslan  ---
(In reply to Andrew Pinski from comment #2)
> Note also should be shown in C99 hex floats because that is 100% exactly
> representable of the number in binary :).

Not sure if exactness is worth it. It'll make it harder to see what the decimal
value is (and decimal is the most commonly used radix by humans), while decimal
form, if printed with `max_digits10` digits, is enough to reproduce the
hex/binary form when needed.

[Bug middle-end/77457] Print intended value of constants in assembly output

2016-09-03 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77457

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||easyhack

--- Comment #4 from Andrew Pinski  ---
This is an easy hack.
In assemble_real (in varasm.c), after the loop that calls assemble_integer,
print out the value of d (REAL_VALUE_TYPE).
Note GCC is smart and does not use the host floating point (I don't know if
clang/llvm does that or not).

Something like this to do the printing (comes from tree-pretty-print.c):
if (REAL_VALUE_ISINF (d))
  pp_string (pp, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf");
else if (REAL_VALUE_ISNAN (d))
  pp_string (pp, " Nan");
else
  {
char string[100];
real_to_decimal (string, , sizeof (string), 0, 1);
pp_string (pp, string);
  }

[Bug middle-end/77457] Print intended value of constants in assembly output

2016-09-03 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77457

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-03
 Ever confirmed|0   |1

--- Comment #3 from Andrew Pinski  ---
.

[Bug middle-end/77457] Print intended value of constants in assembly output

2016-09-03 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77457

Andrew Pinski  changed:

   What|Removed |Added

  Component|target  |middle-end

--- Comment #2 from Andrew Pinski  ---
Confirmed, this most likely should only be enabled for -dA:
https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Developer-Options.html#Developer-Options

Note also should be shown in C99 hex floats because that is 100% exactly
representable of the number in binary :).