This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Host/Target confusion in Dwarf output
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Michael Eager'" <eager at eagercon dot com>, "'GCC'" <gcc at gcc dot gnu dot org>
- Date: Thu, 12 Jul 2007 17:38:19 +0100
- Subject: RE: Host/Target confusion in Dwarf output
- References: <4696557A.7060700@eagercon.com>
On 12 July 2007 17:23, Michael Eager wrote:
> I was looking through dwarf2out.c, tracking down the
> cause for different assembly code being generated
> when gcc was run on 32-bit and 64-bit hosts.
>
> In dwarf2out.c, there are several places where decisions
> about what to generate in the .s file are based on
> HOST_BITS_PER_WIDE_INT or HOST_BITS_PER_WIDE_LONG or
> similar. For example, when generating a long long value,
> on a 32-bit host, the *target* assembly code will contain
> two .4byte ops, while on a 64-bit host, a single .8byte
> op is generated. There are a number of other differences.
>
> The assembler for a 32-bit target might not have a .8byte
> operator. So, when run on a 32-bit host, everything is OK.
> On a 64-bit host, the assembly fails.
>
> 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.
>
> Comments?
Sounds right to me. Basing codegen decisions on HOST_xxxx is just plain wrong and has been an ongoing source of bugs down the years.
cheers,
DaveK
--
Can't think of a witty .sigline today....