tag 486974 patch
thanks

dp2dpGuBLm is a static function defined in camm_dpa.h.  It contains an
asm statement that defines some labels.  It's inlined multiple times
into the function that calls it.  Since it defines the labels each
time it's inlined, this causes the errors.

If the compiler is GCC, camm_dpa.h attempts to prevent this behavior
by defining a nested function within dp2dpGuBLm, but this doesn't
work.  GCC has supported a noinline attribute since at least 3.1.1
(but not 3.0.4) to specify that a function should not be inlined.  The
attached patch makes ATLAS this attribute, which fixes this problem.

-- 
Matt                                                 http://ftbfs.org/
diff -ru atlas-3.6.0~/include/contrib/camm_dpa.h 
atlas-3.6.0/include/contrib/camm_dpa.h
--- atlas-3.6.0~/include/contrib/camm_dpa.h     2008-07-30 16:09:34.000000000 
-0700
+++ atlas-3.6.0/include/contrib/camm_dpa.h      2008-07-30 16:10:32.000000000 
-0700
@@ -1450,6 +1450,7 @@
 #undef MY_FUNCTION
 #define MY_FUNCTION Mjoin(dp,EXT)
 
+NO_INLINE
 static void
 MY_FUNCTION(aconst TYPE *a,int lda,
              const TYPE *b,
@@ -1482,7 +1483,6 @@
 #undef fixm
 #define fixm c
 #endif    
-    NO_INLINE
     unsigned 
u1=stride*sizeof(*fixm),u2=lda*sizeof(*a),u3=len*sizeof(*movm)/sizeof(float);
 
     ASM (
diff -ru atlas-3.6.0~/include/contrib/camm_scale.h 
atlas-3.6.0/include/contrib/camm_scale.h
--- atlas-3.6.0~/include/contrib/camm_scale.h   2008-07-30 16:09:34.000000000 
-0700
+++ atlas-3.6.0/include/contrib/camm_scale.h    2008-07-30 16:11:18.000000000 
-0700
@@ -109,6 +109,7 @@
 #undef MY_FUNCTION
 #define MY_FUNCTION SCALE
 
+NO_INLINE
 static void
 MY_FUNCTION(const TYPE *b,TYPE *c,int len) {
 
@@ -116,7 +117,6 @@
 #if defined(BETAX) && defined(SCPLX)
   const TYPE z1[2]={{1.0,-1.0},{1.0,-1.0}},*z=z1;
 #endif
-  NO_INLINE
 
 #ifndef SREAL
   len+=len;
diff -ru atlas-3.6.0~/include/contrib/camm_util.h 
atlas-3.6.0/include/contrib/camm_util.h
--- atlas-3.6.0~/include/contrib/camm_util.h    2008-07-30 16:09:34.000000000 
-0700
+++ atlas-3.6.0/include/contrib/camm_util.h     2008-07-30 16:10:50.000000000 
-0700
@@ -82,7 +82,7 @@
 
 #ifdef __GNUC__
 #undef NO_INLINE
-#define NO_INLINE  double sq(double x) {return x*x;}
+#define NO_INLINE  __attribute__((noinline))
 #else
 #undef NO_INLINE
 #define NO_INLINE
diff -ru atlas-3.6.0~/tune/blas/gemv/CASES/ATL_gemv_SSE.c 
atlas-3.6.0/tune/blas/gemv/CASES/ATL_gemv_SSE.c
--- atlas-3.6.0~/tune/blas/gemv/CASES/ATL_gemv_SSE.c    2008-07-30 
16:09:28.000000000 -0700
+++ atlas-3.6.0/tune/blas/gemv/CASES/ATL_gemv_SSE.c     2008-07-30 
16:10:03.000000000 -0700
@@ -575,12 +575,12 @@
 #define MY_FUNCTION FN
 
 
+NO_INLINE
 void
 MY_FUNCTION(int m,int n, const SCALAR alpha,const TYPE *a,
    int lda,const TYPE *b,int binc,
    const SCALAR beta,TYPE *c,int cinc) {
 
-  NO_INLINE
   int ks;
 #ifdef GCCWIN
   void *freeme[4]={NULL,NULL,NULL,NULL};

Reply via email to