From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14784 invoked by alias); 25 Feb 2013 22:41:00 -0000 Received: (qmail 14726 invoked by uid 48); 25 Feb 2013 22:40:42 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/56448] [4.8 Regression] cc1 hangs on volatile array with -O or above Date: Mon, 25 Feb 2013 22:41: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: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Status AssignedTo 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: 2013-02/txt/msg02411.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56448 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org |gnu.org | --- Comment #2 from Jakub Jelinek 2013-02-25 22:40:42 UTC --- Created attachment 29536 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29536 gcc48-pr56448.patch Untested fix. For OEP_CONSTANT_ADDRESS_OF, we should ignore side-effects of the reference from which the address is taken, they change the value, not its address. OEP_CONSTANT_ADDRESS_OF in flags is fine to propagate to the first operand of some references, so e.g. &a.b[0].c[9] is constant, even when c and b arrays are volatile, but not the other arguments (e.g. array indexes, etc.), but for *MEM_REF not even the first argument should get that.