This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libstdc++/7491: Problems with valarrays (slices and gslices)


>Number:         7491
>Category:       libstdc++
>Synopsis:       Problems with valarrays (slices and gslices)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 04 15:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        3.3 20020804 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.18 #8 Sat Mar 9 15:33:15 CET 2002 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-languages=c,c++,f77,objc
>Description:
There are problems with valarrays. The slice and general slice subset
assign operators are missing. The included source code ts.C shows the
problem on the main line regarding slices. There are similar problems
using general slices. Earlier versions of gcc compile ts.C without
a problem.    

#include <valarray>

int main()
{
  using namespace std;
  valarray<int> va(12);
  for (int i=0; i<12; i++) 
    va[i] = i+1;

  valarray<int> vb(va[slice(2,4,0)]);
  va[slice(2,4,3)] += vb;
  va[slice(2,4,3)] -= vb;
  va[slice(2,4,3)] *= vb;
  va[slice(2,4,3)] /= vb;
  va[slice(2,4,3)] %= vb;
  va[slice(2,4,3)] ^= vb;
  va[slice(2,4,3)] &= vb;
  va[slice(2,4,3)] |= vb;
  va[slice(2,4,3)] <<= vb;
  va[slice(2,4,3)] >>= vb;
}

Compiling ts.C
g++ -v -o ts ts.C -W -Wall 
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.3 20020804 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE ts.C -D__GNUG__=3 -quiet -dumpbase ts.C -W -Wall -version -o /tmp/ccp5pnrg.s
GNU C++ version 3.3 20020804 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.3 20020804 (experimental).
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/3.3
 /usr/local/include/c++/3.3/i686-pc-linux-gnu
 /usr/local/include/c++/3.3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/include
 /usr/include
End of search list.
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator+=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:11:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:200: error: `
   _Array_augmented_plus' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h:200: error: (Each undeclared 
   identifier is reported only once for each function it appears in.)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator-=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:12:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:201: error: `
   _Array_augmented_minus' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator*=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:13:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:197: error: `
   _Array_augmented_multiplies' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator/=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:14:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:198: error: `
   _Array_augmented_divides' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator%=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:15:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:199: error: `
   _Array_augmented_modulus' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator^=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:16:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:202: error: `_Array_augmented_xor
   ' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator&=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:17:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:203: error: `_Array_augmented_and
   ' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator|=(const std::valarray<_Tp>&) const [with _Tp 
   = int]':
ts.C:18:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:204: error: `_Array_augmented_or' 
   undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator<<=(const std::valarray<_Tp>&) const [with 
   _Tp = int]':
ts.C:19:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:205: error: `
   _Array_augmented_shift_left' undeclared (first use this function)
/usr/local/include/c++/3.3/bits/slice_array.h: In member function `void 
   std::slice_array<_Tp>::operator>>=(const std::valarray<_Tp>&) const [with 
   _Tp = int]':
ts.C:20:   instantiated from here
/usr/local/include/c++/3.3/bits/slice_array.h:206: error: `
   _Array_augmented_shift_right' undeclared (first use this function)

>How-To-Repeat:

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]