From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19293 invoked by alias); 22 Oct 2009 09:12:06 -0000 Received: (qmail 19284 invoked by uid 22791); 22 Oct 2009 09:12:05 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f178.google.com (HELO mail-vw0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Oct 2009 09:11:59 +0000 Received: by vws8 with SMTP id 8so5043636vws.0 for ; Thu, 22 Oct 2009 02:11:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.126.205 with SMTP id d13mr3997347vcs.24.1256202717358; Thu, 22 Oct 2009 02:11:57 -0700 (PDT) In-Reply-To: <649555d50910212331ne851950j3ad525632218f789@mail.gmail.com> References: <649555d50910212331ne851950j3ad525632218f789@mail.gmail.com> Date: Thu, 22 Oct 2009 17:13:00 -0000 Message-ID: <84fc9c000910220211k7595d1b1q2918b9b32fe72032@mail.gmail.com> Subject: Re: Dead Store Elimination From: Richard Guenther To: Pranav Bhandarkar Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00448.txt.bz2 On Thu, Oct 22, 2009 at 8:31 AM, Pranav Bhandarkar wrote: > Hi, > > A possible silly question about the dead store elimination pass. From > the documentation it is clear that the store S1 below is removed by > this pass (in dse.c) > > *(addr) =3D value1; =A0 =A0 =A0 =A0 =A0// S1 > ..... > ..... > *(addr) =3D value2 =A0 =A0 =A0 =A0 =A0// S2 .. No read of "addr" between = S1 and S2. > ...... > =A0 =A0 =A0 =A0 =A0 =A0 =3D *(addr) =A0 =A0 =A0 // Load > ....... > end_of_the_function > > However, consider a different example. > > *(addr) =3D value1; =A0 =A0 =A0// S1 > ...... > ..... > end_of_the_function. > > i.e. there is no store Sn that follows S1 along any path from S1 to > the end of the function and there is no read of addr following S1 > either. Is the dse pass expected to remove such stores ? (I am > inclined to think that it should, but I am seeing a case where dse > doesnt remove such stores) . Further is the behaviour expected to be > different if the "addr" is based on =A0"fp" ? Are you talking about the tree dead-store elimination pass or the RTL one? Basically *addr =3D value1; cannot be removed if addr does not point to local memory or if the pointed-to memory escapes through a call-site that is dominated by this store. Richard.