https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119797
--- Comment #3 from Christoph RĂ¼thing <christoph at muppetnet dot net> --- @Andrew, thank you for checking. You mean in case r >= 16 we hit the dedicated path where "if (r >= 16)" is true and in this branch we know that we will access out of bounds and thus issue the warning? When further thinking about this it makes sense like this, still it is a little bit unintuitive for a user to see this. Especially, since the warning goes away when changing the ordering. With const uint32_t ce = BUG[r]; const uint32_t s = Test<0U>(r); const uint32_t e = Test<1U>(r); const uint32_t cs = BUG[r]; the warning goes away.