Imported Upstream version 2.9.0
[debian/cc1111] / src / izt / ralloc.c
1 /** @file izt/ralloc.c
2  */
3 #include "izt.h"
4
5 /// Static data.
6 static struct
7   {
8     struct
9       {
10         /// Used to generate a unique name for the spill location.
11         int loc;
12         /// Set of all iTemps spilt onto the stack.
13         set *set;
14         /// Similar to stackSpill
15         bitVect *vect;
16       }
17     spill;
18     /// Bitvector of all registers used in this function.
19     bitVect *funcUsedRegs;
20     /// If a bit is set in this then the iCode at that sequence has had
21     /// registers allocated.
22     bitVect *regAssigned;
23     int blockSpill;
24     int stackExtend;
25   }
26 _G;
27
28 static REG *
29 _findRegById (REG_ID id)
30 {
31   REG *r = izt_port->regs;
32
33   while (r->size)
34     {
35       if (r->id == id)
36         return r;
37       r++;
38     }
39   wassert (0);
40   return NULL;
41 }
42
43 static REG *
44 _getSubReg (REG * r, int size, int offset)
45 {
46   wassert (r->size >= size);
47
48   if (r->size == size)
49     {
50       wassert (offset == 0);
51       return r;
52     }
53   // We use the hiding table to get the parts of the register.
54   else if (size == 1)
55     {
56       wassert (offset == 0 || offset == 1);
57       return _findRegById (r->hides[offset]);
58     }
59   else if (size == 2)
60     {
61       wassert (offset == 0);
62       return _findRegById (r->hides[2]);
63     }
64   // Cant.
65   wassert (0);
66   return NULL;
67 }
68
69 static int
70 _numRegsAvailable (int size)
71 {
72   REG *r = izt_port->regs;
73   int ret = 0;
74
75   while (r->size)
76     {
77       if (r->size == size && r->used == 0)
78         ret++;
79       r++;
80     }
81
82   return ret;
83 }
84
85 static void
86 _setClearUsed (REG_ID id, int clear)
87 {
88   REG *r = _findRegById (id);
89   wassert (r);
90
91   if (!clear)
92     {
93       // The parent shouldnt be able to be allocated if this child
94       // is already.
95       wassert ((r->used & REG_USED_HIDDEN) == 0);
96       r->used |= REG_USED_HIDDEN;
97     }
98   else
99     {
100       wassert ((r->used & REG_USED_HIDDEN) != 0);
101       r->used &= ~REG_USED_HIDDEN;
102     }
103 }
104
105 static void
106 _markAsUsed (REG_ID id)
107 {
108   _setClearUsed (id, FALSE);
109 }
110
111 static void
112 _markAsFree (REG_ID id)
113 {
114   _setClearUsed (id, TRUE);
115 }
116
117 static REG *
118 _allocateReg (int size)
119 {
120   REG *r = izt_port->regs;
121
122   while (r->size)
123     {
124       if (r->size == size && r->used == 0)
125         {
126           // Now go through the interference table and mark all other
127           // registers as used.
128           int i;
129           for (i = 0; i < NUM_OF (r->hides); i++)
130             {
131               if (r->hides[i] == REG_ID_NONE)
132                 {
133                   break;
134                 }
135               _markAsUsed (r->hides[i]);
136             }
137           r->used |= REG_USED;
138           return r;
139         }
140       r++;
141     }
142   return NULL;
143 }
144
145 static bitVect *
146 _markRegBits (bitVect * v, REG * r)
147 {
148   int i;
149
150   // Mark the primary register.
151   v = bitVectSetBit (v, r->id);
152
153   // Now add all the hidden registers.
154   for (i = 0; i < NUM_OF (r->hides); i++)
155     {
156       if (r->hides[i] == REG_ID_NONE)
157         {
158           break;
159         }
160       v = bitVectSetBit (v, r->hides[i]);
161     }
162
163   return v;
164 }
165
166 static void
167 _freeReg (REG * r)
168 {
169   int i;
170   wassert (r->used == REG_USED);
171
172   r->used = 0;
173
174   for (i = 0; i < NUM_OF (r->hides); i++)
175     {
176       if (r->hides[i] == REG_ID_NONE)
177         {
178           break;
179         }
180       _markAsFree (r->hides[i]);
181     }
182 }
183
184 static void
185 _freeAllRegs (viod)
186 {
187   REG *r = izt_port->regs;
188
189   while (r->size)
190     {
191       r->used = 0;
192       r++;
193     }
194 }
195
196 static void
197 _dumpRegs (void)
198 {
199   REG *r = izt_port->regs;
200
201   while (r->size)
202     {
203       printf ("%u\t%u\t%s\t%u\n", r->size, r->id, r->name, r->used);
204       r++;
205     }
206 }
207
208 void
209 izt_init (IZT_PORT * port)
210 {
211   wassert (port && port->regs);
212   izt_port = port;
213   izt_initEmitters ();
214 }
215
216 /// Lower register pressure by packing iTemps where possible.
217 static void
218 _packRegisters (eBBlock * ebp)
219 {
220   // PENDING: Assignment packing
221   // PENDING: Mark address of a true symbol as remat.
222   // PENDING: Propagate remat through equals.
223   // PENDING: Assign bitwise which is followed by a conditional into carry.
224   // PENDING: Pack for one use on pointer get or set.  Assumes that the pointer
225   //  is stored in the scratch register.
226   // PENDING: Pack short use iTemps into ACC or the scratch register.
227 }
228
229 static void
230 _computeRequiredRegs (void)
231 {
232   symbol *sym;
233   int k;
234
235   // Iterate over each live range.
236   for (sym = hTabFirstItem (liveRanges, &k); sym;
237        sym = hTabNextItem (liveRanges, &k))
238     {
239
240       sym->nRegs = 0;
241
242       // If the symbol is never used, then next.
243       if ((sym->liveTo - sym->liveFrom) == 0)
244         continue;
245
246       // Only temporaries need registers.
247       if (!sym->isitmp)
248         continue;
249
250       // Conditionals live in carry and dont need registers.
251       if (sym->regType == REG_TYPE_CND)
252         continue;
253
254
255 #if 0                           // PENDING.  Currently we dont compute ruonly or accuse.
256       if (sym->ruonly || sym->accuse)
257         {
258           if (IS_AGGREGATE (sym->type) || sym->isptr)
259             sym->type = aggrToPtr (sym->type, FALSE);
260           continue;
261         }
262 #endif
263       // We need registers.
264       if (IS_AGGREGATE (sym->type) || sym->isptr)
265         {
266           // Turn an aggregate into something real.
267           sym->type = aggrToPtr (sym->type, FALSE);
268         }
269
270       sym->nRegs = getSize (sym->type);
271       wassert (sym->nRegs <= 4);
272     }
273 }
274
275 static bool
276 _doesntNeedRegs (iCode * ic)
277 {
278   // Some types of instructions dont need registers.
279   // PENDING: Flush out the types and make processor specific.
280   if (SKIP_IC2 (ic) ||
281       ic->op == JUMPTABLE ||
282       ic->op == IFX ||
283       ic->op == IPUSH ||
284       ic->op == IPOP ||
285       ic->op == RETURN)
286     {
287       return TRUE;
288     }
289   return FALSE;
290 }
291
292 static bool
293 _willCauseSpill (int size)
294 {
295   return _numRegsAvailable (size) == 0;
296 }
297
298 static void
299 _deassignLRs (iCode * ic, eBBlock * ebp)
300 {
301   symbol *sym;
302   int ignored;
303   symbol *result;
304
305   // For each symbol
306   for (sym = hTabFirstItem (liveRanges, &ignored); sym; sym = hTabNextItem (liveRanges, &ignored))
307     {
308
309       // Has this symbol expired yet?
310       if (sym->liveTo > ic->seq)
311         {
312           // No.  Cant deassign.
313           continue;
314         }
315
316       // It has expired.  Free up the resources.
317
318       // If it was spilt, then free up the stack spill location.
319       if (sym->isspilt)
320         {
321           if (sym->stackSpil)
322             {
323               sym->usl.spillLoc->isFree = 1;
324               sym->stackSpil = 0;
325             }
326           continue;
327         }
328
329       // If it currently has no registers assigned, then continue.
330       if (bitVectBitValue (_G.regAssigned, sym->key) == 0)
331         {
332           continue;
333         }
334
335       // If it has no registers assigned to it, then continue.
336       if (sym->nRegs == 0)
337         {
338           continue;
339         }
340
341       // Mark this sym as not having registers assigned.
342       bitVectUnSetBit (_G.regAssigned, sym->key);
343
344       // Free the registers.
345       _freeReg (sym->regs[0]);
346
347       // If deallocating will free up enough registers for this iCode
348       // then steal them immediatly.
349       if (IC_RESULT (ic) && !_doesntNeedRegs (ic))
350         {
351           result = OP_SYMBOL (IC_RESULT (ic));
352           if (result &&         // Has a result
353                result->liveTo > ic->seq &&      // and lives past this instruction
354                result->liveTo <= ebp->lSeq &&   // and doesnt go past this block
355                result->nRegs && // and actually needs registers
356                !result->isspilt &&      // and doesnt have them yet
357                !result->remat &&        // and wouldnt waste them
358                !bitVectBitValue (_G.regAssigned, result->key) &&        // doesnt have them yet
359                !_willCauseSpill (result->nRegs)
360             )
361             {
362               result->regs[0] = _allocateReg (result->nRegs);
363             }
364         }
365     }
366 }
367
368 /// Returns true if the live range of the given symbol doesnt overlap
369 /// with any of the live ranges in the set.
370 static bool
371 _noOverlap (set * itmpStack, symbol * fsym)
372 {
373   symbol *sym;
374
375   for (sym = setFirstItem (itmpStack); sym; sym = setNextItem (itmpStack))
376     {
377       if (sym->liveTo > fsym->liveFrom)
378         {
379           return FALSE;
380         }
381     }
382   return TRUE;
383 }
384
385 /// Set operator that returns 1 if a free spill location is found.
386 DEFSETFUNC (_stackIsFree)
387 {
388   symbol *sym = item;
389   V_ARG (symbol **, sloc);
390   V_ARG (symbol *, fsym);
391
392   // Dont bother if one has already been found.
393   if (*sloc)
394     return 0;
395
396   if (sym->isFree &&            // This location is free...
397        _noOverlap (sym->usl.itmpStack, fsym) &&         // and its usage doesnt overlap with the usage of this sym
398        getSize (sym->type) >= getSize (fsym->type) &&   // and the location is big enough to hold the sym
399        1)
400     {
401       // All good.  Take this location.
402       *sloc = sym;
403       return 1;
404     }
405   else
406     {
407       // No match.
408       return 0;
409     }
410 }
411
412 /// Create a new spill location on the stack for this symbol.
413 symbol *
414 _createStackSpill (symbol * sym)
415 {
416   symbol *sloc = NULL;
417
418   // Try to reuse an exisiting spill location.
419   if (applyToSet (_G.spill.set, _stackIsFree, &sloc, sym))
420     {
421       // Found one.  Take it over.
422       sym->usl.spillLoc = sloc;
423       sym->stackSpil = TRUE;
424       sloc->isFree = 0;
425       addSetHead (&sloc->usl.itmpStack, sym);
426       return sym;
427     }
428
429   // No existing location.  Time to create one.
430   // Give it a pretty name.
431   sprintf (buffer, "sloc%d", ++_G.spill.loc);
432   // And create.
433   sloc = newiTemp (buffer);
434
435   // Setup the type.
436   sloc->type = copyLinkChain (sym->type);
437   sloc->etype = getSpec (sloc->type);
438   SPEC_SCLS (sloc->etype) = S_AUTO;
439
440   allocLocal (sloc);
441
442   // "To prevent compiler warning"
443   sloc->isref = 1;
444
445   // Increase the local variable stack size on this function.
446   if (IN_STACK (sloc->etype))
447     {
448       currFunc->stack += getSize (sloc->type);
449       _G.stackExtend += getSize (sloc->type);
450     }
451   else
452     {
453       // The IZT port currently doesnt support loading locals into data space.
454       wassert (0);
455     }
456
457   // And add it to the spill set.
458   addSetHead (&_G.spill.set, sloc);
459   sym->usl.spillLoc = sloc;
460   sym->stackSpil = TRUE;
461
462   // "Add it to the set of itempStack set of the spill location
463   addSetHead (&sloc->usl.itmpStack, sym);
464
465   return sym;
466 }
467
468 static void
469 _spillThis (symbol * sym)
470 {
471   // Create a spill location if it needs one and doesnt have one yet.
472   if (!(sym->remat || sym->usl.spillLoc))
473     {
474       _createStackSpill (sym);
475     }
476
477   sym->isspilt = TRUE;
478   // Add it to the spilt set.
479   _G.spill.vect = bitVectSetBit (_G.spill.vect, sym->key);
480   // and remove it from the 'has registers' set.
481   bitVectUnSetBit (_G.regAssigned, sym->key);
482
483   // Free up any registers that were assigned to this.
484   if (sym->regs[0])
485     {
486       _freeReg (sym->regs[0]);
487       sym->regs[0] = NULL;
488     }
489
490   // CHECK: If this sym now has a spill location, mark it as allocated
491   // so that the stack packing later doesnt remove it.
492   if (sym->usl.spillLoc && !sym->remat)
493     {
494       sym->usl.spillLoc->allocreq = TRUE;
495     }
496
497   return;
498 }
499
500 static bitVect *
501 _findSpillable (iCode * ic)
502 {
503   bitVect *spillable;
504
505   // First create a copy of the currently live ranges.
506   spillable = bitVectCopy (ic->rlive);
507   // Remove those which are already spilt.
508   spillable = bitVectCplAnd (spillable, _G.spill.vect);
509   // Remove those that this iCode uses.
510   spillable = bitVectCplAnd (spillable, ic->uses);
511   // Remove those that this iCode defines.
512   bitVectUnSetBit (spillable, ic->defKey);
513
514   // Only those that have registers assigned can actually be spilt :)
515   spillable = bitVectIntersect (spillable, _G.regAssigned);
516
517   return spillable;
518 }
519
520 /// Finds the least used live range
521 static symbol *
522 _leastUsedLR (set * sset)
523 {
524   // sym is the currently least used symbol.
525   symbol *sym;
526   // walk walks the list of symbols in the scan set.
527   symbol *walk;
528
529   // Use the first as the seed.
530   sym = walk = setFirstItem (sset);
531
532   while (walk)
533     {
534       // Prefer spilling the symbol with the least allocated registers.
535       // PENDING: Why?
536       if (walk->used == sym->used)
537         {
538           if (getSize (walk->type) < getSize (sym->type))
539             {
540               sym = walk;
541             }
542         }
543       else if (walk->used < sym->used)
544         {
545           // This is used less than the current best.  It looses.
546           sym = walk;
547         }
548
549       walk = setNextItem (sset);
550     }
551
552   setToNull ((void *) &sset);
553   sym->blockSpil = 0;
554
555   return sym;
556 }
557
558 /// Applies a function to a given set of live ranges.
559 static set *
560 _liveRangesWith (bitVect * lrs, int (func) (symbol *, eBBlock *, iCode *),
561                  eBBlock * ebp, iCode * ic)
562 {
563   set *rset = NULL;
564   int i;
565
566   // Dont do anything if the bitVect is empty.
567   if (!lrs || !lrs->size)
568     return NULL;
569
570   for (i = 1; i < lrs->size; i++)
571     {
572       symbol *sym;
573
574       // If this bit isnt turned on, skip.
575       if (!bitVectBitValue (lrs, i))
576         continue;
577
578       // If we don't find it in the live range hash table we are in serious trouble.
579       if (!(sym = hTabItemWithKey (liveRanges, i)))
580         {
581           werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
582                   "liveRangesWith could not find liveRange");
583           exit (1);
584         }
585
586       // If the function likes it, and it has registers assigned to
587       // it, add it to the return set.
588       if (func (sym, ebp, ic) && bitVectBitValue (_G.regAssigned, sym->key))
589         {
590           addSetHead (&rset, sym);
591         }
592     }
593
594   return rset;
595 }
596
597 /// Returns TRUE always.  Used to fetch all live ranges.
598 static int
599 _allLRs (symbol * sym, eBBlock * ebp, iCode * ic)
600 {
601   return 1;
602 }
603
604 static void
605 _serialRegAssign (eBBlock ** ebbs, int count)
606 {
607   int i;
608
609   // For each block, do...
610   for (i = 0; i < count; i++)
611     {
612       iCode *ic;
613
614       if (ebbs[i]->noPath &&
615           (ebbs[i]->entryLabel != entryLabel &&
616            ebbs[i]->entryLabel != returnLabel))
617         {
618           // PENDING:  Dont understand.
619           continue;
620         }
621
622
623       // For each iCode in this block, do...
624       for (ic = ebbs[i]->sch; ic; ic = ic->next)
625         {
626           symbol *sym;
627           bitVect *spillable;
628           int willCauseSpill;
629
630           // Dont support IPOP
631           wassert (ic->op != IPOP);
632
633           // if result is present && is a true symbol
634           if (IC_RESULT (ic) && ic->op != IFX &&
635               IS_TRUE_SYMOP (IC_RESULT (ic)))
636             OP_SYMBOL (IC_RESULT (ic))->allocreq = 1;
637
638           // Take away registers from live ranges that end at this
639           // instruction.
640           _deassignLRs (ic, ebbs[i]);
641
642           // Some instructions dont need registers.
643           if (_doesntNeedRegs (ic))
644             {
645               continue;
646             }
647
648           // If there is no result, then it doesnt need registers.
649           if (!IC_RESULT (ic))
650             {
651               continue;
652             }
653
654           sym = OP_SYMBOL (IC_RESULT (ic));
655
656           // Does it need any registers?
657           if (sym->nRegs == 0)
658             {
659               continue;
660             }
661
662           // Is it already split?
663           if (sym->isspilt)
664             {
665               continue;
666             }
667
668           // Does it already have registers assigned?
669           if (bitVectBitValue (_G.regAssigned, sym->key))
670             {
671               continue;
672             }
673
674           // Will it live past this instruction?
675           if (sym->liveTo <= ic->seq)
676             {
677               continue;
678             }
679
680           // MLH Doesnt understand this.
681           /* "Iif some liverange has been spilt at the block level
682              and this one live beyond this block then spil this
683              to be safe" */
684           if (_G.blockSpill && sym->liveTo > ebbs[i]->lSeq)
685             {
686               _spillThis (sym);
687               continue;
688             }
689
690           // Seems that this symbol needs registers.  See if 
691           // allocating will cause a spill.
692           willCauseSpill = _willCauseSpill (sym->nRegs);
693           spillable = _findSpillable (ic);
694
695           // If this is remat., then dont waste any regsiters on it.
696           if (sym->remat)
697             {
698               _spillThis (sym);
699               continue;
700             }
701
702           // If trying to allocate will cause a spill, and nothing
703           // else is spillable then this sym looses.
704           if (willCauseSpill && bitVectIsZero (spillable))
705             {
706               _spillThis (sym);
707               continue;
708             }
709
710           // If this will cause a spill, and it already has a spill
711           // location then spill this if it is the least used.
712           if (willCauseSpill && sym->usl.spillLoc)
713             {
714               symbol *leastUsed = _leastUsedLR (_liveRangesWith (spillable, _allLRs, ebbs[i], ic));
715               if (leastUsed && leastUsed->used > sym->used)
716                 {
717                   _spillThis (sym);
718                   continue;
719                 }
720             }
721
722           // Hmm.  Here we could have no registers available but
723           // we'll still try to allocate.  MLH wonders how this will
724           // work.
725
726           // Mark this iCode as having registers assigned to it.
727           _G.regAssigned = bitVectSetBit (_G.regAssigned, sym->key);
728
729           // And do it.
730           sym->regs[0] = _allocateReg (sym->nRegs);
731         }
732     }
733 }
734
735 static
736 DEFSETFUNC (_deallocStackSpil)
737 {
738   symbol *sym = item;
739
740   deallocLocal (sym);
741   return 0;
742 }
743
744 /// Compute the register mask for an operand.
745 bitVect *
746 _rUmaskForOp (operand * op)
747 {
748   bitVect *rumask;
749   symbol *sym;
750
751   // "Only temporaries are assigned registers"
752   if (!IS_ITEMP (op))
753     return NULL;
754
755   sym = OP_SYMBOL (op);
756
757   // If its spilt or no registers are needed, then no regs are assigned.
758   if (sym->isspilt || !sym->nRegs)
759     return NULL;
760
761   rumask = newBitVect (REG_ID_MAX);
762
763   if (sym->regs[0])
764     {
765       rumask = _markRegBits (rumask, sym->regs[0]);
766     }
767
768   return rumask;
769 }
770
771 /// Returns bit vector of registers used in iCode.
772 bitVect *
773 _regsUsedIniCode (iCode * ic)
774 {
775   bitVect *rmask = newBitVect (REG_ID_MAX);
776
777   do
778     {
779       // Special cases first.
780       if (ic->op == IFX)
781         {
782           rmask = bitVectUnion (rmask, _rUmaskForOp (IC_COND (ic)));
783           break;
784         }
785
786       if (ic->op == JUMPTABLE)
787         {
788           rmask = bitVectUnion (rmask, _rUmaskForOp (IC_JTCOND (ic)));
789           break;
790         }
791
792       // Now the good old left, right, and result.
793       if (IC_LEFT (ic))
794         {
795           rmask = bitVectUnion (rmask, _rUmaskForOp (IC_LEFT (ic)));
796         }
797
798       if (IC_RIGHT (ic))
799         {
800           rmask = bitVectUnion (rmask, _rUmaskForOp (IC_RIGHT (ic)));
801         }
802
803       if (IC_RESULT (ic))
804         {
805           rmask = bitVectUnion (rmask, _rUmaskForOp (IC_RESULT (ic)));
806         }
807     }
808   while (0);
809
810   return rmask;
811 }
812
813 /// Compute the helper bitVect that contains the register used mask.
814 static void
815 _createRegMask (eBBlock ** ebbs, int count)
816 {
817   int i;
818
819   /* for all blocks */
820   for (i = 0; i < count; i++)
821     {
822       iCode *ic;
823
824       // If this code is unused, skip it.
825       if (ebbs[i]->noPath &&
826           (ebbs[i]->entryLabel != entryLabel &&
827            ebbs[i]->entryLabel != returnLabel))
828         {
829           continue;
830         }
831
832       /* for all instructions */
833       for (ic = ebbs[i]->sch; ic; ic = ic->next)
834         {
835           int j;
836
837           if (SKIP_IC2 (ic) || !ic->rlive)
838             continue;
839
840           // Mark the registers used in this instruction.
841           ic->rUsed = _regsUsedIniCode (ic);
842           // Mark them as used at least once in the function.
843           _G.funcUsedRegs = bitVectUnion (_G.funcUsedRegs, ic->rUsed);
844
845           /* now create the register mask for those 
846              registers that are in use : this is a
847              super set of ic->rUsed */
848           ic->rMask = newBitVect (REG_ID_MAX + 1);
849
850           // "For all live Ranges alive at this point"
851           for (j = 1; j < ic->rlive->size; j++)
852             {
853               symbol *sym;
854
855               // "If if not alive then continue"
856               if (!bitVectBitValue (ic->rlive, j))
857                 {
858                   continue;
859                 }
860
861               // "Find the live range we are interested in"
862               if (!(sym = hTabItemWithKey (liveRanges, j)))
863                 {
864                   werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
865                           "createRegMask cannot find live range");
866                   exit (0);
867                 }
868
869               // "If no register assigned to it"
870               if (!sym->nRegs || sym->isspilt)
871                 {
872                   continue;
873                 }
874
875               // If this has any registers allocated, mark them as such.
876               if (sym->regs[0])
877                 {
878                   ic->rMask = _markRegBits (ic->rMask, sym->regs[0]);
879                 }
880             }
881         }
882     }
883 }
884
885 void
886 izt_assignRegisters (eBBlock ** ebbs, int count)
887 {
888   // Contains a flat version of ebbs used in code generation.
889   iCode *chain;
890
891   // Clear the bit vector of registers used in this function.
892   // Assumes that assignRegisters is called once per function.
893   setToNull ((void *) &_G.funcUsedRegs);
894
895   // First scan each live range, and figure out what registers
896   // are required.
897   _computeRequiredRegs ();
898
899   // Now allocate the registers.
900   _serialRegAssign (ebbs, count);
901
902   // And create the helper register used mask.
903   _createRegMask (ebbs, count);
904
905   // Turn the bblock array into an optimised list of iCode entries.
906   chain = iCodeLabelOptimize (iCodeFromeBBlock (ebbs, count));
907
908   // Redo the stack offsets.  This will remove any redundent stack
909   // locations ie iTemps that exist only in registers.
910   redoStackOffsets ();
911
912   izt_gen (chain);
913
914   // Deallocate any stack spill locations.
915   applyToSet (_G.spill.set, _deallocStackSpil);
916
917   _G.spill.loc = 0;
918   setToNull ((void *) &_G.spill.set);
919   setToNull ((void *) &_G.spill.vect);
920
921   // And free all registers.
922   _freeAllRegs ();
923 }
924
925 void
926 warningStopper (void)
927 {
928   // For now references all unused functions.
929   _dumpRegs ();
930   _packRegisters (NULL);
931   _getSubReg (NULL, 0, 0);
932 }