From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10232 invoked by alias); 8 Mar 2006 19:44:03 -0000 Received: (qmail 10193 invoked by alias); 8 Mar 2006 19:44:01 -0000 Date: Wed, 08 Mar 2006 19:44:00 -0000 Message-ID: <20060308194401.10192.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/26608] address of local variables are said to escape even though it is obvious they don't In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dberlin at dberlin dot org" 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 X-SW-Source: 2006-03/txt/msg00896.txt.bz2 List-Id: ------- Comment #1 from dberlin at gcc dot gnu dot org 2006-03-08 19:44 ------- Subject: Re: New: address of local variables are said to escape even though it is obvious they don't On Wed, 2006-03-08 at 18:59 +0000, pinskia at gcc dot gnu dot org wrote: > Testcase: > int *d1; > int g(int *b) > { > d1 = b; > } > int f(int a, int b, int c) > { > int i, j; > int *d; > if (a) > d = &i; > else > d = &j; > i = 2; > j = 3; > g(&b); > if (i!=2) > link_error(); > if (j!=3) > link_error(); > return *d; > } > int main(void) > { > f(1, 2,3); > return 0; > } > > This should link with optimize but right now i and j are said to be call > clobbered for some reason. What does the dump say. My guess is that it believes that they are returned from the call, even though they are not. > > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26608