[gnu.g++.lib.bug] oops

Raeburn@MIT.EDU (Ken Raeburn) (11/09/89)

------- Forwarded Message

Date: Wed, 8 Nov 89 20:24:55 EST
From: MAILER-DAEMON@MIT.EDU (Mail Delivery Subsystem)
Subject: Returned mail: User unknown
To: <raeburn@MIT.EDU>

   ----- Transcript of session follows -----
>>> RCPT To:<bug-libg++@PREP.AI.MIT.EDU>
<<< 550 <bug-libg++@PREP.AI.MIT.EDU>... User unknown
550 <bug-libg++@prep.ai.mit.edu>... User unknown

   ----- Unsent message follows -----
Received: from PROMETHEUS.MIT.EDU by MIT.EDU with SMTP
	id AA12832; Wed, 8 Nov 89 20:24:55 EST
Received: by prometheus.MIT.EDU (5.61/4.7) id AA29341; Wed, 8 Nov 89 20:25:25 -0500
Date: Wed, 8 Nov 89 20:25:25 -0500
Message-Id: <8911090125.AA29341@prometheus.MIT.EDU>
From: Ken Raeburn <Raeburn@MIT.EDU>
To: bug-libg++@PREP.AI.MIT.EDU, bug-g++@PREP.AI.MIT.EDU
Subject: problems with g++ and libg++ on dec-3100


Configuration: dec-3100; g++ version 1.36.1; gcc version 1.36.

test.hello.cc doesn't compile on the pmax; there is no `struct exec'
in <a.out.h> that gets compiled in.

>g++ -I/var/raeburn/libg++/g++-include  -O -fstrength-reduce  -felide-constructors -fschedule-insns -fdelayed-branch -fsave-memoized  -Wall  -c  tPlex.cc
>tPlex.cc: In function void MPtest ():
>tPlex.cc:535: The following insn was not recognizable:
>(insn/i 117 116 118 (set (reg:SI 93)
>       (neg:SI (mem/s:SI (plus:SI (reg:SI 87)
>                   (const_int 4))))) -1 (nil)
>   (nil))
>g++: Program cc1plus got fatal signal 4.

(Obvious...)  A stripped-down version of the preprocessed source,
which still causes the problem, is included below.  (Compiler options
used were: -O -fstrength-reduce -felide-constructors -fschedule-insns
-fdelayed-branch -fsave-memoized -Wall -S -v.  Removing -O eliminates
the problem.)

>dhrystone.cc: In function void _GLOBAL_$D$dhrystone_cc ():
>dhrystone.cc:691: warning: array size expression for delete ignored

This should probably say something about destructor functions (if
anything at all), rather than expecting the user to know what
"_GLOBAL_$D$foo" means.

>g++ -g -Wall -DGATHER_STATISTICS -O -fdelayed-branch -fsave-memoized -finline-functions -fstrength-reduce -felide-constructors -c  version.cc
>g++: This port of GCC does not support -g flag9@

gperf does not pass GXXFLAGS &c into subdirectories, so it failed
completely on my system.  (It assumed it could use -g.)

The "%e" construct in the compiler specification appears to have some
problems; sometimes a couple of garbage characters are printed after
the word "flag"; it's usually "8@" or "9@".

-- Ken

P.S.  The makefiles for libg++ shouldn't install it in the `all' rule
before preparing the tests.  Better to test the library before
installing it, just in case....

~~~~~~~~~~~~~~~~ foo.cc

typedef void* Pix;
extern unsigned int hash(int );
class intIChunk
{
protected:      
  int*           data;            
  int            base;            
  int            low;             
  int            fence;           
  int            top;             
  intIChunk*     nxt;             
  intIChunk*     prv;
public:
                 intIChunk(int*     d,        
                        int      base_idx,  
                        int      low_idx,  
                        int      fence_idx,
                        int      top_idx);
  virtual int    valid_index(int i);     
};
class intPlex
{
protected:      
  intIChunk*       hd;           
  int              lo;           
  int              fnc;          
  int              csize;        
  int              mods;         
  void             record_change();            
  void             invalidate();               
  void             del_chunk(intIChunk*);         
  intIChunk*       tl();                       
  int              one_chunk();                
public:
                    intPlex();                   
};

class intMChunk : public intIChunk
{
protected:
  unsigned long* map;           
  int            valid(int);
public:
                 intMChunk(int*    d,         
                        int      base_idx,  
                        int      low_idx,   
                        int      fence_idx,
                        int      top_idx);
  int            valid_index(int i);
};
class intMPlex: public intPlex
{
  intMChunk*       ch;           
  int              unused;       
  void             make_initial_chunks(int up = 1);
  void             cache(int idx);
  void             cache(const int* p);
  int              dopred(int);
  int              dosucc(int);
public:
                   intMPlex();                  
                   intMPlex(int ch_size);       
                   intMPlex(int lo,             
                            int ch_size);       
                   intMPlex(int lo,             
                            int hi,             
                            const int  initval, 
                            int ch_size = 0);   
                   intMPlex( intMPlex&);
  void             operator= ( intMPlex&);
  int              valid(int idx);
  void             prev(int& idx);
  void             next(int& x);
  int&             operator [] (int index);
};

inline int intMChunk::valid(int idx)
{
  unsigned int i = idx - base;
  return map[i /  32 ] & (1 << (i & ( 32  - 1)));
}

inline  int intMChunk:: valid_index(int i)
{
  return (i >= low
	  && i < fence
	  && valid(i));
}

static int foo = 17;

inline int& intMPlex:: operator [] (int idx)
{
    (void) (ch->intMChunk::valid_index(idx));
    return foo;
}

extern Pix px;
static intMPlex p(3);

void MPtest () 
{
  px = &p[0];
}

~~~~~~~~~~~~~~~~ end of foo.cc

------- End Forwarded Message