Host/Target confusion in Dwarf output

Michael Eager
Thu Jul 12 19:15:00 GMT 2007

Ian Lance Taylor wrote:
> Michael Eager <> writes:
>> It seems to me that the same assembly code should be generated
>> independent of whether gcc is run on a 32-bit or 64-bit
>> host and all of these HOST_* tests should actually be
>> target domain parameters, like BITS_PER_WORD.
> It is sad but true that there are various cases in gcc which differ
> based on the size of an integer on the host.  So far as I know none of
> them amount to bugs, but as you've seen they do lead to different code
> generation.  The most obvious difference here is that CONST_INTs in
> RTL are stored as HOST_WIDE_INTs.  And it is that difference which are
> you seeing, propagated into the debug code.

In this case, the difference is not trivial.  On a 64-bit host,
gcc generates code that the assembler rejects and, if I recall
correctly, DWARF_FORM_8 which is not supported by the target
binutils.  That latter may be a binutils defect.

Either way, it counts as a bug if the compile doesn't finish.

Why would the RTL represent target CONST_INT as HOST_WIDE_INT?
Confusion between host and target?

> I think that in general it would be good to fix these issues, so that
> we generate the same assembler code for a given target from any host.
> The cases to really think through in detail are a 32-bit host and a
> 64-bit target.

I don't have that combination, that could be problematic.

> With the current definition of RTL, I don't think you can fix
> dwarf2out.c independently of fixing other parts of the compiler.  But,
> if I am wrong in that, go for it.

Jeez, I hope that's not the case.  I don't want to start
fixing a small problem in DWARF output and end up re-architecting
the RTL.  (I'm exaggerating, but only a little).

Michael Eager
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

More information about the Gcc mailing list