From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25713 invoked by alias); 30 Jan 2015 06:42:30 -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 25317 invoked by uid 48); 30 Jan 2015 06:42:12 -0000 From: "amker at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/62173] [5.0 regression] 64bit Arch can't ivopt while 32bit Arch can Date: Fri, 30 Jan 2015 06:42: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: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amker at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jiwang at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.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: 2015-01/txt/msg03477.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62173 --- Comment #31 from amker at gcc dot gnu.org --- So cand_value_at (loop, cand, use->stmt, desc->niter, &bnd) with arguments as below: cand->iv->base: (unsigned long) ((char *) &A + (sizetype) i_6(D)) cand->iv->step: 0xFFFFFFFFFFFFFFFF desc->niter: (unsigned int)(i_6(D) + -1) use->stmt: is after increment The result calculated should like below: iv->base + iv->step * (unsigned long)niter + step <=> (unsigned long) ((char *) &A + (sizetype) i_6(D)) + 0xFFFFFFFFFFFFFFFF * ((unsigned long)(unsigned int)(i_6(D) + -1)) + 0xFFFFFFFFFFFFFFFF Even with range information [1, 10] for i_6(D), and we can prove that niter's range is [0, 9]. We can't prove it equals to: (unsigned long)((char *) &A) This is because we use unsigned type for step and lose the sign information? And this can't be fixed even with the proper range information. Is this understanding correct? Or anything I should do to achieve that? Thanks very much.