Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
29
 
59
 
30
 
60
 
31
 
61
 
32
/*
62
/*
33
			    VERSION INFORMATION
63
			    VERSION INFORMATION
34
			    ===================
64
			    ===================
35
 
65
 
36
--------------------------------------------------------------------------
66
--------------------------------------------------------------------------
37
$Header: /u/g/release/CVSROOT/Source/src/installers/sparc/common/inlinechoice.c,v 1.1.1.1 1998/01/17 15:55:54 release Exp $
67
$Header: /u/g/release/CVSROOT/Source/src/installers/sparc/common/inlinechoice.c,v 1.1.1.1 1998/01/17 15:55:54 release Exp $
38
--------------------------------------------------------------------------
68
--------------------------------------------------------------------------
39
$Log: inlinechoice.c,v $
69
$Log: inlinechoice.c,v $
40
 * Revision 1.1.1.1  1998/01/17  15:55:54  release
70
 * Revision 1.1.1.1  1998/01/17  15:55:54  release
Line 64... Line 94...
64
int crit_decs	   = 6;
94
int crit_decs	   = 6;
65
int crit_decsatapp = 4;
95
int crit_decsatapp = 4;
66
int show_inlining  = 0;
96
int show_inlining  = 0;
67
 
97
 
68
 
98
 
69
static int  complexity PROTO_S ((exp e, int count, int newdecs));
99
static int  complexity(exp e, int count, int newdecs);
70
static last_new_decs = -999;
100
static last_new_decs = -999;
71
 
101
 
72
/*
102
/*
73
    APPLY COMPLEXITY TO A LIST OF EXPRESSIONS
103
    APPLY COMPLEXITY TO A LIST OF EXPRESSIONS
74
*/
104
*/
75
 
105
 
76
int sbl 
106
int sbl
77
    PROTO_N ( ( e, count, newdecs ) )
-
 
78
    PROTO_T ( exp e X int count X int newdecs )
107
(exp e, int count, int newdecs)
79
{
108
{
80
    int c = complexity ( e, count, newdecs ) ;
109
    int c = complexity(e, count, newdecs);
81
    if ( c < 0 ) return ( c ) ;
110
    if (c < 0) return(c);
82
    if ( last ( e ) ) return ( c ) ;
111
    if (last(e)) return(c);
83
    return ( sbl ( bro ( e ), c, newdecs ) ) ;
112
    return(sbl(bro(e), c, newdecs));
84
}
113
}
85
 
114
 
86
/*
115
/*
87
    FIND THE COMPLEXITY OF AN EXPRESSION
116
    FIND THE COMPLEXITY OF AN EXPRESSION
88
 
117
 
Line 90... Line 119...
90
    (roughly the number of nodes) is greater than count.  As soon as the
119
    (roughly the number of nodes) is greater than count.  As soon as the
91
    complexity exceeds this value it stops.  It returns the difference
120
    complexity exceeds this value it stops.  It returns the difference
92
    between count and the calculated complexity.
121
    between count and the calculated complexity.
93
*/
122
*/
94
 
123
 
95
static int complexity 
124
static int complexity
96
    PROTO_N ( ( e, count, newdecs ) )
-
 
97
    PROTO_T ( exp e X int count X int newdecs )
125
(exp e, int count, int newdecs)
98
{
126
{
99
    unsigned char n = name ( e ) ;
127
    unsigned char n = name(e);
100
    
128
 
101
    last_new_decs = newdecs;
129
    last_new_decs = newdecs;
102
    
-
 
103
    if ( count < 0 )
-
 
104
      return ( -1 ) ;
-
 
105
    if (newdecs > crit_decs )
-
 
106
      return ( -2);
-
 
107
    if ( son ( e ) == nilexp ) 
-
 
108
      return ( count ) ;
-
 
109
 
-
 
110
    switch ( n ) {
-
 
111
 
-
 
112
      case apply_tag : {
-
 
113
	if ( newdecs > crit_decsatapp ) 
-
 
114
	  return ( -3 ) ;
-
 
115
	return ( sbl ( son ( e ),  ( count - 3 ),
-
 
116
		       ( newdecs + 1 ) ) ) ;
-
 
117
      }
-
 
118
 
130
 
-
 
131
    if (count < 0)
-
 
132
      return(-1);
-
 
133
    if (newdecs > crit_decs)
-
 
134
      return(-2);
-
 
135
    if (son(e) == nilexp)
-
 
136
      return(count);
-
 
137
 
-
 
138
    switch (n) {
-
 
139
 
-
 
140
      case apply_tag: {
-
 
141
	if (newdecs > crit_decsatapp)
-
 
142
	  return(-3);
-
 
143
	return(sbl(son(e), (count - 3),
-
 
144
		      (newdecs + 1)));
-
 
145
      }
-
 
146
 
119
      case rep_tag : {
147
      case rep_tag: {
120
	return ( complexity ( bro ( son ( e ) ),  ( count - 1 ),
148
	return(complexity(bro(son(e)), (count - 1),
121
			      (newdecs + 1)));
149
			     (newdecs + 1)));
122
      }
150
      }
123
 
151
 
124
      case res_tag : {
152
      case res_tag: {
125
	return ( complexity ( son ( e ),  ( count + 1 ),
153
	return(complexity(son(e), (count + 1),
126
			      newdecs ) ) ;
154
			      newdecs));
127
      }
155
      }
128
 
156
 
129
      case ident_tag : {
157
      case ident_tag: {
130
	return ( sbl ( son ( e ),  ( count - 1 ),
158
	return(sbl(son(e), (count - 1),
131
		       ( newdecs + 1 ) ) ) ;
159
		      (newdecs + 1)));
132
      }
160
      }
133
 
161
 
134
      case top_tag :
162
      case top_tag:
135
      case prof_tag :
163
      case prof_tag:
136
      case clear_tag : {
164
      case clear_tag: {
137
	return ( count ) ;
165
	return(count);
138
      }
166
      }
139
 
167
 
140
      case case_tag : {
168
      case case_tag: {
141
	return ( complexity ( son ( e ),  ( count - 1 ),
169
	return(complexity(son(e), (count - 1),
142
			      newdecs ) ) ;
170
			      newdecs));
143
      }
171
      }
144
 
172
 
145
      case name_tag :
173
      case name_tag:
146
      case string_tag :
174
      case string_tag:
147
      case env_offset_tag : {
175
      case env_offset_tag: {
148
	return ( count - 1 ) ;
176
	return(count - 1);
149
      }
177
      }
150
 
178
 
151
      case labst_tag : {
179
      case labst_tag: {
152
	return ( complexity ( bro ( son ( e ) ), count, newdecs ) ) ;
180
	return(complexity(bro(son(e)), count, newdecs));
153
      }
181
      }
-
 
182
 
-
 
183
      case cond_tag:
-
 
184
      case solve_tag:
-
 
185
      case seq_tag:
-
 
186
      return(sbl(son(e), count, newdecs));
154
 
187
 
155
      case cond_tag :
-
 
156
      case solve_tag :
-
 
157
      case seq_tag :
-
 
158
      return ( sbl ( son ( e ), count, newdecs ) ) ;
-
 
159
      
-
 
160
      case val_tag:
188
      case val_tag:
161
      return ( SIMM13_SIZE(no(e)) ? count : (count-1));
189
      return(SIMM13_SIZE(no(e))? count :(count-1));
162
	 
190
 
163
      default : {
191
      default : {
164
	return ( sbl ( son ( e ),  ( count - 1 ), newdecs ) ) ;
192
	return(sbl(son(e), (count - 1), newdecs));
165
      }
193
      }
166
    }
194
    }
167
    /* NOT REACHED */
195
    /* NOT REACHED */
168
}
196
}
169
 
197
 
170
#define MASK 3
198
#define MASK 3
171
#define REJ_ONCE (1)
199
#define REJ_ONCE(1)
172
#define OK_ONCE  (2)
200
#define OK_ONCE (2)
173
static char *classify[] = { "Impossible","Never","Always","Sometimes"};
201
static char *classify[] = { "Impossible","Never","Always","Sometimes"};
174
 
202
 
175
int inlinechoice
203
int inlinechoice
176
    PROTO_N ( (t, def, cnt) )
-
 
177
    PROTO_T ( exp t X exp def X int cnt )
204
(exp t, exp def, int cnt)
178
	/* delivers 0 if no uses of this proc can be inlined.
205
	/* delivers 0 if no uses of this proc can be inlined.
179
	   delivers 1 if this use cannot be inlined
206
	   delivers 1 if this use cannot be inlined
180
	   delivers 2 if this use can be inlined.
207
	   delivers 2 if this use can be inlined.
181
	*/
208
	*/
182
{
209
{
183
  int res, left;
210
  int res, left;
184
  
211
 
185
  exp apars;
212
  exp apars;
186
  exp fpars;
213
  exp fpars;
187
  exp pr_ident;
214
  exp pr_ident;
188
  
215
 
189
  int newdecs = 0;
216
  int newdecs = 0;
190
  int no_actuals;
217
  int no_actuals;
191
  int max_complexity;
218
  int max_complexity;
192
 
219
 
193
  int nparam ;
220
  int nparam;
194
  CONST unsigned int CONST_BONUS_UNIT = 16 ;
221
  CONST unsigned int CONST_BONUS_UNIT = 16;
195
  unsigned int const_param_bonus ;
222
  unsigned int const_param_bonus;
196
  unsigned int adjusted_max_complexity ;
223
  unsigned int adjusted_max_complexity;
197
    
224
 
198
/*  static exp last_ident = nilexp;
225
/*  static exp last_ident = nilexp;
199
  static int last_inlined_times;*/
226
  static int last_inlined_times;*/
200
  
227
 
201
  nparam = 0 ;
228
  nparam = 0;
202
  newdecs = 0 ;
229
  newdecs = 0;
203
  const_param_bonus = 0 ;
230
  const_param_bonus = 0;
204
  
231
 
205
  pr_ident = son(t);		/* t is name_tag */
232
  pr_ident = son(t);		/* t is name_tag */
206
  assert(name(pr_ident) == ident_tag);
233
  assert(name(pr_ident) == ident_tag);
207
  
234
 
208
  max_complexity = ( 300 / cnt) ; /* was no(pr_ident), but that changes */
235
  max_complexity = ( 300 / cnt) ; /* was no(pr_ident), but that changes */
209
 
236
 
210
  {
237
  {
211
#define LOG2_ALLOW_EXTRA 2
238
#define LOG2_ALLOW_EXTRA 2
212
    int i;
239
    int i;
213
    if (cnt >=(1<<LOG2_ALLOW_EXTRA))
240
    if (cnt >= (1<<LOG2_ALLOW_EXTRA))
214
    {
241
    {
215
      for (i= cnt >> LOG2_ALLOW_EXTRA ; i>0; i >>=1)
242
      for (i= cnt >> LOG2_ALLOW_EXTRA; i>0; i >>=1)
216
      {
243
      {
217
	max_complexity *= 3;
244
	max_complexity *= 3;
218
	max_complexity /= 2;
245
	max_complexity /= 2;
219
      }
246
      }
220
    }
247
    }
221
#undef LOG2_ALLOW_EXTRA
248
#undef LOG2_ALLOW_EXTRA
222
  }    
249
  }
223
  if ( max_complexity < 15 ) {
250
  if (max_complexity < 15) {
224
    max_complexity = 15 ;
251
    max_complexity = 15;
225
  } else if ( max_complexity > crit_inline) {
252
  } else if (max_complexity > crit_inline) {
226
    max_complexity = crit_inline ;
253
    max_complexity = crit_inline;
227
  }
254
  }
228
 
255
 
229
  if (show_inlining)
256
  if (show_inlining)
230
  {
257
  {
231
    exp proc_in = t;
258
    exp proc_in = t;
232
 
259
 
233
    while (name(proc_in) != proc_tag)
260
    while (name(proc_in)!= proc_tag)
234
    {
261
    {
235
      proc_in = father(proc_in);
262
      proc_in = father(proc_in);
236
      assert (proc_in != nilexp);
263
      assert(proc_in != nilexp);
237
    }
264
    }
238
    proc_in = bro(proc_in);
265
    proc_in = bro(proc_in);
239
    assert (name(proc_in) = ident_tag);
266
    assert(name(proc_in) = ident_tag);
240
         
267
 
241
    fprintf(stderr,"Considering %s in %s\n",
268
    fprintf(stderr,"Considering %s in %s\n",
242
	    brog(pr_ident)->dec_u.dec_val.dec_id,
269
	    brog(pr_ident) ->dec_u.dec_val.dec_id,
243
	    brog(proc_in)->dec_u.dec_val.dec_id);
270
	    brog(proc_in) ->dec_u.dec_val.dec_id);
244
  }
271
  }
245
    
-
 
246
  apars = bro(t);		/* t is name_tag */
-
 
247
  no_actuals = last(t);		/* if so then apars is apply_tag... */  
-
 
248
  fpars = son(def);      	
-
 
249
 
272
 
-
 
273
  apars = bro(t);		/* t is name_tag */
-
 
274
  no_actuals = last(t);		/* if so then apars is apply_tag... */
-
 
275
  fpars = son(def);
-
 
276
 
250
  for(;;) {
277
  for (;;) {
251
     if (name(fpars)!=ident_tag || !isparam(fpars)) { /* first beyond formals */
278
     if (name(fpars)!=ident_tag || !isparam(fpars)) { /* first beyond formals */
252
       if (!last(t))
279
       if (!last(t))
253
	 newdecs = 10; /* more actuals than formals, since last(apars)->break */
280
	 newdecs = 10; /* more actuals than formals, since last(apars)->break */
254
       break;
281
       break;
255
     }
282
     }
256
     nparam++ ;
283
     nparam++;
257
 
284
 
258
     switch (name(apars)) {
285
     switch (name(apars)) {
259
      case val_tag: case real_tag: case string_tag: case name_tag: 
286
      case val_tag: case real_tag: case string_tag: case name_tag:
260
      	   break;
287
      	   break;
261
      case cont_tag: {
288
      case cont_tag: {
262
      	   if (name(son(apars))==name_tag && isvar(son(son(apars))) &&
289
      	   if (name(son(apars)) ==name_tag && isvar(son(son(apars))) &&
263
      	        		!isvar(fpars) ) break;
290
      	        		!isvar(fpars))break;
264
      	   } /* ... else continue */
291
      	   } /* ... else continue */
265
      default: newdecs++;
292
      default: newdecs++;
266
     }
293
     }
267
     switch ( name ( apars ) ) 
294
     switch (name(apars))
268
     {
295
     {
269
      case val_tag : {
296
      case val_tag: {
270
	int n = no ( apars ) ;
297
	int n = no(apars);
271
	
298
 
272
	/* Simple constant param. Increase desire to
299
	/* Simple constant param. Increase desire to
273
	   inline since a constant may cause further
300
	   inline since a constant may cause further
274
	   optimisation, eg strength reduction (mul
301
	   optimisation, eg strength reduction (mul
275
	   to shift) or dead code savings */
302
	   to shift) or dead code savings */
276
 
303
 
277
#define IS_POW2( c )	( ( c ) != 0 && ( ( c ) & ( ( c ) - 1 ) ) == 0 )
304
#define IS_POW2(c)	((c)!= 0 && ((c) & ((c) - 1)) == 0)
278
	
305
 
279
	if ( !SIMM13_SIZE ( n ) ) {
306
	if (!SIMM13_SIZE(n)) {
280
	  /* needs a register - poor */
307
	  /* needs a register - poor */
281
	  const_param_bonus += CONST_BONUS_UNIT / 4 ;
308
	  const_param_bonus += CONST_BONUS_UNIT / 4;
282
	} else if ( n == 0 || ( n > 0 && IS_POW2 ( n ) ) ) {
309
	} else if (n == 0 || (n > 0 && IS_POW2(n))) {
283
	  /* very good */
310
	  /* very good */
284
	  const_param_bonus += CONST_BONUS_UNIT ;
311
	  const_param_bonus += CONST_BONUS_UNIT;
285
	} else {
312
	} else {
286
	  /* less good */
313
	  /* less good */
287
	  const_param_bonus += CONST_BONUS_UNIT / 2 ;
314
	  const_param_bonus += CONST_BONUS_UNIT / 2;
288
	}
315
	}
289
	break ;
316
	break;
290
      }
317
      }
291
 
318
 
292
#undef IS_POW2
319
#undef IS_POW2
293
       
-
 
294
      case real_tag : 
-
 
295
	/* reals not that useful */
-
 
296
	const_param_bonus += CONST_BONUS_UNIT / 4 ;
-
 
297
	break ;
-
 
298
       
-
 
299
      case string_tag :
-
 
300
       case name_tag : 
-
 
301
	 break ;
-
 
302
 
320
 
-
 
321
      case real_tag:
-
 
322
	/* reals not that useful */
-
 
323
	const_param_bonus += CONST_BONUS_UNIT / 4;
-
 
324
	break;
-
 
325
 
-
 
326
      case string_tag:
-
 
327
       case name_tag:
-
 
328
	 break;
-
 
329
 
303
      case cont_tag : 
330
      case cont_tag:
304
	if ( name ( son ( apars ) ) == name_tag &&
331
	if (name(son(apars)) == name_tag &&
305
	    isvar ( son ( son ( apars ) ) ) &&
332
	    isvar(son(son(apars))) &&
306
	    !isvar ( fpars ) ) {
333
	    !isvar(fpars)) {
307
	  break ;
334
	  break;
308
	}
335
	}
309
	/* FALL THROUGH */
336
	/* FALL THROUGH */
310
       
337
 
311
      default : {
338
      default : {
312
	newdecs++ ;
339
	newdecs++;
313
	break ;
340
	break;
314
      }
341
      }
315
     }
342
     }
316
     fpars = bro(son(fpars));
343
     fpars = bro(son(fpars));
317
     if (last(apars)) break;
344
     if (last(apars))break;
318
     apars = bro(apars);
345
     apars = bro(apars);
319
   }
346
   }
320
 
347
 
321
  adjusted_max_complexity = max_complexity ;
348
  adjusted_max_complexity = max_complexity;
322
  
349
 
323
  /* increase to up to 3 times (average around 2) according
350
  /* increase to up to 3 times (average around 2) according
324
     to const params */
351
     to const params */
325
  if ( nparam != 0 ) {
352
  if (nparam != 0) {
326
    adjusted_max_complexity += 
353
    adjusted_max_complexity +=
327
      ( 2 * max_complexity * const_param_bonus ) /
354
     (2 * max_complexity * const_param_bonus) /
328
	( CONST_BONUS_UNIT * nparam ) ;
355
	(CONST_BONUS_UNIT * nparam);
329
  }
356
  }
330
    
357
 
331
  /* increase by number of instructions saved for call */
358
  /* increase by number of instructions saved for call */
332
    adjusted_max_complexity += nparam - newdecs + 1 ;
359
    adjusted_max_complexity += nparam - newdecs + 1;
333
  if (show_inlining)
360
  if (show_inlining)
334
    fprintf(stderr,"%d params %u complexity, %d newdecs -> ",nparam, 
361
    fprintf(stderr,"%d params %u complexity, %d newdecs -> ",nparam,
335
	 adjusted_max_complexity, newdecs);
362
	 adjusted_max_complexity, newdecs);
336
  
363
 
337
  if ( (left = complexity ( fpars,  adjusted_max_complexity, newdecs )) >= 0 )
364
  if ((left = complexity(fpars,  adjusted_max_complexity, newdecs)) >= 0)
338
    res = 2;
365
    res = 2;
339
  else if (newdecs == 0)
366
  else if (newdecs == 0)
340
    res = 0;
367
    res = 0;
341
  else
368
  else
342
    res = 1;
369
    res = 1;
Line 345... Line 372...
345
  {
372
  {
346
    switch (res)
373
    switch (res)
347
    {
374
    {
348
     case 2:
375
     case 2:
349
      fprintf(stderr,"%d left (%d decs) YES\n",left, last_new_decs);
376
      fprintf(stderr,"%d left (%d decs) YES\n",left, last_new_decs);
350
      (ptno(def)) |= OK_ONCE;
377
     (ptno(def)) |= OK_ONCE;
351
      break;
378
      break;
352
     case 1:
379
     case 1:
353
      if (left == -1)
380
      if (left == -1)
354
	fprintf(stderr,"no (count, %d decs)\n", last_new_decs);
381
	fprintf(stderr,"no (count, %d decs)\n", last_new_decs);
355
      else if (left == -2)
382
      else if (left == -2)
356
	fprintf(stderr,"no (decs)\n");
383
	fprintf(stderr,"no (decs)\n");
357
      else
384
      else
358
	fprintf(stderr,"no (appdecs)\n");
385
	fprintf(stderr,"no (appdecs)\n");
359
      
386
 
360
      (ptno(def)) |= REJ_ONCE;
387
     (ptno(def)) |= REJ_ONCE;
361
      break;
388
      break;
362
     case 0:
389
     case 0:
363
      fprintf(stderr,"NO WAY\n");
390
      fprintf(stderr,"NO WAY\n");
364
    }
391
    }
365
 
392
 
366
    fprintf(stderr,"--%s %s\n",brog(pr_ident)->dec_u.dec_val.dec_id, 
393
    fprintf(stderr,"--%s %s\n",brog(pr_ident) ->dec_u.dec_val.dec_id,
367
	    classify[(ptno(def) & MASK)]);
394
	    classify[(ptno(def) & MASK)]);
368
  }
395
  }
369
  
396
 
370
  return res;
397
  return res;
371
  
398
 
372
}
399
}