From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21118 invoked by alias); 26 Jun 2012 16:17:27 -0000 Received: (qmail 21092 invoked by uid 22791); 26 Jun 2012 16:17:22 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_CF 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; Tue, 26 Jun 2012 16:17:02 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5QGH17f009124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Jun 2012 12:17:02 -0400 Received: from zalov.redhat.com (vpn1-7-168.ams2.redhat.com [10.36.7.168]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5QGGxmj017083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Jun 2012 12:17:01 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id q5QGGwR8030854; Tue, 26 Jun 2012 18:16:58 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id q5QGGvFc030853; Tue, 26 Jun 2012 18:16:57 +0200 Date: Tue, 26 Jun 2012 17:19:00 -0000 From: Jakub Jelinek To: Michael Matz Cc: Jason Merrill , Richard Guenther , Xinliang David Li , GCC Patches Subject: Re: New option to turn off stack reuse for temporaries Message-ID: <20120626161657.GI20264@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <4FE43AFD.6050601@redhat.com> <4FE9D23A.20000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-06/txt/msg01700.txt.bz2 On Tue, Jun 26, 2012 at 06:07:09PM +0200, Michael Matz wrote: > I agree with Jason. TARGET_EXPR and CLEANUP_POINT_EXPR might currently be > used only for C++, but I think they are sensible general constructs to be > supported by the gimplifier. > > But I also think that the option to disable stack slot sharing should be > moved to cfgexpand to trigger non-sharing of everything, not just these > cleanup temporaries. After all using the (c++)temporary after expression > end is a source bug that the option is supposed to work around, just like > this is: If you move it solely to cfgexpand time, broken code will still often not work the way it happened to work with 4.6 and earlier. You'd need to both disable the sharing and disable additions of gimple clobbers. Because otherwise DCE/DSE and other passes happily optimize (broken) code away. So, if we want a -fno-strict-aliasing like option to work around broken code, we should IMHO do both of those. > > char *p; { char str[50]; p = str; } use(p); > > So, IMO the option should also work around this source bug. We had at > least one example of that in our own code base. Yeah, gengtype I think. Jakub