From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 609B73856087 for ; Sun, 19 Jun 2022 00:01:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 609B73856087 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x09.wildebeest.org [172.31.17.139]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EECF7302FB88; Sun, 19 Jun 2022 02:01:51 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 8DEC72E83E02; Sun, 19 Jun 2022 02:01:50 +0200 (CEST) From: Mark Wielaard To: gcc-rust@gcc.gnu.org Cc: Mark Wielaard Subject: [PATCH] Actually set TYPE_PACKED for type_record Date: Sun, 19 Jun 2022 02:01:35 +0200 Message-Id: <20220619000135.806233-1-mark@klomp.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, 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 X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2022 00:01:58 -0000 When bootstrapping with --enable-checking=no you'll get: gcc/rust/backend/rust-compile-type.cc: In member function ‘virtual void Rust::Compile::TyTyResolveCompile::visit(const Rust::TyTy::ADTType&)’: gcc/tree.h:2312:59: error: statement has no effect [-Werror=unused-value] 2312 | #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->base.u.bits.packed_flag) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ gcc/rust/backend/rust-compile-type.cc:315:7: note: in expansion of macro ‘TYPE_PACKED’ 315 | TYPE_PACKED (type_record); | ^~~~~~~~~~~ We need to actually set a value for the packed_flag. --- https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=packed gcc/rust/backend/rust-compile-type.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc index 240abe0497e..eced909673e 100644 --- a/gcc/rust/backend/rust-compile-type.cc +++ b/gcc/rust/backend/rust-compile-type.cc @@ -312,7 +312,7 @@ TyTyResolveCompile::visit (const TyTy::ADTType &type) TyTy::ADTType::ReprOptions repr = type.get_repr_options (); if (repr.pack) { - TYPE_PACKED (type_record); + TYPE_PACKED (type_record) = 1; if (repr.pack > 1) { SET_TYPE_ALIGN (type_record, repr.pack * 8); -- 2.30.2