Hello,
16.03.2026 14:13, Greg Burd wrote:
>> Seems like this might be worth a bug report to the clang people.
> Thanks Alexander for digging and a solid report of the issue, and Michael for spending some time on this, and Tom for
chimingin as well. I agree this looks like a compiler issue. I know that Thomas (added/CC'ed) you've posted bugs
againstclang before, any thoughts on this one?
>
Please find attached the reduced test code, which works for me as follows:
$ clang-20 -O2 -march=rv64gcv crypt-des-test.c -o crypt-des-test && ./crypt-des-test
!!!des_init| un_pbox: 15 6 19 20 28 11 27 16 0 14 22 25 4 17 30 9 1 7 23 13 31 26 2 8 18 12 29 5 21 10 3 24
$ clang-20 -O2 -march=rv64gc crypt-des-test.c -o crypt-des-test && ./crypt-des-test
!!!des_init| un_pbox: 8 16 22 30 12 27 1 17 23 15 29 5 25 19 9 0 7 13 24 2 3 28 10 18 31 11 21 6 4 26 14 20
$ clang-20 -O1 -march=rv64gcv crypt-des-test.c -o crypt-des-test && ./crypt-des-test
!!!des_init| un_pbox: 8 16 22 30 12 27 1 17 23 15 29 5 25 19 9 0 7 13 24 2 3 28 10 18 31 11 21 6 4 26 14 20
$ clang-20 --version
Ubuntu clang version 20.1.2 (0ubuntu1~24.04.2)
Best regards,
Alexander