From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11611 invoked by alias); 5 Apr 2012 21:51:12 -0000 Received: (qmail 11601 invoked by uid 22791); 5 Apr 2012 21:51:11 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 21:50:58 +0000 From: "steven.vancoillie at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52884] New: double precision constants promoted to 16 byte by -fdefault-real-8 Date: Thu, 05 Apr 2012 21:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: steven.vancoillie at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-04/txt/msg00390.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52884 Bug #: 52884 Summary: double precision constants promoted to 16 byte by -fdefault-real-8 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: steven.vancoillie@gmail.com Contrary to what the man pages say, double precision constants like '1.d0' get promoted to 16 bytes when using -fdefault-real-8 (without -fdefault-double-8). The man pages at the section of -fdefault-double-8 say however that -fdefault-real-8 does not promote constants like that. Is this an error in the man pages? >>From the man pages: -fdefault-double-8 Set the "DOUBLE PRECISION" type to an 8 byte wide type. If -fdefault-real-8 is given, "DOUBLE PRECISION" would instead be promoted to 16 bytes if possible, and -fdefault-double-8 can be used to prevent this. The kind of real constants like "1.d0" will not be changed by -fdefault-real-8 though, so also -fdefault-double-8 does not affect it. Using e.g. the following program: program doubletrouble real*8 x double precision y write(*,*) kind(x), kind(y), kind(1.d0) end Compiling without any options gives '8 8 8' as output. Compiling with -fdefault-real-8 gives '8 16 16', while I expected it to be '8 16 8' based on the documentation. This is with gfortran 4.7.0 on Linux x86_64 (Intel Core i5 M 540)