From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27345 invoked by alias); 1 Jun 2012 12:29:40 -0000 Received: (qmail 27335 invoked by uid 22791); 1 Jun 2012 12:29:39 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Fri, 01 Jun 2012 12:29:25 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 Date: Fri, 01 Jun 2012 12:29: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: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 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-06/txt/msg00032.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53550 --- Comment #3 from Jakub Jelinek 2012-06-01 12:29:11 UTC --- I'd think --- tree-ssa-loop-niter.c.jj 2012-05-30 14:38:55.000000000 +0200 +++ tree-ssa-loop-niter.c 2012-06-01 14:27:43.202456745 +0200 @@ -1276,13 +1276,14 @@ number_of_iterations_cond (struct loop * practice, but it is simple enough to manage. */ if (!integer_zerop (iv0->step) && !integer_zerop (iv1->step)) { + tree step_type = POINTER_TYPE_P (type) ? sizetype : type; if (code != NE_EXPR) return false; - iv0->step = fold_binary_to_constant (MINUS_EXPR, type, + iv0->step = fold_binary_to_constant (MINUS_EXPR, step_type, iv0->step, iv1->step); iv0->no_overflow = false; - iv1->step = build_int_cst (type, 0); + iv1->step = build_int_cst (step_type, 0); iv1->no_overflow = true; } would match what tree-chrec.c is doing.