summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2022-06-19 01:27:19 +0200
committerMark Wielaard <mark@klomp.org>2022-06-19 01:27:19 +0200
commit7e6424852e2d2db4955f6be0090244f14380cb8c (patch)
treeb1974e6f010013a11e2bf77eb6b29dfbd748e51d
parentMerge #1317 (diff)
downloadgccrs-packed.tar.gz
gccrs-packed.tar.bz2
gccrs-packed.tar.xz
Actually set TYPE_PACKED for type_recordpacked
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.
-rw-r--r--gcc/rust/backend/rust-compile-type.cc2
1 files changed, 1 insertions, 1 deletions
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)
312 TyTy::ADTType::ReprOptions repr = type.get_repr_options (); 312 TyTy::ADTType::ReprOptions repr = type.get_repr_options ();
313 if (repr.pack) 313 if (repr.pack)
314 { 314 {
315 TYPE_PACKED (type_record); 315 TYPE_PACKED (type_record) = 1;
316 if (repr.pack > 1) 316 if (repr.pack > 1)
317 { 317 {
318 SET_TYPE_ALIGN (type_record, repr.pack * 8); 318 SET_TYPE_ALIGN (type_record, repr.pack * 8);