Re: Object vs. Assembly from a compiler (Richard Gorton)
Mon, 22 Feb 1993 18:30:02 GMT

          From comp.compilers

Related articles
object code vs. assembler code (1993-02-19)
Re: object code vs. assembler code (1993-02-20)
Re: Object vs. Assembly from a compiler (1993-02-22)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Richard Gorton)
Keywords: assembler, performance, comment
Organization: Compilers Central
References: 93-02-105 93-02-115
Date: Mon, 22 Feb 1993 18:30:02 GMT

> writes:
> Is there any good reason why many compilers produce assembly language as
> this seems to be a big performance hit with no gain by doing this. I can't
> see that producing obejct code is *that* much harder.
As the moderator notes:
[Mostly it's a matter of taste. Some Unix assemblers, particularly the
earlier ones, were very fast, so there needn't be a performance issue. -John]

Another point to consider is how much one trusts the native assembler.
Generating assembly code is just fine if the native assembler is stable,
and correct. But if the assembler is changing and/or buggy, then
generating object code may turn out to save you lots and lots of
bug-hunting headaches. Particularly if you don't have control of or
access to the assembler sources.

For example, some assemblers may not permit expressions involving
relocation, such as:

sethi %hi(_foo)+0x1000, %g2
ld [%g2 + %lo(_foo)+1000], %i2

but will take:
sethi %hi(_foo), %g2
or %g2, %lo(_foo), %g2
ld [%g2 + 1000], %i2

But a compiler generating object code is free to utilize the first form.

Richard Gorton Alpha AXP Migration Tools - Digital Equipment Corp.
[Is that an assembler limitation or a problem in the object format? -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.