From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4741 invoked by alias); 8 Sep 2009 09:57:49 -0000 Received: (qmail 4710 invoked by uid 22791); 8 Sep 2009 09:57:48 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_20 X-Spam-Check-By: sourceware.org Received: from web62405.mail.re1.yahoo.com (HELO web62405.mail.re1.yahoo.com) (69.147.75.82) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 08 Sep 2009 09:57:39 +0000 Received: (qmail 51940 invoked by uid 60001); 8 Sep 2009 09:57:38 -0000 Message-ID: <969088.51632.qm@web62405.mail.re1.yahoo.com> Received: from [164.129.1.42] by web62405.mail.re1.yahoo.com via HTTP; Tue, 08 Sep 2009 02:57:37 PDT Date: Tue, 08 Sep 2009 09:57:00 -0000 From: Alex Turjan Subject: question about DSE To: gcc@gcc.gnu.org Cc: rsandifor@codesourcery.com, zadeck@naturalbridge.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-09/txt/msg00157.txt.bz2 Dear all, Im writing to you regarding the dead store elimination (dse) which runs after register allocation. Apparently dse removes wrongly the following store (present in bb2): (insn 374 47 52 2 test.c:107 (set (mem/c:SI (plus:PSI (reg/f:PSI 55 ptr15) (const_int 96 [0x60])) [19 fac_iter+0 S4 A32]) (reg/v:SI 16 r16 [orig:161 step109 ] [161])) 48 {si_indexed_store_incl_ra} (nil)) despite being consumed (in bb3) by the following 2 loads: (insn 380 71 64 3 test.c:112 (set (reg:HI 1 r1) (mem:HI (plus:PSI (reg/f:PSI 55 ptr15) (const_int 96 [0x60])) [0 S2 A16])) 12 {load} (nil)) (insn 382 346 65 3 test.c:112 (set (reg:HI 5 r5) (mem:HI (plus:PSI (reg/f:PSI 55 ptr15) (const_int 98 [0x62])) [0 S2 A16])) 12 {load} (nil)) Can anyone point what may be the problem? As you can see the store is SI while the loads are HI. While looking to the comments from dse.c I get to the following remark: " There are three cases where dse falls short: a) Reload sometimes creates the slot for one mode of access, and then inserts loads and/or stores for a smaller mode. " Does it mean that such cases are not treated properly by dse? I observed that if I run with the flag -fno-strict-aliasing the wrongly removed store is no longer removed and the code is runs correctly. Im wondering does the dse after register allocation make use of type based alias analysis? reagards, Alex