From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 375113858D20 for ; Thu, 28 Sep 2023 11:03:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 375113858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695898981; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=8/secDBwrN1gLv0SjtMkWV69/zxG0zZGa2ap3i5oOro=; b=KDQRTRW/PaKFv9JRgmCNJnV+mYine0MuZ33s8QqKD4aOCoawSx3+4C7iv4EK15lkc8AHss 54pwmIFFLJKtrLkHfv8bbV3ZxP2sDwaAz56zQeFusndxjH4bYemsmjvfOuXaDUJU2oNc7U QfDj2ZTPeQ+qMWAGhO8XOHJg0q371u8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-i70L9OmWNTeP-ErX5BolOg-1; Thu, 28 Sep 2023 07:02:55 -0400 X-MC-Unique: i70L9OmWNTeP-ErX5BolOg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C7C5101B04C; Thu, 28 Sep 2023 11:02:55 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.202]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E259540C2070; Thu, 28 Sep 2023 11:02:54 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 38SB2poI2652373 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 13:02:51 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 38SB2mLS2652372; Thu, 28 Sep 2023 13:02:48 +0200 Date: Thu, 28 Sep 2023 13:02:48 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: Richard Biener , Thomas Koenig , Toon Moene , gfortran , Jeff Law , gcc-patches Subject: Re: Test with an lto-build of libgfortran. Message-ID: Reply-To: Jakub Jelinek References: <9e347fa4-1940-46c6-a5c9-899cf5a7ae85@moene.org> <646f6454-8619-42cf-915a-4ffff01eb5b6@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <646f6454-8619-42cf-915a-4ffff01eb5b6@codesourcery.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 28, 2023 at 01:00:41PM +0200, Tobias Burnus wrote: > I am not aware of any logigal/integer/real(+comples)/character kind > 16, > except for this PPC one. And complex numbers are pairs of BT_REAL. > > Thus, I think that patch should be fine - except: > > > Does anything error earlier if it is larger? I mean, say user calling > > _gfortan_transfer_integer by hand with kind 1024? > > I think this will fail. We have various ways to deal with this in libgfortran; > I see some cases where the switch "default:" sets the length to 0; we have > other places where we use an "assert", I think we have other places were > we run into UB. > > Thus, one option would be to either 'assert(len <= 16)' or > 'assert((size_t)len < GFC_OTOA_BUF_SIZE - 1)' instead. > > Or we could handle it as len=0 and silently ignore the output or ... > > I am fine with either of the many options - except that I like something > explicit involving 'len' and a comparison (unreachable, assert, regarding as len = 0) > better than the existing warning suppression which is too indirect for > me. (Besides: it does not work for LTO.) Preferences? Tobias Let's go with the __builtin_unreachable, ok for trunk. Jakub