From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29055 invoked by alias); 13 Jul 2016 08:03:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29040 invoked by uid 89); 13 Jul 2016 08:03:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=DW_AT_producer, dw_at_producer X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 13 Jul 2016 08:03:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0762ACA373; Wed, 13 Jul 2016 08:03:26 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-204-80.brq.redhat.com [10.40.204.80]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6D83MaQ020790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Jul 2016 04:03:25 -0400 Date: Wed, 13 Jul 2016 08:03:00 -0000 From: Jan Kratochvil To: Christoph Weinmann Cc: qiyaoltc@gmail.com, gdb-patches@sourceware.org Subject: Re: [PATCH] fortran: Print logical values as either .FALSE. or .TRUE. Message-ID: <20160713080321.GA22474@host1.jankratochvil.net> References: <1468396596-19212-1-git-send-email-christoph.t.weinmann@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468396596-19212-1-git-send-email-christoph.t.weinmann@intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00137.txt.bz2 On Wed, 13 Jul 2016 09:56:36 +0200, Christoph Weinmann wrote: > A Logical value in Fortran may be either .FALSE. or .TRUE. > When converting from integer, a subset of compilers evaluate > the whole value, while others only check if the least significant > bit is set. This patch unifies the printing output by evaluating > only the lsb. [...] > + if ((val & 1) == 0) > + fputs_filtered (f_decorations.false_name, stream); > + else > + fputs_filtered (f_decorations.true_name, stream); Doesn't it need to check DW_AT_producer then? GDB already does that in some cases. If the compiler evaluates the whole value, val==16, then GDB will print something different than what the compiler evaluates. Jan