delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/06/10:18:26

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: assembly translation of a single C-command
Date: 6 Aug 2001 12:35:32 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 30
Message-ID: <9km2uk$o08$1@nets3.rz.RWTH-Aachen.DE>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010722135558 DOT 6415D-100000 AT is> <20010805054914 DOT 26718 DOT 00002587 AT ng-fj1 DOT aol DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 997101332 24584 137.226.32.75 (6 Aug 2001 12:35:32 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 6 Aug 2001 12:35:32 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sterten <sterten AT aol DOT com> wrote:
[...]

> However, for that "assembly and C-code together" problem 
> I'm disappointed. With the -g switch I do get the C-code ,
> although not the included .h files ,

That's to be expected: .h files shouldn't contain any active code, so
you shouldn't be getting any assembly output from them.  And unless
you use -gstabs instead of -g, you can't, anyway.

> but sometimes I have many C-lines (upto 500) followed by many
> assembly lines (upto thousands).

> It's still very difficult to figure out how a special C-line is
> translated into assembly.

Please note that there is no 1:1 correspondence between C source lines
and assembly mnemonics. Not all C source lines generate any effect in
the assembly output (commends, type definitions, ...), in the first
place. Neither does a single C statement have to create a single
contiguous block of assembly statements.

That's what having an optimizing C compiler is about.  It may reorder
parts of statements, or it may inline complete functions called; it
expands macros and eliminates unnecessary code.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019