From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id E2D4B385E000 for ; Thu, 6 May 2021 14:07:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E2D4B385E000 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=botcazou@adacore.com Received: by mail-wr1-x429.google.com with SMTP id a4so5778203wrr.2 for ; Thu, 06 May 2021 07:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YbIvPYFiJ3s3eWG97Ne4tQVdqKGmPi2DTuT6mBPOQCc=; b=R9HO/EHCk3TVkjXU3goqLy5rqEzKHYGQY7IEVkp7LMc1kmupKA9J/Ohk63HX8SLd7L FSH1T6+evLo5hKQ7FHXlUTY52q3nzabT4mjNpxVvXnMoIJKOEwnISZq9aiNkDAJaZcBk NlRQR5zoGxH41sCc1f4DAO5X5vHwybsnb2FUZ437NIWSO/Y2Cq3rOXHjRqVDraolwPnB EqK1o3n8vOsBbCqD3gUN/R/Van+eXvybo/Rvl/BzfRsVBH0sZu/qONCvFGnNBIgxW+Bf GA7if+89IFLK+jrqdBrlruAKddwYw4lpnN0NXBlgg6JXZ4tN3kWPHF6IOT0RlYCmzxDy jMAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YbIvPYFiJ3s3eWG97Ne4tQVdqKGmPi2DTuT6mBPOQCc=; b=Xouo0pKqxoKC5UCqm/dy5hkDW9yzYPwsXdAIE3pR1zrUDifomwNIOjXyAba74zpbEu yOevprYTnGWCXdN0MO1alK71wA+bsF7jjIsh5oTeJUWpBkkDxrzzOFCXSszcwG6MnByy KIjFp52wnB6nZssqszTWDMXbXaMxvGdOSENJznqA9HyuuOIf+EbNrWciDH9WXQp1D1AU y0H3h9hLVbiiFO1kN+BjYBKdSZ0Co2I5zDmsm2XbMLNR75xIzk/LpLsn22jdtUJ/Sjok Z0e6bnFdR9lk5UG2aOwqY40sMl4hLnlDKsFpWcuUMzxF/5x0nXQApycTLz4WTZgHPK/g 88bg== X-Gm-Message-State: AOAM530iTd6ONsvDNec1J0GKLqq1g9RgbuYdBnXo4FOH7kDDmg2vWFlz ri53swrG5MBg/z8OXGqG4VfMzZZ4gHEShKfP X-Google-Smtp-Source: ABdhPJwz6mZ5ZWgMCV5vPgnANqseZjAL2YvqQW/q94T94t00vKBdUcY0zCqD4DT9aUzN8quXc7wT2w== X-Received: by 2002:adf:f891:: with SMTP id u17mr5531807wrp.352.1620310073998; Thu, 06 May 2021 07:07:53 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:41b:84f0:cf71:f5e0:b050:bede]) by smtp.gmail.com with ESMTPSA id w22sm10537211wmc.13.2021.05.06.07.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:07:53 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Ulrich Weigand Cc: gcc@gcc.gnu.org, gdb@sourceware.org Subject: Re: Issue with pointer types marked with scalar_storage_order Date: Thu, 06 May 2021 16:07:52 +0200 Message-ID: <4620030.GXAFRqVoOG@fomalhaut> In-Reply-To: <20210506123308.GA27332@oc3748833570.ibm.com> References: <20210506123308.GA27332@oc3748833570.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 14:07:56 -0000 > I'm not really sure where exactly the bug is, because I'm not > quite sure if pointer types actually *should* be byte swapped. > > On the one hand, the typical use case of scalar_storage_order > is to simplify accessing binary data (read from a file or the > network) that was generated on a "foreign" architecture that > uses a different byte order. Those use cases are unlikely > to involve any pointer types, since pointer values from a > foreign system are typically not usable on the current > system anyway. > > On the other hand, even the name of the attribute specifically > refers to *scalar* types, and the C standard does classsify > pointer types amongst the scalar type. So maybe this was > originally intended? I don't think so, the feature was first implemented for Ada and, in Ada, pointer types (called access types) are *not* scalar types. So this indeed looks like a small oversight in the implementation. > Any comments or suggestions on what to do here? I'm going to conduct some testing in Ada but, barring unexpected fallout, I would be in favor of changing the GCC implementation. It's presumably a 1- line change in the reverse_storage_order_for_component_p predicate. -- Eric Botcazou