delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/18/14:33:09

From: Patrick / Albert Fong <ptfong AT flash DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Error: Internal compiler error
Date: Sat, 18 Jan 1997 09:38:44 -0600
Organization: Flashnet Communications
Lines: 43
Message-ID: <32E0EE83.5FA3@flash.net>
Reply-To: ptfong AT flash DOT net
NNTP-Posting-Host: hsh7-171.flash.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

For some reason, I am constantly getting an "Internal compiler error"
when I try to compile this test program.  I have traced the error to the
-funroll-loops flag; if I use that, then it bombs out on me.

Basically, I'm testing some memory routines I wrote:

  manager.MemsetDWords(ptr,0,4096 >> 2); 
  manager.MemcpyBytes(ptr2,ptr,4096);

  int ctr;
  for(ctr=0;ctr<4096;ctr++)	// Bombs because of the loop...
    cout << ptr[ctr] << '\t' << ptr2[ctr] << endl;

MemsetDWords() and MemcpyBytes() are inlined assembly routines similar
to this:
  __asm__ __volatile__	
  (
  "	rep\n"
  "	stosl\n"
  : /* No outputs */
  : "D" (Dest),
    "c" (Size),
    "a" (Value)
  : "memory","%cc","%eax","%ecx","%edi"
  );

I figure that possible reasons for this error are 1)  because my memory
routines are leaking somewhere, causing the compiler to bomb out, 2) I
am not preserving some registers somewhere, 3) this is just a freak
accident, 4) there really is a bug in the compiler...

When I toggle off the -funroll-loops or just get rid of the loop after
the memset/memcpy, there is no bug.  Also, the compiler bombs when I
relocate the for loop anywhere in the main() procedure, so it is not
necessarily the __asm__ procedures, but just the loop.

For now, I guess I'll just not use -funroll-loops...(*sigh*)

Help?

Compiler options:

gcc -g -O2 -funroll-loops -m486 -c tester.cc -o tester.o

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019