From f68782912cc7b0ce5422769376309d5e94f32502 Mon Sep 17 00:00:00 2001 From: zhaojiaying01 Date: Wed, 11 Jul 2018 18:02:31 +0800 Subject: [PATCH] fix gemm assembly bug while compile with clang of NDK17 --- src/operators/math/gemm.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/operators/math/gemm.cpp b/src/operators/math/gemm.cpp index b165af0bb2..d7bc60e3c8 100644 --- a/src/operators/math/gemm.cpp +++ b/src/operators/math/gemm.cpp @@ -1209,12 +1209,12 @@ void WriteWithAddRelu(int mc, int nc, float *c, float *C, int ldc) { // C = A * B, batchnorm(C) void WriteWithBn(int mc, int nc, float *c, float *C, int ldc, float *scale, float *bias) { - int nc1 = nc / 16; + int volatile nc1 = nc / 16; int _nc1 = nc % 16; - int nc2 = _nc1 / 4; - int nc3 = 16 - 4 * (_nc1 % 4); - int step = 4 * (ldc - nc); - int step1 = 4 * (NC - nc); + int volatile nc2 = _nc1 / 4; + int volatile nc3 = 16 - 4 * (_nc1 % 4); + int volatile step = 4 * (ldc - nc); + int volatile step1 = 4 * (NC - nc); asm volatile( "subs %[mc], %[mc], #1 \n\t" -- GitLab