From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27605 invoked by alias); 12 Aug 2005 16:43:37 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27563 invoked by uid 48); 12 Aug 2005 16:43:33 -0000 Date: Fri, 12 Aug 2005 16:43:00 -0000 From: "th dot r dot klein at web dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20050812164328.23355.th.r.klein@web.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/23355] New: size optimizer did not eliminateing useless Push and pop instructions at ARM/Thumb machine X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg01392.txt.bz2 List-Id: The older version of gcc produces code e.g.: arm-elf-gcc-3.4.4 -g -Os -fPIC -mthumb -mlittle-endian -mapcs \ -march=armv4t -mcallee-super-interworking \ -c progWord.c -o 3_4_4_thumb.o 3_4_4_thumb.o: file format elf32-littlearm Disassembly of section .text: 00000000 : 0: e38fc001 orr ip, pc, #1 ; 0x1 4: e12fff1c bx ip 00000008 <.real_start_ofprogWord>: 8: b570 push {r4, r5, r6, lr} . register r10 (sl) never been used so it is neither pushed nor poped . 52: 2000 movs r0, #0 54: bc70 pop {r4, r5, r6} 56: bc02 pop {r1} 58: 4708 bx r1 The newer version generats the code arm-elf-gcc-4.0.1 -g -Os -fPIC -mthumb -mlittle-endian -mapcs \ -march=armv4t -mcallee-super-interworking \ -c progWord.c -o 4_0_1_thumb.o 4_0_1_thumb.o: file format elf32-littlearm Disassembly of section .text: 00000000 : 0: e38fc001 orr ip, pc, #1 ; 0x1 4: e12fff1c bx ip 00000008 <.real_start_ofprogWord>: 8: b570 push {r4, r5, r6, lr} a: 4656 mov r6, sl c: b440 push {r6} . register r10 (sl) never been used . 56: 2000 movs r0, #0 58: bc04 pop {r2} 5a: 4692 mov sl, r2 5c: bc70 pop {r4, r5, r6} 5e: bc02 pop {r1} 60: 4708 bx r1 The register sl isn't used within the function so push and pop of this not what I'm expecting if switch -Os is given. -- Summary: size optimizer did not eliminateing useless Push and pop instructions at ARM/Thumb machine Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: th dot r dot klein at web dot de CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i386-elf-freebsd GCC target triplet: arm-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23355