From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2983 invoked by alias); 30 Jan 2006 19:23:18 -0000 Received: (qmail 2935 invoked by uid 48); 30 Jan 2006 19:23:13 -0000 Date: Mon, 30 Jan 2006 19:23:00 -0000 Message-ID: <20060130192313.2934.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/26001] [4.1/4.2 Regression] expand uses the wrong part of the string for array accesses In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tobi at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg03407.txt.bz2 List-Id: ------- Comment #11 from tobi at gcc dot gnu dot org 2006-01-30 19:23 ------- (In reply to comment #10) > (In reply to comment #8) > > Did the regression also happen on 4.1? We should probably revert Feng Wang's > > patch there. > > But there is a latent bug. I don't know a way to reproduce this without Feng's > patch in C or C++, maybe Ada. But the bug is still there. I'm not sure what you're trying to say, so let me rephrase: given the advanced state of 4.1 in the relase cycle, it may make sense to revert Feng Wang's patch in 4.1, and to fix the underlying bug only in the trunk. > Here is the reduced testcase that passes at -O0 but fails at -O1. > CHARACTER*10 INTSTR > CHARACTER C1 > DATA INTSTR / '0123456789' / > > C1 = INTSTR(1:1) > print *, C1 > if(C1 .ne. '0') call abort() > > end Thanks, do you still get '1' in the RTL dump if you change INSTR? IOW, does it address the elements of the string incorrectly, if (c1[1]{lb: 1 sz: 1} != "0"[1]{lb: 1 sz: 1}) ^^^ this (t02.original) looks like a possible off-by-one error. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26001