[Dune] gcc 4.4 problem

Carsten Gräser graeser at math.fu-berlin.de
Mon Nov 30 15:13:31 CET 2009


Dear all,
the problem does not occur if I compile with '-O3 -fno-strict-aliasing.'
Adding '-Wstrict-aliasing' shows many warnings that the strict aliasing
rule is broken. Most of them in the EntityPointer base class.

While trying to reduce the problem I found out that my gcc-4.4.1 even
complains about this for test-ug and test-alu2dsimplex in dune-grid
with '-O3 -Wstrict-aliasing'. The same holds true for -O3 -Wall.

Can anyone reproduce this ?

Regards
Carsten

Carsten Gräser schrieb:
> Dear all,
> since using gcc 4.4.1 I have a strange problem with UGGrid.
> For 2 intersection iterators faceA and faceB the following
> conditional (checking if the normals are not parallel) always
> evaluates to true even if the product is 1.
> 
> if (faceA->unitOuterNormal(FieldVector<ctype,dim-1>(0)) *
>     faceB->unitOuterNormal(FieldVector<ctype,dim-1>(0)) < 0.95)
> 
> The strange thing is that this only happens with '-O3 -funroll-loops'.
> Even more strange: If I sent the computed value (or bool) to std::cout
> before or after the condition everything works correctly.
> 
> With gcc-4.3 or using ALUGrid there are no problems.
> 
> Seems to my like a compiler bug. However it is nearly impossible
> to extract a test case. Did anyone of you have similar problems ?
> 
> Regards
> Carsten
> 


-- 
----------------------------------------------------------------------
Carsten Gräser           | phone: +49-30 / 838-75349
Freie Universität Berlin | fax  : +49-30 / 838-54977
Institut für Mathematik  | email: graeser at math.fu-berlin.de
Arnimallee 6             |
14195 Berlin, Germany    | URL  : http://page.mi.fu-berlin.de/graeser
----------------------------------------------------------------------




More information about the Dune mailing list