When the attached program is run, the two output lines are different, when they should be the same. e.g.: lhs=0x22ff6c, rhs=0x22ff68 lhs=0x22ff68, rhs=0x22ff70 This translates into serious bugs, as variables are read incorrectly and random memory is accessed and updated. Release: g++ 3.1 (mingw32 and sparc-solaris-2.7) and g++ 3.2 (mingw32) Environment: Reading specs from d:/local/mingw/bin/../lib/gcc-lib/mingw32/3.1/specs Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host= mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable -languages=f77,c++,objc,ada --disable-win32-registry --disable-shared Thread model: win32 gcc version 3.1 and Reading specs from d:/local/mingw/bin/../lib/gcc-lib/i686-pc-mingw32/3.2/specs Configured with: ../gcc-3.2-20020817-1/configure --enable-languages=c,c++ --pref ix=d:/local/mingw --enable-threads Thread model: win32 gcc version 3.2 (mingw special 20020817-1) and Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.1/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.1 How-To-Repeat: Compile and run the attached program
State-Changed-From-To: open->analyzed State-Changed-Why: confirmed - the non-templated version behaves as expected
Fixed on 3.3 branch and mainline by Kriang's patch for PR 10940: http://gcc.gnu.org/ml/gcc-cvs/2003-06/msg00095.html