Skip to content

Commit 5b58e04

Browse files
committed
Try adding alignas(8) to force correct alignment and work around GCC bug
1 parent af1bf51 commit 5b58e04

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/julia.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,14 +2295,15 @@ typedef struct _jl_task_t {
22952295
uint16_t priority;
22962296
// flag indicating whether or not to record timing metrics for this task
22972297
uint8_t metrics_enabled;
2298+
// (alignas(8) is needed in the following fields to work around a GCC bug. See #56626.)
22982299
// timestamp this task first entered the run queue
2299-
_Atomic(uint64_t) first_enqueued_at;
2300+
alignas(8) _Atomic(uint64_t) first_enqueued_at;
23002301
// timestamp this task was most recently scheduled to run
2301-
_Atomic(uint64_t) last_started_running_at;
2302+
alignas(8) _Atomic(uint64_t) last_started_running_at;
23022303
// time this task has spent running; updated when it yields or finishes.
2303-
_Atomic(uint64_t) cpu_time_ns;
2304+
alignas(8) _Atomic(uint64_t) cpu_time_ns;
23042305
// timestamp this task finished (i.e. entered state DONE or FAILED).
2305-
_Atomic(uint64_t) finished_at;
2306+
alignas(8) _Atomic(uint64_t) finished_at;
23062307

23072308
// hidden state:
23082309
// cached floating point environment

0 commit comments

Comments
 (0)