On 14 October 2011 10:51, Anders Logg<logg@xxxxxxxxx> wrote:
The FFC tests are failing on my laptop. I might have screwed something
up locally but it might also be related to updating to Ubuntu 11.10
last night which has GCC 4.6.1-9ubuntu3.
Here's the error I get:
Verifying element 2 of 143:<CG2 on a<interval cell in R1>>
GCC compilation failed.
element:<CG2 on a<interval cell in R1>>,
In file included from evaluate_basis.cpp:4:0:
test.h: In member function 'virtual void
test_finite_element_0::evaluate_basis(unsigned int, double*, const
double*, const ufc::cell&) const':
test.h:128:14: error: variable 'tmp0' set but not used
[-Werror=unused-but-set-variable]
test.h:165:14: error: variable 'tmp0' set but not used
[-Werror=unused-but-set-variable]
test.h:202:14: error: variable 'tmp0' set but not used
[-Werror=unused-but-set-variable]
Anyone else seeing this?
Yes, I also get this with the same version of GCC. The problem is code like:
double tmp0 = 0.0;
double tmp1 = 0.0;
double tmp2 = 0.0;
for (unsigned int r = 2; r< 5; r++)
{
tmp0 = 2.0*r*r*(2.0*r-2.0);
tmp1 = 2.0*r*(2.0*r-1.0)*(2.0*r-2.0)/(2.0*r*r*(2.0*r-2.0));
tmp2 = 4.0*r*(r-1.0)*(r-1.0)/(2.0*r*r*(2.0*r-2.0));
basisvalues[r] = (X*basisvalues[r - 1]*tmp1 - basisvalues[r - 2]*tmp2);
}// end loop over 'r'
As you see, tmp0 is not used to compute the entry in basisvalues[].
However, a value is being assigned to it in
tmp0 = 2.0*r*r*(2.0*r-2.0);
maybe this is why it is not being removed by the remove_unused()
function in cpp.py?