[Bug c++/30818] New: [4.1.2 Regression] templates and typedefs cause function prototype not to match

2007-02-16 Thread sschunck at pdf dot de
the following compiled fine on gcc-3.4.6 but gives error on gcc-4.1.2

error: prototype for 'typename AT::B::type AT::B::f()' does not match any
in class 'AT::B'
error: candidate is: typename AT::type AT::B::f()
error: template definition of non-template 'typename AT::B::type
AT::B::f()'


template  typename T  
class A 
{
typedef int type;
class B;
};

template  typename T 
class AT::B
{
typedef typename AT::type type;
type g() { return 0;}
type f();
};

template  typename T 
typename AT::B::type 
AT::B::f() { return 0; }

( I have no vanilla gcc available, so hopefully gentoo guys did not screw up
gcc-4.1.2 )

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/home/portage/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)


-- 
   Summary: [4.1.2 Regression] templates and typedefs cause function
prototype not to match
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sschunck at pdf dot de
  GCC host triplet: i686-pc-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30818



[Bug c++/30821] New: [4.1.2 Regression] templates and typedefs cause function prototype not to match

2007-02-16 Thread sschunck at pdf dot de
the following compiled fine on gcc-3.4.6 but gives error on gcc-4.1.2

error: prototype for 'typename AT::B::type AT::B::f()' does not match any
in class 'AT::B'
error: candidate is: typename AT::type AT::B::f()
error: template definition of non-template 'typename AT::B::type
AT::B::f()'


template  typename T  
class A 
{
typedef int type;
class B;
};

template  typename T 
class AT::B
{
typedef typename AT::type type;
type g() { return 0;}
type f();
};

template  typename T 
typename AT::B::type 
AT::B::f() { return 0; }

( I have no vanilla gcc available, so hopefully gentoo guys did not screw up
gcc-4.1.2 )

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/home/portage/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)


-- 
   Summary: [4.1.2 Regression] templates and typedefs cause function
prototype not to match
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sschunck at pdf dot de
  GCC host triplet: i686-pc-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30821



[Bug c++/25768] New: [3.4 regression] wrong code with inlining at -O2

2006-01-12 Thread sschunck at pdf dot de
the following program will return 1 when compiled with gcc 3.3.x or with gcc
3.4.x   
without optimization and when compiled with gcc 3.4.4 -O2 it return 0


-- 
   Summary: [3.4 regression] wrong code with inlining at -O2
   Product: gcc
   Version: 3.4.4
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sschunck at pdf dot de
  GCC host triplet: SunOS 5.8 Generic_108529-15 i86pc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25768



[Bug c++/25768] [3.4 regression] wrong code with inlining at -O2

2006-01-12 Thread sschunck at pdf dot de


--- Comment #1 from sschunck at pdf dot de  2006-01-12 16:45 ---
Created an attachment (id=10630)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10630action=view)
c++ code

the following assembler snipplet shows that the 

movl$1, (%edx)

is scheduled too early

.globl _ZN1A3fooEP10ybartype_tiS1_RK3xyzPS1_PS2_
.type   _ZN1A3fooEP10ybartype_tiS1_RK3xyzPS1_PS2_, @function
_ZN1A3fooEP10ybartype_tiS1_RK3xyzPS1_PS2_:
.LFB11:
pushl   %ebp
.LCFI25:
movl%esp, %ebp
.LCFI26:
subl$24, %esp
.LCFI27:
movl%esi, -8(%ebp)
.LCFI28:
movl24(%ebp), %eax
movl12(%ebp), %esi
movl%edi, -4(%ebp)
.LCFI29:
movl16(%ebp), %edi
movl%eax, -16(%ebp)
movl8(%ebp), %eax
movl%ebx, -12(%ebp)
.LCFI30:
movl36(%eax), %ebx
movl16(%ebx), %eax
testl   %eax, %eax
je  .L78
movl%eax, %edx
movl28(%ebp), %ecx
cmpl$2, %edi
movl$1, (%edx)
movl(%eax), %eax
movl%edx, (%ecx)
movl%eax, 16(%ebx)
je  .L85

g++-3.4.4 -v -save-temps -O2 fail_comp.cc



Reading specs from
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/specs
Configured with: /common/GNU/gcc/gcc-3.4.4/configure i686-pc-solaris2.8
--with-gnu-as --with-as=/usr/local/gnu/gcc-3.4.4-5.8/as --with-gnu-ld
--with-ld=/usr/local/gnu/gcc-3.4.4-5.8/ld --disable-shared
--enable-languages=c++ --srcdir=/common/GNU/gcc/gcc-3.4.4
--prefix=/usr/local/gnu/gcc-3.4.4-5.8
Thread model: posix
gcc version 3.4.4 (20051127 )

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../libexec/gcc/i686-pc-solaris2.8/3.4.4/cc1plus
-E -quiet -v -iprefix
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/
/users/sschunck/DEVELOPMENT/source/SiCat_cvs/fail_comp.cc -mtune=pentiumpro -O2
-o fail_comp.ii
ignoring nonexistent directory
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../i686-pc-solaris2.8/include
ignoring duplicate directory
/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4
ignoring duplicate directory
/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4/i686-pc-solaris2.8
ignoring duplicate directory
/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4/backward
ignoring duplicate directory
/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/include
ignoring nonexistent directory
/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../i686-pc-solaris2.8/include
#include ... search starts here:
#include ... search starts here:

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4/i686-pc-solaris2.8

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/../../../../include/c++/3.4.4/backward

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/include
 /usr/local/include
 /usr/local/gnu/gcc-3.4.4-5.8/include
 /usr/include
End of search list.

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../libexec/gcc/i686-pc-solaris2.8/3.4.4/cc1plus
-fpreprocessed fail_comp.ii -quiet -dumpbase fail_comp.cc -mtune=pentiumpro
-auxbase fail_comp -O2 -version -o fail_comp.s
GNU C++ version 3.4.4 (20051127 ) (i686-pc-solaris2.8)
compiled by GNU C version 3.4.4 (20051127 ).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=131013
 /usr/local/gnu/gcc-3.4.4-5.8/as -V -Qy -s -o fail_comp.o fail_comp.s
GNU assembler version 2.13.2 (i386-pc-solaris2.6) using BFD version 2.13.2

/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../libexec/gcc/i686-pc-solaris2.8/3.4.4/collect2
-V -Y P,/usr/ccs/lib:/usr/lib -Qy
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/crt1.o
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/crti.o
/usr/ccs/lib/values-Xa.o
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/crtbegin.o
-L/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4
-L/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc
-L/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4 -L/usr/ccs/bin
-L/usr/ccs/lib
-L/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/../../..
-L/usr/local/gnu/gcc-3.4.4-5.8/lib/gcc/i686-pc-solaris2.8/3.4.4/../../..
fail_comp.o -lstdc++ -lm -lgcc -lc -lgcc
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/crtend.o
/local/SunOS-i386-5.8/gnu/gcc-3.4.4-5.8/bin/../lib/gcc/i686-pc-solaris2.8/3.4.4/crtn.o
GNU ld version 2.13.2
  Supported emulations:
   elf_i386_ldso
   elf_i386


-- 


http

[Bug c++/25768] [3.4 regression] wrong code with inlining at -O2

2006-01-12 Thread sschunck at pdf dot de


--- Comment #3 from sschunck at pdf dot de  2006-01-12 17:04 ---
The miscompiled line is

  (*newchild)-kind = interior; ( interior = 1 )

but when 

 movl$1, (%edx)

is done 

 edx points to 

free_list;

from function MemPool::new_element()

instead of newchild


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25768



[Bug c++/25768] [3.4 regression] wrong code with inlining at -O2

2006-01-12 Thread sschunck at pdf dot de


--- Comment #4 from sschunck at pdf dot de  2006-01-12 19:55 ---
additional info:
if instruction 
movl$1, (%edx)
would be located two lines later the generated code would be correct (AFAIK)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25768



[Bug c++/18451] New: [3.4 Regression] C++ error message regression

2004-11-12 Thread sschunck at pdf dot de
The following erroneous code gives an error message I do not understand

file.cc:

  1 template  class T 
  2 class A
  3 {
  4 public:
  5   class B
  6 {
  7   public:
  8   B( int inVal ) :  m_i( inVal ) { }
  9   int m_i;
 10 };
 11   static B s;
 12 };
 13 
 14 template  class T  AT::B AT::s( 10 );



gives the following error message witch g++-3.4.3 -Wall -c file.cc

14: error: expected constructor, destructor, or type conversion before A 
14: error: expected `;' before A

I have difficulties in understancing the message

with g++-3.3.2 -Wall -c file.cc

14: warning: `AT::B' is implicitly a typename
14: warning: implicit typename is deprecated, please see the documentation for
details

This message seems much clearer to me

-- 
   Summary: [3.4 Regression] C++ error message regression
   Product: gcc
   Version: 3.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sschunck at pdf dot de
CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18451