[cfarm-users] GCC 8.2 UBsan and runtime error: signed integer overflow

Jeffrey Walton noloader at gmail.com
Tue Nov 27 21:51:54 CET 2018


Hi Everyone,

I've got some self tests failing on PowerPC with GCC 8.2. The program
was compiled with -O1 and -fsanitize=undefined. The program uses
Altivec. A sample finding is shown below.

ppc_simd.h:965 is a vec_add, and it happens on a unsigned int vector.
We don't use signed vector types. I don't believe overflow can happen
and the algorithm depends on unsigned wrap.

I'm only finding two hits on search [1] and neither are a GCC bug
report. The code is clean using Clang 7.0 and sanitizers.

Any ideas what might be going on?

Jeff

[1] https://www.google.com/search?q=GCC+ubsan+"vec_add"++"runtime+error%3A+signed+integer+overflow"

$ ./cryptest.exe tv speck
...

Testing SymmetricCipher algorithm SPECK-64/ECB.
ppc_simd.h:965:38: runtime error: signed integer overflow: 544497990 +
1936613733 cannot be represented in type 'int'
ppc_simd.h:982:38: runtime error: signed integer overflow: 2066890867
- -184737755 cannot be represented in type 'int'
...

Test FAILED.
incorrectly decrypted: 43F7B0E539C4CA8A6D54A9...
...


More information about the cfarm-users mailing list