Re: Strange Behavior With Solaris (Sparc) C Compiler

glen herrmannsfeldt <gah@ugcs.caltech.edu>
14 May 2005 12:17:07 -0400

          From comp.compilers

Related articles
Strange Behavior With Solaris (Sparc) C Compiler djm52@cornell.edu (Daniel Marques) (2005-05-13)
Re: Strange Behavior With Solaris (Sparc) C Compiler mayan@sandbridgetech.com (Mayan Moudgill) (2005-05-14)
Re: Strange Behavior With Solaris (Sparc) C Compiler gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-05-14)
Re: Strange Behavior With Solaris (Sparc) C Compiler js@cs.tu-berlin.de (2005-05-14)
Re: Strange Behavior With Solaris (Sparc) C Compiler djm52@cornell.edu (Daniel Marques) (2005-05-16)
Re: Strange Behavior With Solaris (Sparc) C Compiler touati@prism.uvsq.fr (TOUATI Sid) (2005-05-20)
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.unix.solaris,comp.compilers
Date: 14 May 2005 12:17:07 -0400
Organization: Compilers Central
References: 05-05-065
Keywords: C, code
Posted-Date: 14 May 2005 12:17:07 EDT

Daniel Marques wrote:


> Hello. I have a question regarding some behavior I'm
> seeing with the C compiler on Solaris 9 and was hoping someone could
> shed some insight.


(snip)


> However, when I compile with the command "cc -c -g -xO0 test.c", nm now
> reports the size of "mother" as 0.


How about that the compiler might keep it in a register?


The memory map might only consider variables that actually
have space allocated, and it might not allocate any if it
can keep it in a register the whole time.


Try compiling with -S and see what test.s looks like.


-- glen


Post a followup to this message

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