www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000280

When Created: 04/20/1999 01:00:01
Against DJGPP version: 2.02
By whom: remio@mail.dotcom.fr
Abstract: Internal compiler error
While re-compiling a GNU tool under W98, I got an internal compiler error on line 78.

Here is the file where it happend: (the line is shown by a comment)

file "McSorter.h"

#ifndef DEFsorter		// prevent multiple includes
#define DEFsorter
#include <assert.h>

/* \Section{Implementation}
    This is quicksort.
 */
//@Man:	sorting	functions
//@{
/*@ManDoc:
    The template function #sort# sorts an array #t# holding #n# elements of type
    #T# using #c# for comparisions. Class #COMPARATOR# must be provide an
    overloaded #operator()(const T& t1,const T& t2)#, that returns
    \begin{description}
    \item[#<0#]		if #t1# is to appear before #t2#,
    \item[#==0#]	if #t1# and #t2# can appear in any order or
    \item[#>0#]		if #t1# is to appear after #t2#.
    \end{description}
 */
template< class COMPARATOR, class T >
static void	sort( T* t, int end, COMPARATOR& compare, int start = 0 )
{
    int		i0, i1, j ;
    double	c ;

    T	work, mid, tmp ;

    work             = t[start] ;
    t[start]         = t[(start+end)/2] ;
    t[(start+end)/2] = work ;

    mid  = t[start] ;
    work = t[end-1] ;

    for(i0 = i1 = start, j = end-1 ; i1 < j ; )
    {
	c = compare(mid,work) ;
	if( c > 0 )
	{
	    tmp   = t[i0] ;
	    t[i0] = work ;
	    i0++ ;
	    i1++ ;
	    work  = t[i1] ;
	    t[i1] = tmp ;
	}
	else if( c < 0 )
	{
	    t[j] = work ;
	    --j ;
	    work = t[j] ;
	}
	else
	{
	    i1++ ;
	    tmp   = t[i1] ;
	    t[i1] = work ;
	    work  = tmp ;
	}
    }

    if( start < i0-1 )
	sort( t, i0, compare, start ) ;
    if( i1+1 < end )
	sort( t, end, compare, i1+1 ) ;
}

#ifndef	_CRAYMPP
/*@ManDoc:
    The template function #sort# sorts an array #t# holding #n# elements of type
    #T#, which must provide an #operator>#.
 */
template< class T >
void	sort( T* t, int n )
	{
	    struct
	    {            /*THIS IS THE LINE WHERE THE ERROR IS SIGNALED!!!*/
		int	operator()(T i, T j)
			{
			    return (i < j) ? -1 : ((j < i) ? 1 : 0) ;
			}
	    } c ;
	    sort(t, n, c, 0) ;
	}
#endif	//@ _CRAYMPP
//@}


#endif // #DEFsorter#

Note added: 04/22/1999 09:00:07
By whom: eliz@is.elta.co.il
Internal compiler errors are compiler bugs.  They should be
reported to the GCC maintainers (send email to bug-gcc@gnu.org).
This bug-tracking systems is only for reporting bugs in the DJGPP
libraries and utilities that are distributed in djdevNNN.zip
archive.

I am closing this bug.

Closed on 04/22/1999 09:00:55: This is a GCC bug, not a DJGPP bug.
By whom: eliz@is.elta.co.il

Workaround added: 04/23/1999 10:00:21
By whom: smithy98@iinet.net.au
I have found that repeatedly re-compiling eventually succeeds after 5 or so attempts. it's time consuming, but the exe is fine.

Solution added: 04/27/1999 04:00:36
By whom: smithy98@iinet.net.au
Windows 95/98 ONLY:

The cause of one of the many internal compiler errors is none other
than the Internet Explorer 4 SP2 windows desktop update. If you have
this installed and you are getting a repetitive internal compiler error
you can:

* - Compile in MS-DOS mode
* - Uninstall the desktop update

Or if you need to still be in windows:
* - Edit in Windows on one PC and compile on another



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010