public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Shen Hui <shenhui@mprc.pku.edu.cn>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: help?
Date: Sat, 12 Jul 2003 10:05:00 -0000	[thread overview]
Message-ID: <200307120704.h6C74C1H019491@mprc.pku.edu.cn> (raw)

gcc-help-help,hi!

I am using gcc-2.95.3 form ARM.

i have a c program file as follow: 

void foo1 ()
{
  int j[]={1,2};
}

void foo2 ()
{
  int j[]={1,2,3};
}


but the code generated for foo1 are:
foo1:
        @ args = 0, pretend = 0, frame = 8
        @ frame_needed = 1, current_function_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {r4, fp, ip, lr, pc}
        sub     fp, ip, #4
        sub     sp, sp, #8
        sub     r3, fp, #24
        ldr     r2, .L4
        ldmia   r2, {r3-r4}
        sub     r1, fp, #16
        stmdb   r1, {r3-r4}
        b       .L3

and the code generated for foo2 are:
foo2:
        @ args = 0, pretend = 0, frame = 12
        @ frame_needed = 1, current_function_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {fp, ip, lr, pc}
        sub     fp, ip, #4
        sub     sp, sp, #12
        sub     r3, fp, #24
        ldr     r2, .L8
        sub     r3, fp, #24		@**************************it is the redundant instruction, the same as above two.
        mov     ip, r2
        ldmia   ip, {r0-r2}     @ load multiple
        stmia   r3, {r0-r2}     @ str multiple
        b       .L7
  

my question is that in function foo2 there is a redundant instruction (sub     r3, fp, #24),
i donot think it's needed, whereas, there hasnot this instruction in function foo1.
why compiler generate it ?

thanks!

 				
              Shen Hui
              shenhui@mprc.pku.edu.cn
                 2003-07-12

             reply	other threads:[~2003-07-12  6:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 10:05 Shen Hui [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-01 15:58 Help!! Tomas Ukkonen
2006-12-26 13:38 help!! manish manish
2006-12-27 17:01 ` help!! Ian Lance Taylor
2006-01-28  5:42 Help? Garvin Pang
2006-01-28  7:41 ` Help? Brian Dessent
2005-06-02 15:54 help_ imacat
2003-03-03 17:37 help!!! Jim Frost
2003-03-07  5:46 ` help!!! LLeweLLyn Reese
     [not found] <20021204042724.64819.qmail@web15002.mail.bjs.yahoo.com>
2002-12-04  0:16 ` help! Ben Elliston
2002-11-19 10:16 help!!! mingo lu
     [not found] <20020617195757.13842.qmail@uwdvg001.cms.usa.net>
2002-06-17 13:05 ` help!! Phil Edwards
2002-04-04 23:41 Help! 朱 少波
2001-01-02 18:27 Help? Kwanghoon Choi
2001-01-02 19:37 ` Help? Alexandre Oliva
2000-05-15  9:15 HELP!!! Michael Michael
2000-05-16 23:27 ` HELP!!! Martin v. Loewis
2000-03-08 14:14 HELP !!! Fabrício Souza
2000-03-09 17:00 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` Fabrício Souza
2000-02-24  0:56 Help! 陳鵬升
2000-04-01  0:00 ` Help! 陳鵬升

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200307120704.h6C74C1H019491@mprc.pku.edu.cn \
    --to=shenhui@mprc.pku.edu.cn \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).