From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27051 invoked by alias); 19 Aug 2011 12:01:00 -0000 Received: (qmail 27041 invoked by uid 22791); 19 Aug 2011 12:00:59 -0000 X-SWARE-Spam-Status: No, hits=-2.9 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; Fri, 19 Aug 2011 12:00:46 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/50067] [4.7 Regression] Wrong code with -fpredictive-commoning Date: Fri, 19 Aug 2011 12:59:00 -0000 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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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 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-08/txt/msg01658.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50067 --- Comment #9 from Richard Guenther 2011-08-19 12:00:11 UTC --- I think the element sizes of the access functions need to be reflected in the base object, which we require to be operand_equal_p to any other base to which we compare our access functions. I'm not yet 100% convinced that is enough though (if you view two same-shaped two-dimensional slices from a 3d array, for example, (int (*)[16][16])&a[i][j][k] and (int (*)[16][16])&a[l][m][n] and index them with [p][q] it should be possible to choose i,j,k,l,m,n so that data-dependence analysis thinks they do not overlap while they do - well, hopefully not ;)). I'm checking what regressions it will cause to remove if (TREE_CODE (ref) == MEM_REF && TREE_CODE (TREE_OPERAND (ref, 0)) == ADDR_EXPR && integer_zerop (TREE_OPERAND (ref, 1))) ref = TREE_OPERAND (TREE_OPERAND (ref, 0), 0); which should "fix" this part for the particular case of an outermost-only mem-ref (that's the case where it doesn't help too much anyway, and moving it to a more useful place creates even more issues, see comment #8).