From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5401 invoked by alias); 15 Jan 2009 20:11:10 -0000 Received: (qmail 5349 invoked by uid 48); 15 Jan 2009 20:10:59 -0000 Date: Thu, 15 Jan 2009 20:11:00 -0000 Message-ID: <20090115201059.5348.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/38859] [4.3/4.4 Regression] ubound and lbound treat structure component references as whole arrays In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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: 2009-01/txt/msg01649.txt.bz2 ------- Comment #2 from burnus at gcc dot gnu dot org 2009-01-15 20:10 ------- ida = lbound(a%i) if (any(ida /= (/1,1/))) print *, 'lbound ', ida Here, gfortran prints: lbound 0 2 Correct would be lbound 1 1 ida = ubound(a) >>>>>>>>>>>>>>>>>>>^^^ Here a "%i" is missing otherwise the following line does not make sense: if (any(ida /= (/6,7/))) print *, 'ubound ', ida For ubound(a) the result should be "5 8" which is also gfortran's result. For ubound(a%i): gfortran: 5 8 correct: 6 7 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38859