From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2733 invoked by alias); 12 Jun 2002 13:46:10 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2647 invoked by uid 71); 12 Jun 2002 13:46:04 -0000 Date: Wed, 12 Jun 2002 06:46:00 -0000 Message-ID: <20020612134604.2645.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andrew Pinski Subject: Re: optimization/7005: Sibling and tail recursive calls optimisation with -fomit-frame-pointer: strange code generated. Reply-To: Andrew Pinski X-SW-Source: 2002-06/txt/msg00273.txt.bz2 List-Id: The following reply was made to PR optimization/7005; it has been noted by GNATS. From: Andrew Pinski To: fshvaige@cisco.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: optimization/7005: Sibling and tail recursive calls optimisation with -fomit-frame-pointer: strange code generated. Date: Wed, 12 Jun 2002 09:36:09 -0400 (EDT) This has been fixed in gcc version 3.2 20020607 (experimental) at least for the i686 version. I did not check the ppc-eabi version but I do not think that the PowerPC version can be changed because the abi specifies this. Thanks, Andrew Pinski > >Description: > File test2.c: > > int f1 (void); > int f2 (void) { > return f1 (); > } > > i686 -Os (best code): > > f2: > jmp f1 > > i686 -O2/-O3 (Ooops): > > f2: > subl $12, %esp > addl $12, %esp > jmp f1 > > PowerPC -Os/-O2/-O3 (Ooops): > > f2: > stwu 1,-8(1) > mflr 0 > stw 0,12(1) > bl f1 > lwz 0,12(1) > addi 1,1,8 > mtlr 0 > blr > >How-To-Repeat: > gcc -S -Os test2.c -Wall -fomit-frame-pointer > gcc -S -O2 test2.c -Wall -fomit-frame-pointer > gcc -S -O3 test2.c -Wall -fomit-frame-pointer > ppc-eabi-gcc -S -Os test2.c -Wall -fomit-frame-pointer > ppc-eabi-gcc -S -O2 test2.c -Wall -fomit-frame-pointer > ppc-eabi-gcc -S -O3 test2.c -Wall -fomit-frame-pointer