Boost logo

Ublas :

From: Paul C. Leopardi (paul.leopardi_at_[hidden])
Date: 2008-03-16 02:42:38

On Sun, 16 Mar 2008, Paul C. Leopardi wrote:
> Hi all,
> I'm getting strange results (below) with iterators in storage_sparse.hpp
> and was wondering if this was a know issue in gcc 4.3.0?

I've narrowed the bug down to a few lines of operator*= in matrix_mult_imp.h
in my own GluCat code:

   440 // Operate only within a common frame
   441 const index_set_t our_frame = lhs.m_frame | rhs.m_frame;
   442 const multivector_t& lhs_ref = (lhs.m_frame == our_frame)
   443 ? lhs
   444 : multivector_t(framed_multi_t(lhs), our_frame, true);
   445 const multivector_t& rhs_ref = (rhs.m_frame == our_frame)
   446 ? rhs
   447 : multivector_t(framed_multi_t(rhs), our_frame, true);

Here multivector_t is a class containing a member of type
ublas::compressed_matrix< Scalar_T, orientation_t >.

When I change const multivector_t& rhs_ref to const multivector_t rhs_ref
the code works. This looks like a compiler bug to me.

It looks like g++ 4.3.0 is corrupting the expression referred to by rhs_ref.
Ugh! Generating a "simple" test case is likely to be a pain of

I also tried to do a regression test of Boost 1.34.1 against gcc 4.3.0 and ran
into problems. I reported the problems on the Boost testing mailing list at

Best, Paul