[PATCH i-g-t 2/3] tests: Shut gcc up abput _Atomic(uint64_t) alignment

Ville Syrjala ville.syrjala at linux.intel.com
Fri Sep 27 16:33:06 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

x86-32 gcc keeps complaining about some alignment ABI change:
"note: the alignment of ‘_Atomic long long unsigned int’ fields changed in GCC 11.1"

State the alignment explicitly to make gcc shut up.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/dumb_buffer.c           | 2 +-
 tests/intel/gem_create.c      | 2 +-
 tests/intel/gem_mmap_offset.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/dumb_buffer.c b/tests/dumb_buffer.c
index e1c18c70b09b..dd237467d3f6 100644
--- a/tests/dumb_buffer.c
+++ b/tests/dumb_buffer.c
@@ -242,7 +242,7 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
 }
 
 struct thread_clear {
-	_Atomic(uint64_t) max;
+	_Atomic(uint64_t) max __attribute__((aligned(8)));
 	uint64_t page_size;
 	int timeout;
 	int fd;
diff --git a/tests/intel/gem_create.c b/tests/intel/gem_create.c
index ca39a8b64a62..f0749d288dcf 100644
--- a/tests/intel/gem_create.c
+++ b/tests/intel/gem_create.c
@@ -206,7 +206,7 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
 }
 
 struct thread_clear {
-	_Atomic(uint64_t) max;
+	_Atomic(uint64_t) max __attribute__((aligned(8)));
 	struct drm_i915_gem_memory_class_instance region;
 	int timeout;
 	int i915;
diff --git a/tests/intel/gem_mmap_offset.c b/tests/intel/gem_mmap_offset.c
index c1a9811ff9d1..3f499abedbbb 100644
--- a/tests/intel/gem_mmap_offset.c
+++ b/tests/intel/gem_mmap_offset.c
@@ -716,7 +716,7 @@ static uint64_t get_npages(_Atomic(uint64_t) *global, uint64_t npages)
 }
 
 struct thread_clear {
-	_Atomic(uint64_t) max;
+	_Atomic(uint64_t) max __attribute__((aligned(8)));
 	struct drm_i915_gem_memory_class_instance region;
 	int timeout;
 	int i915;
-- 
2.45.2



More information about the igt-dev mailing list