From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128051 invoked by alias); 18 Sep 2017 11:49:59 -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 128036 invoked by uid 89); 18 Sep 2017 11:49:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=moot X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Sep 2017 11:49:57 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8IBnZVf001179 for ; Mon, 18 Sep 2017 07:49:56 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d29qcp4c1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 18 Sep 2017 07:49:55 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 18 Sep 2017 12:49:52 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 18 Sep 2017 12:49:51 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8IBnpos27787298; Mon, 18 Sep 2017 11:49:51 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EFEB4C044; Mon, 18 Sep 2017 12:46:18 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F3204C040; Mon, 18 Sep 2017 12:46:18 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.178]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 18 Sep 2017 12:46:18 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id 28349D8083B; Mon, 18 Sep 2017 13:49:51 +0200 (CEST) Subject: Re: [RFC][02/19] Target FP: Simplify floatformat_from_type To: simon.marchi@polymtl.ca (Simon Marchi) Date: Mon, 18 Sep 2017 11:49:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <415dd56ab341198fd691755ba80ce8e0@polymtl.ca> from "Simon Marchi" at Sep 17, 2017 05:29:41 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17091811-0040-0000-0000-000003DABE52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091811-0041-0000-0000-000025DBE945 Message-Id: <20170918114951.28349D8083B@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-18_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709180170 X-SW-Source: 2017-09/txt/msg00443.txt.bz2 Simon Marchi wrote: > On 2017-09-05 20:20, Ulrich Weigand wrote: > > size_t len = bit / TARGET_CHAR_BIT; > > - gdb_assert (len >= floatformat_totalsize_bytes (floatformats[0])); > > - gdb_assert (len >= floatformat_totalsize_bytes (floatformats[1])); > > + gdb_assert (len * TARGET_CHAR_BIT >= floatformat->totalsize); > > That looks funny now. Is there a reason not to do > > gdb_assert (bit >= floatformat->totalsize); > > directly? Well, that would use different rounding ... Of course, this only matters when floatformat->totalsize is not a multiple of TARGET_CHAR_BIT, which doesn't happen for any of the floatformats GDB supports, so it is probably moot. Maybe we should instead use an assert to verify that floatformat->totalsize is in fact a multiple of TARGET_CHAR_BIT? Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com