Bug 7877

Summary: Incorrect parameter passing to specializations of member function templates
Product: gcc Reporter: anthwil
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Severity: normal CC: gcc-bugs, nathan
Priority: P3 Keywords: wrong-code
Version: 3.2   
Target Milestone: 3.3.1   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-04-30 00:00:00
Attachments: testtemp.cpp

Description anthwil 2002-09-10 02:36:01 UTC
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.

g++ 3.1 (mingw32 and sparc-solaris-2.7) and g++ 3.2 (mingw32)

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


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)


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

Compile and run the attached program
Comment 1 Nathan Sidwell 2002-09-13 07:59:40 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: confirmed - the non-templated version behaves as expected
Comment 2 Volker Reichelt 2003-06-04 08:56:31 UTC
Fixed on 3.3 branch and mainline by Kriang's patch for PR 10940: