This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Snapshot internal compiler error.


GCC/GCC+ Snapshot 20000905 off of sourceforge gets an internal compiler error while compiling Xerces-c v 1.2 from http://xml.apache.org/xerces-c/  Its seems to be a problem with exception compilation, the message is below with the offending function.  Line 2024 is the final closing }.  Not compiling with -O makes is compile correctly.

g++ -fpic -DLINUX -D_REENTRANT -c -O -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER    -I/home/mmex/xerces-c-src_1_2_0/src/include  -o /home/mmex/xerces-c-src_1_2_0/src/obj/LINUX/XMLScanner.o XMLScanner.cpp
XMLScanner.cpp: In member function `void XMLScanner::scanProlog ()':
XMLScanner.cpp:2024: Internal compiler error in scan_region, at except.c:2808
Please submit a full bug report.


----------------------- Extract of XMLScanner.cpp ---------------------
//
//  Scans all the input from the start of the file to the root element.
//  There does not have to be anything in the prolog necessarily, but usually
//  there is at least an XMLDecl.
//
//  On exit from here we are either at the end of the file or about to read
//  the opening < of the root element.
//
void XMLScanner::scanProlog()
{
   // Get a buffer for whitespace processing
   XMLBufBid bbCData(&fBufMgr);

   //
   //  Loop through the prolog. If there is no content, this could go all
   //  the way to the end of the file.
   //
   //  Note that we use a double loop here to avoid the overhead of the
   //  setup/teardown of the exception handler on each loop.
   //
   bool  acceptXMLDecl = true;
   while (true)
   {
   try
   {
       while (true)
       {
           const XMLCh nextCh = fReaderMgr.peekNextChar();

           // An end of file is legal here between markup
           if (!nextCh)
               return;

           if (nextCh == chOpenAngle)
           {
               //
               //  Ok, it could be the xml decl, a comment, the doc type line,
               //  or the start of the root element.
               //
               if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpace))
               {
                   //
                   //  If we are not at line 1, col 7, then the decl was not
                   //  the first text, so its invalid.
                   //
                   const XMLReader* curReader = fReaderMgr.getCurrentReader();
                   if ((curReader->getLineNumber() != 1)
                   ||  (curReader->getColumnNumber() != 7))
                   {
                       emitError(XMLErrs::XMLDeclMustBeFirst);
                   }
                   scanXMLDecl(Decl_XML);
               }
                else if (fReaderMgr.skippedString(XMLUni::fgPIString))
               {
                   scanPI();
               }
                else if (fReaderMgr.skippedString(XMLUni::fgCommentString))
               {
                   scanComment();
               }
                else if (fReaderMgr.skippedString(XMLUni::fgDocTypeString))
               {
                   //
                   //  We have a doc type. So, ask the validator if it
                   //  supports DTD scanning. if so, let it scan the
                   //  DTD.
                   //
                   if (fValidator->handlesDTD())
                       fValidator->scanDTD(fReuseValidator);
                   else
                       ThrowXML(RuntimeException, XMLExcepts::Gen_NoDTDValidator);

                   // Set the 'have subset' flag
                   fHaveSubset = true;
               }
                else
               {
                   // Assume its the start of the root element
                   return;
               }
           }
            else if (XMLReader::isWhitespace(nextCh))
           {
               //
               //  If we have a document handler then gather up the
               //  whitespace and call back. Otherwise just skip over spaces.
               //
               if (fDocHandler)
               {
                   fReaderMgr.getSpaces(bbCData.getBuffer());
                   fDocHandler->ignorableWhitespace
                   (
                       bbCData.getRawBuffer()
                       , bbCData.getLen()
                       , false
                   );
               }
                else
               {
                   fReaderMgr.skipPastSpaces();
               }
           }
            else
           {
               emitError(XMLErrs::InvalidDocumentStructure);
               fReaderMgr.skipPastChar(chCloseAngle);
           }

           //
           //  Once we make it around once, then we cannot accept the XML
           //  decl now, since it must be first if present.
           //
           acceptXMLDecl = false;
       }
   }

   catch(const EndOfEntityException&)
   {
       //
       //  We should never get an end of entity here. They should only
       //  occur within the doc type scanning method, and not leak out to
       //  here.
       //
       emitError
       (
           XMLErrs::UnexpectedEOE
           , "in prolog"
       );
   }
   }
}

-- 
Matt Monroe
Spinnaker Networks
mmex@spinnakernet.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]