From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1699 invoked by alias); 20 Feb 2012 19:46:29 -0000 Received: (qmail 1682 invoked by uid 22791); 20 Feb 2012 19:46:28 -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; Mon, 20 Feb 2012 19:46:15 +0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51782] -ftree-sra: Missing address-space information leads to wrong Date: Mon, 20 Feb 2012 20:15: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: addr-space, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jamborm 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: 2012-02/txt/msg01997.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782 --- Comment #21 from rguenther at suse dot de 2012-02-20 19:44:46 UTC --- On Mon, 20 Feb 2012, jamborm at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782 > > --- Comment #20 from Martin Jambor 2012-02-20 17:27:36 UTC --- > (In reply to comment #19) > > base returned from get_base_address should never be NULL, so it's > > safe to assume it isn't. Otherwise the patch looks ok to me. > > > > Unfortunately, when I was bootstrapping a modified patch without the > NULL test on x86_64, it segfaulted. The reason is that > expand_debug_expr calls set_mem_attributes_minus_bitpos and in t > passes > > MEM[(struct basic_stringbuf *)&__s._M_stringbuf]._M_string That's an invalid MEM_REF, and the result of set_mem_attributes_minus_bitpos is probably completely bogus. > which might be OK for debug statements, I don't really know. Even > though I guess it might wreck havoc in address spaces in debug info, > for now I'm reverting to the original patch from comment #17 for the > purposes of this PR. Ok, probably safer for 4.7 > Perhaps get_base_address misses a DECL_P in the condition looking into > MEM_REFs? No, sure not - in the above we have a component-ref inside the ADDR_EXPR. Richard.