From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28801 invoked by alias); 14 Jul 2011 22:11:08 -0000 Received: (qmail 28745 invoked by uid 22791); 14 Jul 2011 22:11:07 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jul 2011 22:10:52 +0000 From: "eraman at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/49452] [4.7 regression] comp-goto-2.c regresses in testing X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: eraman at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 14 Jul 2011 22:11:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01190.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49452 --- Comment #13 from Easwaran Raman 2011-07-14 22:10:16 UTC --- I looked at the dumps for 920501-7.c and second invocation of DSE removes a necessary store. The relevant dump for function x from 920501-7.c.198r.pro_and_epilogue is below: (insn 2 58 53 2 (set (mem/c:SI (plus:SI (reg/f:SI 11 fp) (const_int -56 [0xffffffffffffffc8])) [6 %sfp+-20 S4 A32]) (reg:SI 0 r0 [ a ])) /scratch/janisjo/arm-linux-fsf/src/gcc-mainline/gcc/testsuite/gcc.reghunt/920501-7.c:12 176 {*arm_movsi_insn} (nil)) ... (call_insn/c/i 11 9 12 2 (parallel [ (call (mem:SI (symbol_ref:SI ("y.1271") [flags 0x3] ) [0 y S4 A32]) (const_int 0 [0])) (use (const_int 0 [0])) (clobber (reg:SI 14 lr)) ]) /scratch/janisjo/arm-linux-fsf/src/gcc-mainline/gcc/testsuite/gcc.reghunt/920501-7.c:20 242 {*call_symbol} (expr_list:REG_NORETURN (const_int 0 [0]) (expr_list:REG_EH_REGION (const_int 0 [0]) (nil))) (expr_list:REG_DEP_TRUE (use (reg:SI 0 r0)) (expr_list:REG_DEP_TRUE (use (reg:SI 12 ip)) (nil)))) ... (insn 24 18 30 3 (set (reg/i:SI 0 r0) (mem/c:SI (plus:SI (reg/f:SI 11 fp) (const_int -20 [0xffffffffffffffec])) [6 %sfp+-20 S4 A32])) /scratch/janisjo/arm-linux-fsf/src/gcc-mainline/gcc/testsuite/gcc.reghunt/920501-7.c:23 176 {*arm_movsi_insn} (nil)) Instruction 2 and 24 refer to the same location, but have different offset relative to FP because the call to y changes FP. DSE doesn't (and can not, if it is intra-procedural) know that they both refer to the same location and hence thinks insn 2 is dead. It seems to me this (FP having different value after the call) can only happen at postreload. It seems to me that setting wild_read (not just non_frame_wild_read) on all calls after postreload will fix this problem. What's the best way to do that? Will checking for clear_alias_sets != NULL work?