From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21411 invoked by alias); 13 Mar 2014 10:31:58 -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 Received: (qmail 21364 invoked by uid 48); 13 Mar 2014 10:31:54 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59779] [4.9 Regression] FAIL: gcc.dg/autopar/outer-1.c scan-tree-dump-times parloops "parallelizing outer loop" Date: Thu, 13 Mar 2014 10:31: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-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg01044.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59779 --- Comment #5 from Jakub Jelinek --- The following fixes this for me: --- gcc/tree-dfa.c.jj 2014-01-03 11:40:57.000000000 +0100 +++ gcc/tree-dfa.c 2014-03-13 11:22:20.727848114 +0100 @@ -615,6 +615,15 @@ get_ref_base_and_extent (tree exp, HOST_ maxsize = -1; done: + if (bitsize < 0) + { + *poffset = 0; + *psize = -1; + *pmax_size = -1; + + return exp; + } + if (!bit_offset.fits_shwi ()) { *poffset = 0; @@ -645,6 +654,9 @@ get_ref_base_and_extent (tree exp, HOST_ maxsize = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (exp))) - hbit_offset; } + if (maxsize < 0) + maxsize = -1; + /* ??? Due to negative offsets in ARRAY_REF we can end up with negative bit_offset here. We might want to store a zero offset in this case. */ The problem is that the array is 0xbebc2000 bits long, and most of the places in get_ref_base_and_extent work with maxsize (and bitsize) as uhwi, so we can easily end up with negative, but not -1, maxsize (or bitsize), but callers obviously expect sizes to be positive or -1 (special magic value for unknown).