From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23198 invoked by alias); 22 Jun 2012 08:28:42 -0000 Received: (qmail 23188 invoked by uid 22791); 22 Jun 2012 08:28:41 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jun 2012 08:28:25 +0000 Received: by obcva7 with SMTP id va7so1742851obc.20 for ; Fri, 22 Jun 2012 01:28:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.10.227 with SMTP id l3mr993242oeb.39.1340353705029; Fri, 22 Jun 2012 01:28:25 -0700 (PDT) Received: by 10.76.82.4 with HTTP; Fri, 22 Jun 2012 01:28:24 -0700 (PDT) In-Reply-To: References: <4FE26AFC.3000703@redhat.com> Date: Fri, 22 Jun 2012 08:46:00 -0000 Message-ID: Subject: Re: New option to turn off stack reuse for temporaries From: Richard Guenther To: Michael Matz Cc: Xinliang David Li , Jason Merrill , GCC Patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg01450.txt.bz2 On Thu, Jun 21, 2012 at 5:53 PM, Michael Matz wrote: > Hi, > > On Thu, 21 Jun 2012, Richard Guenther wrote: > >> The flag is not restricted to the C++ compiler and applies to all >> automatic variables. > > The use of that flag in the gimplifier (->in_cleanup_expr) makes it > actually c++ specific. We don't have any other users of WITH_CLEANUP_EXPR? Indeed. >> Also even with this flag there is no guarantee we cannot figure out >> lifetime in other ways, for example if the temporary gets promoted to a >> register. Also with this patch you remove code motion barriers which >> might cause other issues. >> >> A more "proper" place to fix this is when we actually do the stack >> reuse, in cfgexpand. > > That is true, though. =A0It would then also enable debugging help for > pointers to things that go out-of-scope. Yes. So I think if the flag is supposed to be used for debugging (instead of as fix or workaround for invalid programs) then we should go one step further and have it disable stack slot sharing alltogether - without any other side-effect on pre-RTL optimizations (which undoubtedly not having the CLOBBERS have). Richard. > > Ciao, > Michael.