Multiply by 2 instead of left-shifting a potentially negative number
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sun, 2 Aug 2020 16:29:56 +0000 (18:29 +0200)
committerGitHub <noreply@github.com>
Sun, 2 Aug 2020 16:29:56 +0000 (18:29 +0200)
fixes GCC ubsan warning in the BLAS tests

kernel/x86_64/zgemv_t_4.c

index 2ab7a67..6221471 100644 (file)
@@ -235,9 +235,9 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i,
         if ( m < 1 ) return(0);
         if ( n < 1 ) return(0);
 
-        inc_x <<= 1;
-        inc_y <<= 1;
-        lda   <<= 1;
+        inc_x *= 2;
+        inc_y *= 2;
+        lda  <<= 1;
        lda4    = lda << 2;
 
        xbuffer = buffer;