From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25233 invoked by alias); 4 Dec 2012 16:44:33 -0000 Received: (qmail 25116 invoked by uid 22791); 4 Dec 2012 16:44:29 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Dec 2012 16:44:24 +0000 Received: from archimedes.net-b.de (port-92-195-66-45.dynamic.qsc.de [92.195.66.45]) by mx02.qsc.de (Postfix) with ESMTP id CD1C327696; Tue, 4 Dec 2012 17:44:22 +0100 (CET) Message-ID: <50BE2866.2090601@net-b.de> Date: Tue, 04 Dec 2012 16:44:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: David Edelsohn CC: GCC Patches Subject: Re: [libquadmath, patch, committed] Fix exponent reading References: <50BE1EBE.8020308@net-b.de> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030001000109060806050400" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00244.txt.bz2 This is a multi-part message in MIME format. --------------030001000109060806050400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 425 David Edelsohn wrote: > I have not tried this patch, but will it actually fix it? The error > is real_kinds(3) is outside the array bounds. Your patch fixes > addresses a runtime problem, not a compile-time problem, if I > understand correctly. Yes, I realized it myself - after a hint by Dominique. The following should fix it. I really shouldn't try to quickly fix such bugs while working on something else :-( Tobias --------------030001000109060806050400 Content-Type: text/x-patch; name="committed.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="committed.diff" Content-length: 1208 Index: ChangeLog =================================================================== --- ChangeLog (Revision 194155) +++ ChangeLog (Arbeitskopie) @@ -1,5 +1,9 @@ 2012-12-04 Tobias Burnus + * gfortran.dg/quad_3.f90: Really fix an if condition. + +2012-12-04 Tobias Burnus + * gfortran.dg/quad_3.f90: Fix a condition, which wrongly required ordered/lazy evaluation. Index: gfortran.dg/quad_3.f90 =================================================================== --- gfortran.dg/quad_3.f90 (Revision 194155) +++ gfortran.dg/quad_3.f90 (Arbeitskopie) @@ -9,13 +9,14 @@ program test_qp implicit none integer, parameter :: QP = real_kinds(ubound(real_kinds,dim=1)) real(kind=qp) :: a,b(2), c - integer :: exponent + integer :: exponent, i character(len=180) :: tmp ! Run this only with libquadmath; assume that all those systems ! have also kind=10. - if (size (real_kinds) >= 4 .and. real_kinds(3) == 10 .and. qp == 16) then - if (real_kinds(3) /= 10) stop + if (size (real_kinds) >= 4 .and. qp == 16) then + i = 3 + if (real_kinds(i) /= 10) stop exponent = 4000 b(:) = huge (1.0_qp)/10.0_qp**exponent --------------030001000109060806050400--