From 01826d5cce965b4bbe73c5747d338791439cc082 Mon Sep 17 00:00:00 2001 From: swgruszka Date: Thu, 16 Apr 2009 11:57:46 +0000 Subject: [PATCH] Allow to compile with modern gcc-4.x compiler, which make some sophisticated loop optimizations. git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@782 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla_isp/common/isp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qla_isp/common/isp.c b/qla_isp/common/isp.c index bc164db..5348464 100644 --- a/qla_isp/common/isp.c +++ b/qla_isp/common/isp.c @@ -2604,6 +2604,14 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay) ISP_SLEEP(isp, wrk); } else { while (enano > (uint64_t) 4000000000U) { +#if defined(__GNUC__) && (__GNUC__ >= 4) + /* + * Prevent to optimize loop, gcc assume libgcc.a + * with __udivdi3 is linked, but this is not + * true when building (linux) kernel + */ + asm("" : "+rm" (enano)); +#endif count += 4000000; enano -= (uint64_t) 4000000000U; } -- 2.17.1