Bug 51320 - djgpp gcc internal compiler error (program cc1plus)
Summary: djgpp gcc internal compiler error (program cc1plus)
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-27 03:02 UTC by Jim Michaels
Modified: 2011-11-28 07:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
.ii file (1.40 KB, application/octet-stream)
2011-11-27 03:02 UTC, Jim Michaels
Details
phone.cpp original program using C++11 initializer lists (2.27 KB, text/plain)
2011-11-27 03:04 UTC, Jim Michaels
Details
test.cpp small discrete test case (296 bytes, text/plain)
2011-11-27 05:27 UTC, Jim Michaels
Details
test.cpp error output from gxx, switches invoked, verbose (524 bytes, application/octet-stream)
2011-11-27 05:39 UTC, Jim Michaels
Details
phone.cpp version without initializer list or map. still crashes. (2.28 KB, text/plain)
2011-11-28 01:12 UTC, Jim Michaels
Details
cpp462b.cpp smaller test case causes compiler internal error (191 bytes, text/plain)
2011-11-28 02:19 UTC, Jim Michaels
Details
cpp462b.errout compiler -v output during compile (509 bytes, application/octet-stream)
2011-11-28 02:22 UTC, Jim Michaels
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Michaels 2011-11-27 03:02:41 UTC
Created attachment 25915 [details]
.ii file

am using DJGPP 2.0.3 current (gcc 4.6.2)
Sat 11/26/2011 18:54:00.78|C:\prj\phone\phone-1.12\dos|>c:\djc462~1\bin\gcc -x c++  -Wall -W -Wextra -v -save-temps  -s  -std=gnu++0x -oa.exe @_TMPSRCQ.LST   2>
errgp
Using built-in specs.
COLLECT_GCC=c:/djc462~1/bin/gcc.exe
COLLECT_LTO_WRAPPER=c:/djc462~1/bin/../libexec/gcc/djgpp/4.62/lto-wrapper.exe
Target: djgpp
Configured with: /v204/gcc-4.62/configure djgpp --prefix=/dev/env/DJDIR --disable-nls --disable-werror --enable-languages=c,c++,fortran,objc,obj-c++,ada --enabl
e-libquadmath-support
Thread model: single
gcc version 4.6.2 (GCC)
COLLECT_GCC_OPTIONS='-Wall' '-Wextra' '-v' '-save-temps' '-s' '-std=gnu++0x' '-o' 'a.exe' '-mtune=pentium' '-march=pentium'
 cc1plus -E -quiet -v -iprefix c:/djc462~1/bin/../lib/gcc/djgpp/4.62/ -remap phone.cpp -mtune=pentium -march=pentium -std=gnu++0x -Wall -Wextra -fpch-preprocess
 -o phone.ii
gcc.exe: internal compiler error:  (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Jim Michaels 2011-11-27 03:04:44 UTC
Created attachment 25916 [details]
phone.cpp original program using C++11 initializer lists

self-contained program source code. uses c++11 (c++0x) features such as initializer lists. don't know if this is foreign to 4.6.2.
Comment 2 Jim Michaels 2011-11-27 05:27:54 UTC
Created attachment 25917 [details]
test.cpp small discrete test case

small discrete test case which seems to do the same thing. assigns initializer list to map.
Comment 3 Jim Michaels 2011-11-27 05:39:06 UTC
Created attachment 25918 [details]
test.cpp error output from gxx, switches invoked, verbose
Comment 4 Jim Michaels 2011-11-27 06:09:12 UTC
djgpp has a problem with the new 4.6.2 compiler where it is unable to generate any temp files with -save-temps. sorry.
Comment 5 Jim Michaels 2011-11-27 06:14:52 UTC
additional interesting stuff: the file initializer_list is not anywhere in the compiler.  
so why should I not simply get a simple error line instead of a compiler internal error?
Comment 6 Andris Pavenis 2011-11-27 07:17:35 UTC
(In reply to comment #4)
> djgpp has a problem with the new 4.6.2 compiler where it is unable to generate
> any temp files with -save-temps. sorry.

I cannot reproduce this problem. -save-temps works for me as expected. Tested both versions from current and beta in DOS session under Windows Vista Business SP2 32 bit.
Comment 7 Andris Pavenis 2011-11-27 07:36:29 UTC
Tested with native compiler for DJGPP both versions 2.03r2 and 2.04 pre. Compiles OK for both with and without optimization enabled (tried without, with -O2 and with -O3). I tested in DOS session under Windows Vista Business XP2 (32 bit)

Also compiles OK with
- Linux to DJGPP cross-compiler (GNU C++ (GCC) version 4.6.2 (i586-pc-msdosdjgpp))
- native compiler for Linux x86_64 (gcc version 4.6.1 20110908 (Red Hat 4.6.1-9) (GCC))

From last attachment it seems that GCC fails very early not finding even cc1plus.
So I suspect a problem with DJGPP installation.

I would suggest to
- Run 'gcc -print-prog-name=cc1plus' and see what it outputs. If it outputs
  only 'cc1plus' without full path then the GCC installation is broken
- test whether You can compiler any C and C++ program at all
- create a paralell fresh DJGPP installation with only required packages and
  retest
Comment 8 Jim Michaels 2011-11-28 01:12:24 UTC
Created attachment 25924 [details]
phone.cpp version without initializer list or map. still crashes.

compiler has no STL.  tried to search for the file vector in include directory.  not there.  I am going to have a talk with delorie...
Comment 9 Jim Michaels 2011-11-28 01:23:08 UTC
Sun 11/27/2011 17:19:49.04|C:\djc462beta\bin|>gcc -print-prog-name=cc1plus
Exiting due to signal SIGSEGV
General Protection Fault at eip=00001bb2
eax=0c720000 ebx=00000299 ecx=0c5898cf edx=3dd60000 esi=00010000 edi=0c730000
ebp=001ebf58 esp=001ebf14 program=C:\DJC462~1\BIN\GCC.EXE
cs: sel=01a7  base=02990000  limit=3dd5ffff
ds: sel=017f  base=00006020  limit=0000ffff
es: sel=01af  base=02990000  limit=3dd5ffff
fs: sel=017f  base=00006020  limit=0000ffff
gs: sel=01bf  base=00000000  limit=0010ffff
ss: sel=01af  base=02990000  limit=3dd5ffff
App stack: [001ec1d8..0006c1dc]  Exceptn stack: [0006c0fc..0006a1bc]

Call frame traceback EIPs:
  0x00001bb2
  0x0002cdc9
  0x0002bfcc
  0x0002c498
  0x00055cca

Sun 11/27/2011 17:19:51.57|C:\DJC462~1\bin|>gxx -print-prog-name=cc1plus

Sun 11/27/2011 17:20:15.26|C:\DJC462~1\bin|>

strange compiler build.  it seems like the entire c++ library is gone.  iostream, vector, map, string...
Comment 10 Jim Michaels 2011-11-28 02:07:37 UTC
I am going to try a test program which does not #include anything and see if it compiles.

Sun 11/27/2011 18:04:02.90|C:\prj\test\djgpp|>c:\djc462~1\bin\gxx  -Wall -W -Wextra  -s   -oa.exe cpp462.cpp
gcc.exe: internal compiler error:  (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Sun 11/27/2011 18:05:58.12|C:\prj\test\djgpp|>type cpp462.cpp
#include <stdio.h>
class furblatz {
        private:
                int neefits;
        public:
                ~furblatz() {}
                furblatz() {neefits=0;}
                furblatz(int i) {neefits=i;}
                void set(int i) {neefits=i;}
                int get() {return neefits;}
                void print() {printf("%d\n", neefits);}
};
int main(void) {
        furblatz f(42);
        f.print();
    return 0;
}
Sun 11/27/2011 18:06:49.10|C:\prj\test\djgpp|>
Comment 11 Jim Michaels 2011-11-28 02:19:25 UTC
Created attachment 25925 [details]
cpp462b.cpp smaller test case causes compiler internal error

Sun 11/27/2011 18:06:49.10|C:\prj\test\djgpp|>dir \djc462beta\include\stdio.h
 Volume in drive C is samsung 2000
 Volume Serial Number is 783C-0FA9

 Directory of C:\djc462beta\include

11/15/1998  08:37 AM             4,395 stdio.h
               1 File(s)          4,395 bytes
               0 Dir(s)  1,136,359,710,720 bytes free

Sun 11/27/2011 18:08:51.26|C:\prj\test\djgpp|>

for cpp462.cpp, stdio.h is there.
but none of the c++ headers or libraries are there at first glance.

Sun 11/27/2011 18:15:28.12|C:\prj\test\djgpp|>c:\djc462~1\bin\gxx -v -oa.exe cpp462b.cpp 2>cpp462b.errout

Sun 11/27/2011 18:15:54.40|C:\prj\test\djgpp|>type cpp462b.errout
Using built-in specs.
COLLECT_GCC=c:\djc462~1\bin/gcc.exe
COLLECT_LTO_WRAPPER=c:/djc462~1/bin/../libexec/gcc/djgpp/4.62/lto-wrapper.exe
Target: djgpp
Configured with: /v204/gcc-4.62/configure djgpp --prefix=/dev/env/DJDIR --disable-nls --disable-werror --enable-languages=c,c++,fortran,objc,obj-c++,ada --enabl
e-libquadmath-support
Thread model: single
gcc version 4.6.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'a.exe' '-mtune=pentium' '-march=pentium'
 cc1plus -quiet -v -iprefix c:/djc462~1/bin/../lib/gcc/djgpp/4.62/ -remap cpp462b.cpp -quiet -dumpbase cpp462b.cpp -mtune=pentium -march=pentium -auxbase cpp462
b -version -o c:/djc462~1/tmp/ccJ419lQ.s
gcc.exe: internal compiler error:  (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Sun 11/27/2011 18:16:18.04|C:\prj\test\djgpp|>type cpp462b.cpp
//#include <stdio.h>
class furblatz {
        private:
                int neefits;
        public:
                ~furblatz() {}
                furblatz() {neefits=0;}
                furblatz(int i) {neefits=i;}
                void set(int i) {neefits=i;}
                int get() {return neefits;}
//              void print() {printf("%d\n", neefits);}
};
int main(void) {
        furblatz f(42);
//      f.print();
    return 0;
}

Sun 11/27/2011 18:16:37.90|C:\prj\test\djgpp|>
Comment 12 Jim Michaels 2011-11-28 02:22:01 UTC
Created attachment 25926 [details]
cpp462b.errout compiler -v output during compile
Comment 13 Jim Michaels 2011-11-28 02:29:07 UTC
Comment on attachment 25916 [details]
phone.cpp original program using C++11 initializer lists

changed filename desc for original test case to be more descriptive.
Comment 14 Andris Pavenis 2011-11-28 04:43:41 UTC
Verify that You have

c:/djc462~1/libexec/gcc/djgpp/4.62/cc1plus.exe at all

(I suspect that it is not there due missing installation of gpp462b.zip
package and use of obsolete GCC wrapper program c:/djc462~1/bin/gxx.exe).
If so than install gpp462b.zip)

Also: inability to invoke C++ compiler at all indicates installation not
compiler error. The discussions about installation errors should happen in 
DJGPP mailing list not here. So I suggest closing this bug as INVALID
Comment 15 Andris Pavenis 2011-11-28 05:18:21 UTC
(In reply to comment #14)
> Verify that You have
> 
> c:/djc462~1/libexec/gcc/djgpp/4.62/cc1plus.exe at all
> 
> (I suspect that it is not there due missing installation of gpp462b.zip
> package and use of obsolete GCC wrapper program c:/djc462~1/bin/gxx.exe).
> If so than install gpp462b.zip)
> 
> Also: inability to invoke C++ compiler at all indicates installation not
> compiler error. The discussions about installation errors should happen in 
> DJGPP mailing list not here. So I suggest closing this bug as INVALID

Crash of 

gcc -print-prog-name=cc1plus

shows that something is very wrong. Anyway better place to discuss
these things is DJGPP mailing list.
Comment 16 Jim Michaels 2011-11-28 07:37:08 UTC
I just fixed this problem by re-downloading and reinstalling the compiler parts. all is fine.  I got into this stupid jang of deleting files I didn't think I needed.  I wasn't paying too much attention, and I must have deleted some crical compiler .zip files in the process.  my fault. sorry.

closing bug as resolved works for me.