From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19322 invoked by alias); 25 Jul 2002 03:24:05 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 19315 invoked from network); 25 Jul 2002 03:24:04 -0000 Received: from unknown (HELO mgate1.ntust.edu.tw) (140.118.31.1) by sources.redhat.com with SMTP; 25 Jul 2002 03:24:04 -0000 Received: from mgate1.ntust.edu.tw (localhost [127.0.0.1]) by mgate1.ntust.edu.tw (8.12.4/8.12.4) with ESMTP id g6P3O3bQ000934 for ; Thu, 25 Jul 2002 11:24:03 +0800 (CST) Received: (from root@localhost) by mgate1.ntust.edu.tw (8.12.4/8.12.4/Submit) id g6P3O3tn000933 for gcc-help@gcc.gnu.org.AVP; Thu, 25 Jul 2002 11:24:03 +0800 (CST) Received: from smtp.ntust.edu.tw (smtp.ntust.edu.tw [140.118.31.67]) by mgate1.ntust.edu.tw (8.12.4/8.12.4) with ESMTP id g6P3O3f3000925 for ; Thu, 25 Jul 2002 11:24:03 +0800 (CST) Received: from totoro.ee.ntust.edu.tw (totoro.ee.ntust.edu.tw [140.118.7.13]) by smtp.ntust.edu.tw (8.12.3/8.12.2) with ESMTP id g6P3O2H3012586 for ; Thu, 25 Jul 2002 11:24:02 +0800 (CST) Received: from localhost (chang@localhost) by totoro.ee.ntust.edu.tw (8.11.6/linuxconf) with ESMTP id g6P3OMF01451 for ; Thu, 25 Jul 2002 11:24:25 +0800 Date: Wed, 24 Jul 2002 20:24:00 -0000 From: Aladdin Chang To: Subject: Loop unrolling Problem !! Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-07/txt/msg00247.txt.bz2 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 }