[Bug target/77457] New: Print intended value of constants in assembly output

b7.10110111 at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Sep 2 14:37:00 GMT 2016


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

            Bug ID: 77457
           Summary: Print intended value of constants in assembly output
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b7.10110111 at gmail dot com
  Target Milestone: ---

Consider the following simple program:

void f()
{
    volatile double x=0.352;
}

I compile it with `gcc test.c -S -masm=intel -fverbose-asm` and get the
following for the value of `x`:

.LC0:
        .long   34359738
        .long   1071023915
        .ident  "GCC: (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204"

To decypher it while reading the listing one has to manually concatenate
hexadecimal forms of these two numbers, and then transform to floating-point
form. Not too handy.

For comparison, this is what I get from clang:

.LCPI0_0:
        .quad   4600012688193243578     # double 0.35199999999999998
<...skipped some code...>
        .ident  "Ubuntu clang version 3.8.0-svn257311-1~exp1 (trunk) (based on
LLVM 3.8.0)"


It would be really useful if GCC also printed the intended values of the
constants it emits. Namely, this should be done for float, double and long
double.


More information about the Gcc-bugs mailing list