From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13299 invoked by alias); 8 Jan 2010 17:55:07 -0000 Received: (qmail 13265 invoked by uid 22791); 8 Jan 2010 17:55:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ey-out-1920.google.com (HELO ey-out-1920.google.com) (74.125.78.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jan 2010 17:55:01 +0000 Received: by ey-out-1920.google.com with SMTP id 26so4201311eyw.46 for ; Fri, 08 Jan 2010 09:54:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.51.208 with SMTP id e16mr1654387ebg.5.1262973298141; Fri, 08 Jan 2010 09:54:58 -0800 (PST) In-Reply-To: <20100108172139.25590.qmail@sourceware.org> References: <20100108172139.25590.qmail@sourceware.org> From: Sebastian Pop Date: Fri, 08 Jan 2010 17:55:00 -0000 Message-ID: Subject: Re: [Bug middle-end/42512] [4.5 Regression] integer wrong code bug with loop To: gcc-bugzilla@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2010-01/txt/msg00963.txt.bz2 > Ok, I have that fixed locally at the place of the patch but I wonder if > initial_condition () shouldn't return for example > > =C2=A01ul for (unsigned long) { 1, +, 1 }_1 > This is correct. > and > > =C2=A0(int) i_2 for (int) { i_2, +, 1 }_1 > > and further (for short i_2) > > =C2=A0i_2 for (short) { (int) { i_2, +, 1 }_2, +, 1 }_1 > > ? =C2=A0Can the latter two happen all? Yes, these could happen, and you are right, we should see the initial value of a chrec through the type conversion lenses. > Is it even correct to talk about a > general initial condition in this case? =C2=A0Consider > > =C2=A0{ { 1, +, 1 }_2, +, 1 }_1 > > initial_condition will return 1 for the chrec even though that is not > correct because the initial condition is not constant in loop 1. If you want, there is an initial condition for the loop_1 and that would be {1, +, 1}_2, and there is an initial condition 1 for loop nest loop_2: loop_2 i =3D loop_2_phi (0, i+1) =3D {1, +, 1}_2 loop_1 j =3D loop_1_phi (i, j+1) =3D {{1, +, 1}_2, +, 1}_1 > I suppose I'd only see that if instantiating the chrec at the point > where I placed the fix? =C2=A0So I really only see at most a single outer > conversion around the chrec? Yes, I think that at most you can have only one conversion around a chrec.