From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1813 invoked by alias); 7 Jan 2013 14:09:51 -0000 Received: (qmail 1643 invoked by uid 55); 7 Jan 2013 14:09:18 -0000 From: "rakdver at iuuk dot mff.cuni.cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55875] [4.8 Regression] IVopts caused miscompilation Date: Mon, 07 Jan 2013 14:09: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: rakdver at iuuk dot mff.cuni.cz X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.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: 2013-01/txt/msg00493.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55875 --- Comment #4 from rakdver at iuuk dot mff.cuni.cz 2013-01-07 14:09:18 UTC --- > this is correct, since it is done in unsigned int. > Next we do: > res = chrec_convert (type, chrec1, at_stmt); > Eventually we go to convert_affine_scev and we set enforce_overflow_semantics > enforce_overflow_semantics = (use_overflow_semantics > && nowrap_type_p (type)); > > This test looks backwards to me. If the type is nowrap, we do not need to > enforce anything about overflows, when it is wrap, then we have to. The test is correct -- here, type is the type we are converting to; so, if the type is nowrap, we have to make sure that the conversion is not creating an overflowing iv. Anyway, that is irrelevant to the problem: the check of scev_probably_wraps_p below should return false -- which is probably what got broken by the #of iterations estimation change. Zdenek