This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC ARM assembly questions
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: "Phil Endecott" <spam_from_gcc_help_2 at chezphil dot org>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 1 Oct 2007 10:13:57 +0100
- Subject: Re: GCC ARM assembly questions
- References: <000b01c7fcf2$fd993570$0f00a8c0@LENOVO239BD4D2> <1190484471969@dmwebmail.japan.chezphil.org>
Phil Endecott writes:
> Hi Priya,
>
> Priya Narasimhan wrote:
> > I am compiling relatively simple C programs using "gcc -S
> > -fomit-frame-pointer -mcpu=xscale" on a gumstix (ARM Xscale) processor. I
> > noticed that the generated assembly code has additional stuff in, beyond
> > what I would typically see in a standard ARM assembly program (e.g., one
> > that was generated instead through the ARM Development Suite toolchain).
> >
> > For instance, I see the following comments in the GNU-generated assembly
> > code. What do these signify?
> >
> > @ zero_extendqisi2
> > @ args =0, pretend =0 (what does pretend mean?)
> > @ frame_needed = 0, uses_anonymous_args = 0 (what does uses_anonymous_args
> > mean?)
>
> I don't know, and I suspect that the answer is not very interesting.
> The best way to find answers to these questions is probably to study
> the gcc source code.
>
> > Secondly, I notice that without the "-O" option, saving registers to the
> > stack happens almost on every alternate line of the generated assembly code.
> > What is the purpose of doing this?
>
> Without -O, gcc runs faster. It can run faster by not spending time
> working out what can be stored in registers, and just using the stack
> for everything.
This is important for debugging: you know that whenever a variable is
assigned, the value really is stored in the stack slot associated with
that variable. In other words, it's a feature, not a bug.
Andrew.