From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21767 invoked by alias); 23 Oct 2006 19:39:41 -0000 Received: (qmail 21719 invoked by alias); 23 Oct 2006 19:39:33 -0000 Date: Mon, 23 Oct 2006 19:39:00 -0000 Message-ID: <20061023193933.21718.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/18026] boz initialization of REALs fails In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sgk at troutmask dot apl dot washington dot edu" 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-10/txt/msg02010.txt.bz2 List-Id: ------- Comment #13 from sgk at troutmask dot apl dot washington dot edu 2006-10-23 19:39 ------- Subject: Re: boz initialization of REALs fails On Mon, Oct 23, 2006 at 06:52:06PM -0000, tobias dot burnus at physik dot fu-berlin dot de wrote: > > In the Intel Fortran Compiler > real :: r > data r/some BOZ/ > gives the same result as using the Fortran 2003 statement in ifort: > real :: r > r = real(some boz) > (At least with the "-switch fe_new_BOZ_constants".) (1) I'd need to see an example. (2) The 2 code examples are technically invalid F95. (3) The first code example is invalid in F2003. > Therefore, with Fortran 2003 BOZ support in place, implementing this in > gfortran should then become easier. (Working around will also become easier.( gfortran implements the F2003 intrepetation of a BOZ in a data statement. See the BIG comment in match_boz_constant. What is missing is gfortran does not retain knowledge that a BOZ was seen, so when you hit real r data r/some BOZ/ the "assignment" to r does not know the value can from a BOZ. Hence, a warning/error can't be issued. > (As gfortran accepts [integer] BOZ everywhere, it will also have the problem > whether real( z'F' ) is meant as "convert integer BOZ to integer and then to > real" or as "convert real BOZ to real". Ifort gives a default warning for both > -stand f95 and -stand f03, treating the BOZ differently for those two cases.) I spent a few hours on Friday night and Saturday looking at the F2003 behavior for REAL(z'f'). My first attempt to handle this failed, which I don't understand. I have a plan B. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18026