From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 14289385DC05 for ; Fri, 30 Jun 2023 10:09:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14289385DC05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2b6a16254a4so26139511fa.0 for ; Fri, 30 Jun 2023 03:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688119770; x=1690711770; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aRbW/VEC0V3xcYlD4zzlWY2npTzrTC5vAf5VxZjQf8U=; b=DTmhzCpWLOuln6aTO9T8UoDfc6QziDCGxHI9V6ZXlJYOUouXtXhGxiLScqlCKBHg2d qegJc0FdPD3FdGjmgtuGfC8EwhY2P828H4IuR8+V4QffjCNfQm65ytdsp5isfaDYyX0M DIbGMd7xRwVAxzUjA9b3H1qsufdaE7ahNfoqM59E/Qv/8pMQAg1XoGyjz3GT2igTMMFR ysaTK2SGJf+O5fLPtIgPzXXkn93rw51B6WtfnfuhDlS+8KBnTsPo5gJv039COMWkb9zO 4/JdgTjGbH1iTgllRZT5kqR8dnKd7lBmMZHJ4zE1u6is4dWo/lprSRWmh4uF05fxbhd6 1xHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688119770; x=1690711770; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aRbW/VEC0V3xcYlD4zzlWY2npTzrTC5vAf5VxZjQf8U=; b=ESwMtlZ1PsAHmZpz1UbMX2NMocH8VL3fVRXizSos+pE3sNKpcd5KXfLQljSMhbJzLf 27MREtCPc4SPLM4ItFZvKfAANZ3SADmDfQJWTwKIq83XViBo6C6EKrI0lrJA8iQVJ99c q8FbaFF9rhUrZdQ0VvJLt6wuqBsNyAuYBAD3V28dw9enpwAc7+xFae9JkMrINEh4ie8J 6lZmPEIRNeiN7dFDmA7pj6Fdi4vzo3PeXZlT2Ed+z/WjVWD1pb3axo9xcRXxXOVaGJQ5 ZSg1Zw/x97scLDv9FiNF38QTw//DOBVsz7DS4hndRjwbBxPY7XgKJYeEQUqoY7mi8yPG T+pg== X-Gm-Message-State: ABy/qLbYs3KgVCqEZtXqDW2ffRuXh8tSkW2I4XNFpSl7f2TvFI+VCxaB L8BSTtD+oTRBU0fi8ggoPnuOEN/cqxGUeQ62QYXCKxGh X-Google-Smtp-Source: APBJJlE4lamHkNSmRZgAcZnFAhJUyKscV1e/t5GmZmxWq8+0zkUjc8YqTQALAfGtHFYEUNgQE8YpjOMAHRu3RADVSIQ= X-Received: by 2002:a2e:9087:0:b0:2b6:ce2a:8813 with SMTP id l7-20020a2e9087000000b002b6ce2a8813mr1550753ljg.42.1688119770261; Fri, 30 Jun 2023 03:09:30 -0700 (PDT) MIME-Version: 1.0 References: <10296585.nUPlyArG6x@fomalhaut> In-Reply-To: <10296585.nUPlyArG6x@fomalhaut> From: Richard Biener Date: Fri, 30 Jun 2023 12:09:17 +0200 Message-ID: Subject: Re: [PATCH] Fix couple of endianness issues in fold_ctor_reference To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Jun 30, 2023 at 11:29=E2=80=AFAM Eric Botcazou via Gcc-patches wrote: > > Hi, > > fold_ctor_reference attempts to use a recursive local processing in order= to > call native_encode_expr on the leaf nodes of the constructor, before fall= ing > back to calling native_encode_initializer if this fails. There are a cou= ple > of issues related to endianness present in it: > 1) it does not specifically handle integral bit-fields; now these are l= eft > justified on big-endian platforms so cannot be treated like ordinary fiel= ds. > 2) it does not check that the constructor uses the native storage order= . > > Proposed fix attached, tested on x86-64/Linux and SPARC/Solaris, OK for t= he > mainline and some branches? OK. thanks, Richard. > > 2023-06-30 Eric Botcazou > > * gimple-fold.cc (fold_array_ctor_reference): Fix head comment. > (fold_nonarray_ctor_reference): Likewise. Specifically deal > with integral bit-fields. > (fold_ctor_reference): Check that the constructor uses the > native storage order. > > > 2023-06-30 Eric Botcazou > > * gcc.c-torture/execute/20230630-1.c: New test. > * gcc.c-torture/execute/20230630-2.c: Likewise. > > -- > Eric Botcazou