From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79451 invoked by alias); 18 Mar 2018 17:19:18 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 79442 invoked by uid 89); 18 Mar 2018 17:19:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Mar 2018 17:19:16 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w2IHJEVO061059 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 18 Mar 2018 10:19:14 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w2IHJDSO061058; Sun, 18 Mar 2018 10:19:13 -0700 (PDT) (envelope-from sgk) Date: Sun, 18 Mar 2018 17:19:00 -0000 From: Steve Kargl To: Thomas =?iso-8859-1?Q?K=F6nig?= Cc: fortran@gcc.gnu.org Subject: Re: Odd bug from Stack Overflow Message-ID: <20180318171913.GA61043@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20180318153958.GB85774@troutmask.apl.washington.edu> <5b6dfedc-425f-6e60-7ef1-4dee23eb2b27@tkoenig.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5b6dfedc-425f-6e60-7ef1-4dee23eb2b27@tkoenig.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00099.txt.bz2 On Sun, Mar 18, 2018 at 06:12:23PM +0100, Thomas König wrote: > Hi Steve, > > This looks like a missing conversion somewhere, > because this works: > > program test > implicit none > integer, parameter :: n = 65536 > real, dimension(n) :: y > integer :: i > y = (/ (1.0, i=1, n) /) > print *,y(2) > if (y(2) /= 1) stop 1 > end program test > > Also, n=65536 is a limit... setting n=2**16-1 actually > works as expected with the orginal test case. Yes, n=2**16-1 works because gfortran switches over from expanding the array constructor into a static temporary variable to scalarizing the implied-do-loop at 2**16. It is a trade-off we made a long time ago for integer, parameter :: i(somebignumber) = [(i,i=1,somebignumer)] See -fmax-array-constructor= option. > This looks like a resolution problem, not something > in the scalarizer. Can you open a PR? Yes. -- Steve