From: Aladdin Chang <chang@totoro.ee.ntust.edu.tw>
To: <gcc-help@gcc.gnu.org>
Subject: Loop unrolling Problem !!
Date: Wed, 24 Jul 2002 20:24:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.33.0207251123420.1431-100000@totoro.ee.ntust.edu.tw> (raw)
hi,
I compiler the source main.c with m68k-elf-gcc(gcc-3.0.4 and binutils-2.12)
and dissemble the binary file, we can find that the code inside the
infinte
loop while(1) j = 10 and i = 10 have two copy in binary file.
Is there any option to avoid this kind of duplication and
where to find the source related with.
thanks,
By the way, I compiled the source with following command
m68k-elf-gcc -m68000 -nostartfiles -gstabs+ -nostdlib -fno-unroll-loops -c
main.c
SOURCE: main.c
================================
main ()
{
int j = 10;
int i = 10;
while(1)
{
j = 10;
i = 10;
}
}
Disassemble:
========================================
main ()
{
400: 4e56 fff8 linkw %fp,#-8
int j = 10;
404: 700a moveq #10,%d0
406: 2d40 fffc movel %d0,%fp@(-4)
int i = 10;
40a: 2d40 fff8 movel %d0,%fp@(-8)
while(1)
{
j = 10;
40e: 2d40 fffc movel %d0,%fp@(-4)
i = 10;
412: 2d40 fff8 movel %d0,%fp@(-8)
416: 700a moveq #10,%d0
418: 2d40 fffc movel %d0,%fp@(-4)
41c: 2d40 fff8 movel %d0,%fp@(-8)
420: 60f4 bras 416 <main+0x16>
}
reply other threads:[~2002-07-25 3:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.33.0207251123420.1431-100000@totoro.ee.ntust.edu.tw \
--to=chang@totoro.ee.ntust.edu.tw \
--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).