From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19070 invoked by alias); 6 May 2011 15:08:00 -0000 Received: (qmail 19025 invoked by uid 22791); 6 May 2011 15:07:58 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 May 2011 15:07:41 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p46F7e3f032000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 May 2011 11:07:41 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p46F7eaD028321; Fri, 6 May 2011 11:07:40 -0400 Received: from [10.3.113.6] ([10.3.113.6]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p46F7c5d001029; Fri, 6 May 2011 11:07:39 -0400 Message-ID: <4DC40EBA.7040909@redhat.com> Date: Fri, 06 May 2011 15:19:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Zdenek Dvorak CC: gcc-patches@gcc.gnu.org Subject: Re: [patch] PR 48837 References: <20110506104417.GA8664@kam.mff.cuni.cz> In-Reply-To: <20110506104417.GA8664@kam.mff.cuni.cz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00526.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/06/11 04:44, Zdenek Dvorak wrote: > Hi, > > when accumulator transformation is performed on a function like > > foo(a) > { > if (a > 0) > return 1 + foo (a - 1) > > return bla(); > } > > this becomes > > foo(a) > { > int tmp = 0; > > while (a > 0) > tm = 1 + tmp; > > return tmp + bla(); > } > > Before, bla was a tail-call, but after the optimization, it is not (since an addition > has to be performed after the result of bla is known). However, we used to mark bla > as tail-call, leading to a misscompilation later. Fixed by not marking tail-calls > when the transformation is performed. Bootstrapped and regtested on i686. > > Zdenek > > PR tree-optimization/48837 > * tree-tailcall.c (tree_optimize_tail_calls_1): Do not mark tailcalls > when accumulator transformation is performed. > > * gcc.dg/pr48837.c: New testcase. OK. Thanks, jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNxA66AAoJEBRtltQi2kC7yysIAKZYUpU9JlyH2XwvvVslq8C1 CJ7E/akRDsBoYBS+syNsLMwkbGG0WoaFJzOd7vUmIknAHEusF6OasczsN8PD9aEB i8xJNTZm2yxhrVZh8m/KBX96r80RwzpAhr9L1WAspiS/xpw12lRoJoh3XeKXYXWw Z0aBL4ljCgLj6GKEyy7FbGHx0gEqaa1x7EDM1kJGCgZPAFJalJPozBiiriYL9/Th gHqLXZ0HUhXNGql5M2S+lfZG2d30Rj1KBXDrU8EOXedHRjxb+U9+WLGsUHZtkcTI j3//n6bjTr/YmyTe43voG3Rn6z6k0g2Eb8gF8UMvDbaSJlH9+xb6SuWLS8+mEhY= =luE9 -----END PGP SIGNATURE-----