home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2817 < prev    next >
Encoding:
Text File  |  1992-11-21  |  6.8 KB  |  215 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.berkeley.edu!sethg
  3. From: sethg@cs.berkeley.edu (Seth C. Goldstein)
  4. Subject: gcc 2.3.1 bug with pointer to function in c++
  5. Message-ID: <9211212155.AA20927@boing.CS.Berkeley.EDU>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sat, 21 Nov 1992 05:55:58 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 202
  12.  
  13. Machine:    sparc
  14. Version:    gcc version 2.3.1
  15. OS:        SunOS Release 4.1.2
  16. problem:    Assertion fails for type definition.
  17.  
  18. gcc-2.3.1 -DCM5 -gstabs -I. -I/usr/cm5/local/include -I/usr/cm5/include  -Dpe_obj -DPE_CODE -o bin-cm5/threads.o -c threads.C
  19. threads.h: In method `void  Portal<int>::put (int)':
  20. In file included from threads.C:25:
  21. threads.h:148: warning: type specifier omitted for parameter
  22. cp-class.c:4011: failed assertion `TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL'
  23. gcc-2.3.1: Internal compiler error: program cc1plus got fatal signal 6
  24.  
  25.  
  26. threads.h (upto through 148) is:
  27.  
  28. /*                                  tab:4
  29.  *
  30.  * threads.h - macros and class definitions for c+f
  31.  *
  32.  * Copyright (c) 1992 by Seth Copen Goldstein and 
  33.  * Regents of the University of California
  34.  *
  35.  * Permission to use, copy, modify, and distribute this
  36.  * software and its documentation for any purpose and without
  37.  * fee is hereby granted, provided that the above copyright
  38.  * notice appear in all copies.  Copyright holder(s) make no
  39.  * representation about the suitability of this software for
  40.  * any purpose. It is provided "as is" without express or
  41.  * implied warranty.
  42.  *
  43.  * Author:          Seth Copen Goldstein
  44.  * Version:         26
  45.  * Creation Date:   Thu Nov 19 21:49:42 1992
  46.  * Filename:        threads.h
  47.  * History:
  48.  */
  49.  
  50. #ifndef _THREADS_H_
  51. #define _THREADS_H_
  52.  
  53. #include "cm5.h"
  54.  
  55. #ifdef DEBUG
  56. extern "C" void doDebugPrint(char *s, ...);
  57.  
  58. # define trace(x)       //printf("%3d: %-20.20s: %x\n", MYPROC, x, this)
  59. # define debugMsg(x)    doDebugPrint x
  60. #else
  61. # define trace(x)
  62. # define debugMsg(x)    
  63. #endif
  64.  
  65. #define on(x)                   if (MYPROC == x)
  66. #define portalFor(p,i)          Portal<int> p(this, &i)
  67. #define forkReturn(v)           {result.put(v);return;}
  68.  
  69. #define suspend(x)                                                            \
  70.         if (counter)                                                          \
  71.         {                                                                     \
  72.             restart = x;                                                      \
  73.             return;                                                           \
  74.         }                                                                     \
  75.      case x:
  76.  
  77. #define startFrame()                                                          \
  78.         switch (restart)                                                      \
  79.         {                                                                     \
  80.         case 0:
  81.  
  82. #define endFrame()                                                            \
  83.             break;                                                            \
  84.         default:                                                              \
  85.             printf("entered %x with %d.  unknown.\n", this, restart);         \
  86.         }
  87.                                                                               
  88. class Frame;
  89.  
  90. typedef int Codeptr;
  91. typedef void (Frame::*Codeblock)(void);
  92.  
  93. class Frame
  94. {
  95. protected:
  96.     
  97.     // every function that can suspend inherits from this class and get
  98.     // the next three instance variables. 
  99.     
  100.     Codeblock   cb;
  101.     Frame       *next;
  102.     Codeptr     restart;
  103.     int         counter;        // only one counter per frame for this
  104.                                 // implemenation
  105.     
  106.     // the ready que and other globals every Frame uses
  107.     
  108.     static Frame *readyQ;
  109.     static volatile int notDone;
  110.     static Frame *currentFrame;
  111.     static Processor nextProcessor;
  112.     
  113. public:
  114.     inline                  Frame(void);
  115.     inline                  Frame(Codeblock function, int count);
  116.     inline                  Frame(Codeblock function);
  117.     
  118.     inline void             incrCount(void);
  119.     inline void             post(void);
  120.     inline void             run(void);
  121.     inline void             enQ(void);
  122.     inline void             Frame::forceEnQ(void);
  123.     inline int              Frame::isIdle(void);
  124.     inline void             Frame::becomeIdle(void);
  125.     
  126.     static Frame *          deQ(void);
  127.     static void             printQ(void);
  128.     static void             terminate(void);
  129.     static void             initialize(void);
  130. };
  131.  
  132. //  How many counters do you really need for a frame?
  133. //  right now, I am going to try for one per frame and see how it
  134. //  works.  If this is changed change the portal class.
  135.  
  136. #define PINLINE
  137.  
  138. template <class T>
  139. class Portal
  140. {
  141.     Frame *frame;               // frame that *value resides in
  142.     T *value;                   // the address that this portal is for
  143.     Processor proc;             // the processor that frame resides on
  144.     
  145. public:
  146.     Portal(){}
  147.     inline Portal(Frame *f, T *v)
  148.     {
  149.         frame = f;
  150.         value = v;
  151.         proc = MYPROC;
  152.     }
  153.     
  154.     inline Portal(Processor p, Frame *f, T *v)
  155.     {
  156.         frame = f;
  157.         value = v;
  158.         proc = p;
  159.     }
  160.  
  161.     inline Frame *getFrame(void)    { return frame; }
  162.     inline T *getDest(void)         { return value; }
  163.     inline Processor getProc(void)  { return proc; }
  164.  
  165.     inline void         put(T v)
  166.     {
  167.         trace("put");
  168.         if (proc == MYPROC)
  169.         {
  170.             *value = v;
  171.             frame->post();
  172.         }
  173.         else
  174.         {
  175.             void (*foo)(Frame *, T *, Y) = &RemotePost;
  176.             
  177.             debugMsg(("posting to %d!%x(%x) with %d\n", proc, frame,
  178.                       value, v));
  179.             am_rpc3(proc, foo, frame, value, v);
  180.         }
  181.     }
  182.  
  183.     static void         remotepost(Frame *f,
  184.                                    int *adr,
  185.                                    T v);
  186. };
  187.  
  188. //                                    tab:4
  189. //
  190. // threads.C - basic runtime sytstem for c+f
  191. //
  192. // Copyright (c) 1992 by Seth Copen Goldstein and 
  193. // Regents of the University of California
  194. //
  195. // Permission to use, copy, modify, and distribute this
  196. // software and its documentation for any purpose and without
  197. // fee is hereby granted, provided that the above copyright
  198. // notice appear in all copies.  Copyright holder(s) make no
  199. // representation about the suitability of this software for
  200. // any purpose. It is provided "as is" without express or
  201. // implied warranty.
  202. //
  203. // Author:             Seth Copen Goldstein
  204. // Version:            29
  205. // Creation Date:    Thu Nov 19 21:47:56 1992
  206. // Filename:        threads.C
  207. // History:
  208. //
  209. static char _version_string_[] = "\nVersion:1:threads.C\0\n";
  210.  
  211. #include <stdio.h>
  212. #include "threads.h"
  213. ////////////////////////////////////// EOF
  214.  
  215.