[Bug c++/33808] New: internal compiler error: in write_type, at cp/mangle.c:1651

2007-10-18 Thread brakiozor at caramail dot com
Hello,

I'm working on Dev-cpp this is the output :


Compiler: Default compiler
Building Makefile: "C:\cygwin\tmp\Makefile.win"
Executing  make...
make.exe -f "C:\cygwin\tmp\Makefile.win" all
g++.exe -c toto.cc -o toto.o -I"C:/GTK/INCLUDE"  -I"C:/GTK/INCLUDE/GTK-2.0" 
-I"C:/GTK/INCLUDE/GLIB-2.0"  -I"C:/GTK/INCLUDE/PANGO-1.0" 
-I"C:/GTK/INCLUDE/ATK-1.0"  -I"C:/GTK/INCLUDE/GTKGLEXT-1.0" 
-I"C:/GTK/LIB/GTK-2.0/INCLUDE"  -I"C:/GTK/LIB/GLIB-2.0/INCLUDE" 
-I"C:/GTK/LIB/GTKGLEXT-1.0/INCLUDE"  -I"C:/GTK/INCLUDE/LIBGLADE-2.0" 
-I"C:/GTK/INCLUDE/LIBXML2"  -v -save-temps  

Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.1.2/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=mingw32 --prefix=C:/MinGW --enable-threads
--disable-nls --enable-languages=c,c++ --disable-win32-registry
--disable-shared --enable-fully-dynamic-string --disable-libstdcxx-pch
Thread model: win32
gcc version 4.1.2
 c:/dev-cpp/bin/../libexec/gcc/mingw32/4.1.2/cc1plus.exe -E -quiet -v
-IC:/GTK/INCLUDE -IC:/GTK/INCLUDE/GTK-2.0 -IC:/GTK/INCLUDE/GLIB-2.0
-IC:/GTK/INCLUDE/PANGO-1.0 -IC:/GTK/INCLUDE/ATK-1.0
-IC:/GTK/INCLUDE/GTKGLEXT-1.0 -IC:/GTK/LIB/GTK-2.0/INCLUDE
-IC:/GTK/LIB/GLIB-2.0/INCLUDE -IC:/GTK/LIB/GTKGLEXT-1.0/INCLUDE
-IC:/GTK/INCLUDE/LIBGLADE-2.0 -IC:/GTK/INCLUDE/LIBXML2 -iprefix
c:\dev-cpp\bin\../lib/gcc/mingw32/4.1.2/ toto.cc -fpch-preprocess -o toto.ii

ignoring nonexistent directory
"c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../../include/c++/4.1.2"
ignoring nonexistent directory
"c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../../include/c++/4.1.2/mingw32"
ignoring nonexistent directory
"c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../../include/c++/4.1.2/backward"
ignoring nonexistent directory
"c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../../mingw32/include"
ignoring nonexistent directory
"C:/MinGW/lib/gcc/mingw32/../../../include/c++/4.1.2"
ignoring nonexistent directory
"C:/MinGW/lib/gcc/mingw32/../../../include/c++/4.1.2/mingw32"
ignoring nonexistent directory
"C:/MinGW/lib/gcc/mingw32/../../../include/c++/4.1.2/backward"
ignoring nonexistent directory "C:/MinGW/lib/gcc/mingw32/4.1.2/include"
ignoring nonexistent directory
"C:/MinGW/lib/gcc/mingw32/../../../mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/GTK/INCLUDE
 C:/GTK/INCLUDE/GTK-2.0
 C:/GTK/INCLUDE/GLIB-2.0
 C:/GTK/INCLUDE/PANGO-1.0
 C:/GTK/INCLUDE/ATK-1.0
 C:/GTK/INCLUDE/GTKGLEXT-1.0
 C:/GTK/LIB/GTK-2.0/INCLUDE
 C:/GTK/LIB/GLIB-2.0/INCLUDE
 C:/GTK/LIB/GTKGLEXT-1.0/INCLUDE
 C:/GTK/INCLUDE/LIBGLADE-2.0
 C:/GTK/INCLUDE/LIBXML2
 c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../../include
 c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/include
 C:/MinGW/lib/gcc/mingw32/../../../include
 C:/MinGW/include

 /mingw/include
End of search list.

 c:/dev-cpp/bin/../libexec/gcc/mingw32/4.1.2/cc1plus.exe -fpreprocessed toto.ii
-quiet -dumpbase toto.cc -auxbase-strip toto.o -version -o toto.s

GNU C++ version 4.1.2 (mingw32)
compiled by GNU C version 4.1.2.
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=130982
Compiler executable checksum: 669e873dd1c794b0f5ddbea8fe211782
toto.cc:54: internal compiler error: in write_type, at cp/mangle.c:1651
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html> for instructions.

make.exe: *** [toto.o] Error 1

Execution terminated


the same error occurs on cygwin (v 3.4.4) and on latest ubuntu (v 4.2?)

this is the code:

#include 

using namespace std;

template 
class X
{
public:
X() {}
};

template 
class Y
{
public:
template 
Y(const X&) {}

template 
Y& operator *=(const U&) { return *this; }
};

template 
Y operator *(X& x, const Ty& y)
{
Y res(x);
//res *= y;
return res;
}

template 
Y operator *(const Tx& x, X& y)
{
Y res(y);
//res *= x;
return res;
}

int main()
{
double a;
complex b;
X i;
X > j;

i*a;
a*i;
i*b;
b*i;

j*a;
a*j;
j*b;
b*j;
}


It's my first bug report, How can I give you the .ii file?


-- 
   Summary: internal compiler error: in write_type, at
            cp/mangle.c:1651
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: brakiozor at caramail dot com
 GCC build triplet: x86
  GCC host triplet: x86
GCC target triplet: x86


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



[Bug c++/33808] internal compiler error: in write_type, at cp/mangle.c:1651

2007-10-18 Thread brakiozor at caramail dot com


--- Comment #2 from brakiozor at caramail dot com  2007-10-18 07:56 ---
Created an attachment (id=14369)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14369&action=view)
.ii file


-- 


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



[Bug c++/33808] internal compiler error: in write_type, at cp/mangle.c:1651

2007-10-18 Thread brakiozor at caramail dot com


--- Comment #3 from brakiozor at caramail dot com  2007-10-18 08:06 ---
I found this bug on a more complex program and I did an epurated code.


-- 

brakiozor at caramail dot com changed:

   What|Removed |Added

 CC||brakiozor at caramail dot
   ||com


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



[Bug c++/33808] internal compiler error: in write_type, at cp/mangle.c:1651

2007-10-18 Thread brakiozor at caramail dot com


--- Comment #1 from brakiozor at caramail dot com  2007-10-18 07:55 ---
Created an attachment (id=14368)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14368&action=view)
source code

I was playing a little with template


-- 


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



[Bug c++/33808] internal compiler error: in write_type, at cp/mangle.c:1651

2007-10-19 Thread brakiozor at caramail dot com


--- Comment #5 from brakiozor at caramail dot com  2007-10-19 10:06 ---
yes, one of the way is to pass by an intermediate template type...
(I found it on the web)
but the compiler error could(and should) be fixed

#define TPL_TYPEOF_MUL(A,B) typename typeof_mul::type
#define TYPEOF_MUL(A,B) typeof_mul::type

template 
struct typeof_mul
{
typedef typeof(A()*B()) type;
};

template 
Y operator *(X& x, const Ty& y)
{
Y res(x);
//res *= y;
return res;
}


-- 


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