Commit 4b973018 authored by Dimitris Lampridis's avatar Dimitris Lampridis

sw/fw: silence GCC 11.2 warning

see commit diff for comment with explanation
parent 5aede5ff
......@@ -760,7 +760,15 @@ static inline uint32_t trtl_get_runtime_cycles()
static inline void __smem_atomic_op(volatile int *p, int x,
enum trtl_smem_modifier type)
{
#pragma GCC diagnostic push
/* The way SMEM atomic operations are implemented, it looks like we are trying
to access way beyond the allocated size of p (TRTL_SMEM_TYPE_TO_RANGE here will
add some multiple of TRTL_SMEM_SIZE). GCC -Wall will catch this but in this particular
case it's a false alarm, the Mock Turtle HDL will use the extra address bits to determine
the operation to perform on 'p' */
#pragma GCC diagnostic ignored "-Warray-bounds"
*(volatile int *)(p + (TRTL_SMEM_TYPE_TO_RANGE(type) >> 2)) = x;
#pragma GCC diagnostic pop
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment