X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Claude Freeman Newsgroups: comp.os.msdos.djgpp Subject: Re: CC1.EXE/GCC.EXE crashes with SIGILL, hard. Date: Wed, 14 Mar 2012 15:33:45 -0700 (PDT) Organization: http://groups.google.com Lines: 180 Message-ID: <18281822.945.1331764425192.JavaMail.geo-discussion-forums@ynjx8> References: <16777375 DOT 1302 DOT 1331688966231 DOT JavaMail DOT geo-discussion-forums AT vbat19> <4F60E096 DOT 2060106 AT iki DOT fi> NNTP-Posting-Host: 24.181.125.157 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1331764425 16221 127.0.0.1 (14 Mar 2012 22:33:45 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Wed, 14 Mar 2012 22:33:45 +0000 (UTC) Cc: djgpp AT delorie DOT com, Claude Freeman In-Reply-To: <4F60E096.2060106@iki.fi> Complaints-To: groups-abuse AT google DOT com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.181.125.157; posting-account=7o7X4woAAABllKcaak5lVpiMF9zViaoz User-Agent: G2/1.0 Bytes: 9286 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wednesday, March 14, 2012 1:16:54 PM UTC-5, Andris Pavenis wrote: > On 14.3.2012 2:36, Claude Freeman wrote: > > Hello! > > > > I have a Pentium MMX CPU with around 48 MB RAM. I run Win95c, It's mostly for simple programming practice. I'm trying to use DJGPP to compile a simple hello world program in C, yet instead of a pretty program I get crash dump on my face. > > > > here is the output of all I can give you thus far. > > > > My SET environment... > > > > > > TMP=C:\WINDOWS\TEMP > > TEMP=C:\WINDOWS\TEMP > > PROMPT=$p$g > > winbootdir=C:\WINDOWS > > COMSPEC=C:\WINDOWS\COMMAND.COM > > SOUND=C:\PROGRA~1\CREATIVE\CTSND > > MIDI=SYNTH:1 MAP:E > > windir=C:\WINDOWS > > BLASTER=A220 I5 D1 H1 P330 T6 > > PATH=C:\DJGPP\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND > > DJGPP=c:\djgpp\djgpp.env > > CMDLINE=gcc foo.c -v > > > > The nasty crash dialog I get (there's no dump, for some unknown reason) > > > > When compiling the program with -v , I'll get some output but it's only declaring flags and whatnot: > > > > C:\REMOOD>gcc foo.c -v > > Using built-in specs. > > COLLECT_GCC=c:/djgpp/bin/gcc.exe > > COLLECT_LTO_WRAPPER=c:/djgpp/bin/../libexec/gcc/djgpp/4.62/lto-wrapper.exe > > Target: djgpp > > Configured with: /v203/gcc-4.62/configure djgpp --prefix=/dev/env/DJDIR --disable-nls --disable-werror --enable-languages=c,c++,fortran,objc,obj-c++,ada -enable-libquadmath-support > > Thread model: single > > gcc version 4.6.2 (GCC) > > COLLECT_GCC_OPTIONS='-v' '-mtune=pentium' '-march=pentium' > > c:/djgpp/bin/../libexec/gcc/djgpp/4.62/cc1.exe -quiet -v -iprefix c:/djgpp/bin/../lib/gcc/djgpp/4.62/ -remap foo.c -quiet -dumpbase foo.c -mtune=pentium -march=pentium -auxbase foo -version -o c:/djgpp/tmp/ccDUEyWn.s > > Exiting due to signal SIGILL > > Invalid Opcode at eip=007bbdc8 > > eax=006153eb ebx=00ba4738 ecx=00ba4740 edx=00615779 esi=00ba4740 edi=00aa4774 > > ebp=00ba474c esp=00ba4734 program=C:\DJGPP\LIBEXEC\GCC\DJGPP\4.62\CC1.EXE > > cs: sel=00ff base=8310e000 limit=00baffff > > ds: sel=0107 base=8310e000 limit=00baffff > > es: sel=0107 base=8310e000 limit=00baffff > > fs: sel=00df base=00013350 limit=0000ffff > > gs: sel=0117 base=00000000 limit=0010ffff > > ss: sel=0107 base=8310e000 limit=00baffff > > App stack: [00ba4774..00aa4774] Exceptn stack: [00aa417c..00aa223c] > > > > Call frame traceback EIPs: > > 0x007bbdc8 > > 0x007a5295 > > 0x0079bb17 > I only verified build on Core2 where I built > (I do not have anything older). Still had > build directory on 1Tb USB drive so: > > 1) bfdsymify gives > > C:\REMOOD>gcc foo.c -v > Using built-in specs. > COLLECT_GCC=c:/djgpp/bin/gcc.exe > COLLECT_LTO_WRAPPER=c:/djgpp/bin/../libexec/gcc/djgpp/4.62/lto-wrapper.exe > Target: djgpp > Configured with: /v203/gcc-4.62/configure djgpp --prefix=/dev/env/DJDIR > --disabl > e-nls --disable-werror --enable-languages=c,c++,fortran,objc,obj-c++,ada > -enable > -libquadmath-support > Thread model: single > gcc version 4.6.2 (GCC) > COLLECT_GCC_OPTIONS='-v' '-mtune=pentium' '-march=pentium' > c:/djgpp/bin/../libexec/gcc/djgpp/4.62/cc1.exe -quiet -v -iprefix > c:/djgpp/bin/ > ./lib/gcc/djgpp/4.62/ -remap foo.c -quiet -dumpbase foo.c > -mtune=pentium -march > =pentium -auxbase foo -version -o c:/djgpp/tmp/ccDUEyWn.s > Exiting due to signal SIGILL > Invalid Opcode at eip=007bbdc8 > eax=006153eb ebx=00ba4738 ecx=00ba4740 edx=00615779 esi=00ba4740 > edi=00aa4774 > ebp=00ba474c esp=00ba4734 program=C:\DJGPP\LIBEXEC\GCC\DJGPP\4.62\CC1.EXE > cs: sel=00ff base=8310e000 limit=00baffff > ds: sel=0107 base=8310e000 limit=00baffff > es: sel=0107 base=8310e000 limit=00baffff > fs: sel=00df base=00013350 limit=0000ffff > gs: sel=0117 base=00000000 limit=0010ffff > ss: sel=0107 base=8310e000 limit=00baffff > App stack: [00ba4774..00aa4774] Exceptn stack: [00aa417c..00aa223c] > > Call frame traceback EIPs: > 0x007bbdc8 init_vectorized_lexer+141, file insn-recog.c > 0x007a5295 __main+53, file d0008.S > 0x0079bb17 __crt1_startup+143, file unwind-dw2-fde.c > > From GDB one gets: > > (gdb) disass init_vectorized_lexer > Dump of assembler code for function init_vectorized_lexer: > 0x007bbd3b <+0>: push %ebp > 0x007bbd3c <+1>: mov %esp,%ebp > 0x007bbd3e <+3>: push %esi > 0x007bbd3f <+4>: push %ebx > 0x007bbd40 <+5>: sub $0x10,%esp > 0x007bbd43 <+8>: lea -0x14(%ebp),%ebx > 0x007bbd46 <+11>: lea -0x10(%ebp),%eax > 0x007bbd49 <+14>: lea -0xc(%ebp),%esi > 0x007bbd4c <+17>: push %esi > 0x007bbd4d <+18>: mov %ebx,%ecx > 0x007bbd4f <+20>: push %eax > 0x007bbd50 <+21>: mov %ebx,%edx > 0x007bbd52 <+23>: mov $0x1,%eax > 0x007bbd57 <+28>: movl $0x0,-0x10(%ebp) > 0x007bbd5e <+35>: movl $0x0,-0xc(%ebp) > 0x007bbd65 <+42>: call 0x7bbcd8 <__get_cpuid> > 0x007bbd6a <+47>: pop %edx > 0x007bbd6b <+48>: test %eax,%eax > 0x007bbd6d <+50>: pop %ecx > 0x007bbd6e <+51>: je 0x7bbd9b > 0x007bbd70 <+53>: mov $0x615855,%edx > 0x007bbd75 <+58>: testb $0x10,-0xe(%ebp) > 0x007bbd79 <+62>: jne 0x7bbdcb > ---Type to continue, or q to quit--- > 0x007bbd7b <+64>: mov -0xc(%ebp),%eax > 0x007bbd7e <+67>: mov $0x6157e4,%edx > 0x007bbd83 <+72>: test $0x4000000,%eax > 0x007bbd88 <+77>: jne 0x7bbdcb > 0x007bbd8a <+79>: test $0x2000000,%eax > 0x007bbd8f <+84>: mov $0x615779,%edx > 0x007bbd94 <+89>: mov $0x6153eb,%eax > 0x007bbd99 <+94>: jmp 0x7bbdc8 > 0x007bbd9b <+96>: mov %ebx,%ecx > 0x007bbd9d <+98>: mov %ebx,%edx > 0x007bbd9f <+100>: mov $0x80000001,%eax > 0x007bbda4 <+105>: push %esi > 0x007bbda5 <+106>: push %ebx > 0x007bbda6 <+107>: call 0x7bbcd8 <__get_cpuid> > 0x007bbdab <+112>: pop %edx > 0x007bbdac <+113>: test %eax,%eax > 0x007bbdae <+115>: pop %ecx > 0x007bbdaf <+116>: mov $0x6153eb,%edx > 0x007bbdb4 <+121>: je 0x7bbdcb > 0x007bbdb6 <+123>: mov -0xc(%ebp),%eax > 0x007bbdb9 <+126>: and $0x408000,%eax > 0x007bbdbe <+131>: cmp $0x408000,%eax > 0x007bbdc3 <+136>: mov $0x615779,%eax > 0x007bbdc8 <+141>: cmove %eax,%edx > ---Type to continue, or q to quit--- > 0x007bbdcb <+144>: mov %edx,0x9bd110 > 0x007bbdd1 <+150>: lea -0x8(%ebp),%esp > 0x007bbdd4 <+153>: pop %ebx > 0x007bbdd5 <+154>: pop %esi > 0x007bbdd6 <+155>: pop %ebp > 0x007bbdd7 <+156>: ret > End of assembler dump. > (gdb) > > According to http://en.wikipedia.org/wiki/X86_instruction_listings > instruction CMOVE is added in Pentium Pro, so Pentium MMX > does not have it > > So it seems that specifying host machine does not seem to be sufficient > any more (even it shoud be sufficient). I had: > > build=i586-pc-msdosdjgpp > host=i586-pc-msdosdjgpp > target=i586-pc-msdosdjgpp > > in generated Makefile in directory gcc for stage 3. > > It seems that all 4.6.X versions have the same problem (I checked > disassembler output for 4.6.0). Currently I can only suggest to > try older version (for example some 4.5.X, > 4.4.X, etc). It would be nice to get > feedback about results. > > Andris well, don't that beat all. I bet that's the problem! I'll stil do the dissass and see what comes up, but if it's like last time, it actually gave me a protection fault trying to access that instruction.