xref: /openbsd/gnu/usr.bin/gcc/gcc/ra-debug.c (revision c87b03e5)
1*c87b03e5Sespie /* Graph coloring register allocator
2*c87b03e5Sespie    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3*c87b03e5Sespie    Contributed by Michael Matz <matz@suse.de>
4*c87b03e5Sespie    and Daniel Berlin <dan@cgsoftware.com>.
5*c87b03e5Sespie 
6*c87b03e5Sespie    This file is part of GCC.
7*c87b03e5Sespie 
8*c87b03e5Sespie    GCC is free software; you can redistribute it and/or modify it under the
9*c87b03e5Sespie    terms of the GNU General Public License as published by the Free Software
10*c87b03e5Sespie    Foundation; either version 2, or (at your option) any later version.
11*c87b03e5Sespie 
12*c87b03e5Sespie    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13*c87b03e5Sespie    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14*c87b03e5Sespie    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15*c87b03e5Sespie    details.
16*c87b03e5Sespie 
17*c87b03e5Sespie    You should have received a copy of the GNU General Public License along
18*c87b03e5Sespie    with GCC; see the file COPYING.  If not, write to the Free Software
19*c87b03e5Sespie    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20*c87b03e5Sespie 
21*c87b03e5Sespie #include "config.h"
22*c87b03e5Sespie #include "system.h"
23*c87b03e5Sespie #include "rtl.h"
24*c87b03e5Sespie #include "insn-config.h"
25*c87b03e5Sespie #include "recog.h"
26*c87b03e5Sespie #include "function.h"
27*c87b03e5Sespie #include "hard-reg-set.h"
28*c87b03e5Sespie #include "basic-block.h"
29*c87b03e5Sespie #include "df.h"
30*c87b03e5Sespie #include "output.h"
31*c87b03e5Sespie #include "ra.h"
32*c87b03e5Sespie #include "tm_p.h"
33*c87b03e5Sespie 
34*c87b03e5Sespie /* This file contains various dumping and debug functions for
35*c87b03e5Sespie    the graph coloring register allocator.  */
36*c87b03e5Sespie 
37*c87b03e5Sespie static void ra_print_rtx_1op PARAMS ((FILE *, rtx));
38*c87b03e5Sespie static void ra_print_rtx_2op PARAMS ((FILE *, rtx));
39*c87b03e5Sespie static void ra_print_rtx_3op PARAMS ((FILE *, rtx));
40*c87b03e5Sespie static void ra_print_rtx_object PARAMS ((FILE *, rtx));
41*c87b03e5Sespie 
42*c87b03e5Sespie /* The hardregs as names, for debugging.  */
43*c87b03e5Sespie static const char *const reg_class_names[] = REG_CLASS_NAMES;
44*c87b03e5Sespie 
45*c87b03e5Sespie /* Print a message to the dump file, if debug_new_regalloc and LEVEL
46*c87b03e5Sespie    have any bits in common.  */
47*c87b03e5Sespie 
48*c87b03e5Sespie void
ra_debug_msg(unsigned int level,const char * format,...)49*c87b03e5Sespie ra_debug_msg VPARAMS ((unsigned int level, const char *format, ...))
50*c87b03e5Sespie {
51*c87b03e5Sespie   VA_OPEN (ap, format);
52*c87b03e5Sespie   VA_FIXEDARG (ap, unsigned int, level);
53*c87b03e5Sespie   VA_FIXEDARG (ap, const char *, format);
54*c87b03e5Sespie   if ((debug_new_regalloc & level) != 0 && rtl_dump_file != NULL)
55*c87b03e5Sespie     vfprintf (rtl_dump_file, format, ap);
56*c87b03e5Sespie   VA_CLOSE (ap);
57*c87b03e5Sespie }
58*c87b03e5Sespie 
59*c87b03e5Sespie 
60*c87b03e5Sespie /* The following ra_print_xxx() functions print RTL expressions
61*c87b03e5Sespie    in concise infix form.  If the mode can be seen from context it's
62*c87b03e5Sespie    left out.  Most operators are represented by their graphical
63*c87b03e5Sespie    characters, e.g. LE as "<=".  Unknown constructs are currently
64*c87b03e5Sespie    printed with print_inline_rtx(), which disrupts the nice layout.
65*c87b03e5Sespie    Currently only the inline asm things are written this way.  */
66*c87b03e5Sespie 
67*c87b03e5Sespie /* Print rtx X, which is a one operand rtx (op:mode (Y)), as
68*c87b03e5Sespie    "op(Y)" to FILE.  */
69*c87b03e5Sespie 
70*c87b03e5Sespie static void
ra_print_rtx_1op(file,x)71*c87b03e5Sespie ra_print_rtx_1op (file, x)
72*c87b03e5Sespie      FILE *file;
73*c87b03e5Sespie      rtx x;
74*c87b03e5Sespie {
75*c87b03e5Sespie   enum rtx_code code = GET_CODE (x);
76*c87b03e5Sespie   rtx op0 = XEXP (x, 0);
77*c87b03e5Sespie   switch (code)
78*c87b03e5Sespie     {
79*c87b03e5Sespie       case NEG:
80*c87b03e5Sespie       case NOT:
81*c87b03e5Sespie 	  fputs ((code == NEG) ? "-(" : "~(", file);
82*c87b03e5Sespie 	  ra_print_rtx (file, op0, 0);
83*c87b03e5Sespie 	  fputs (")", file);
84*c87b03e5Sespie 	  break;
85*c87b03e5Sespie       case HIGH:
86*c87b03e5Sespie 	  fputs ("hi(", file);
87*c87b03e5Sespie 	  ra_print_rtx (file, op0, 0);
88*c87b03e5Sespie 	  fputs (")", file);
89*c87b03e5Sespie 	  break;
90*c87b03e5Sespie       default:
91*c87b03e5Sespie 	  fprintf (file, "%s", GET_RTX_NAME (code));
92*c87b03e5Sespie 	  if (GET_MODE (x) != VOIDmode)
93*c87b03e5Sespie 	    fprintf (file, ":%s(", GET_MODE_NAME (GET_MODE (x)));
94*c87b03e5Sespie 	  else
95*c87b03e5Sespie 	    fputs ("(", file);
96*c87b03e5Sespie 	  ra_print_rtx (file, op0, 0);
97*c87b03e5Sespie 	  fputs (")", file);
98*c87b03e5Sespie 	  break;
99*c87b03e5Sespie     }
100*c87b03e5Sespie }
101*c87b03e5Sespie 
102*c87b03e5Sespie /* Print rtx X, which is a two operand rtx (op:mode (Y) (Z))
103*c87b03e5Sespie    as "(Y op Z)", if the operand is know, or as "op(Y, Z)", if not,
104*c87b03e5Sespie    to FILE.  */
105*c87b03e5Sespie 
106*c87b03e5Sespie static void
ra_print_rtx_2op(file,x)107*c87b03e5Sespie ra_print_rtx_2op (file, x)
108*c87b03e5Sespie      FILE *file;
109*c87b03e5Sespie      rtx x;
110*c87b03e5Sespie {
111*c87b03e5Sespie   int infix = 1;
112*c87b03e5Sespie   const char *opname = "shitop";
113*c87b03e5Sespie   enum rtx_code code = GET_CODE (x);
114*c87b03e5Sespie   rtx op0 = XEXP (x, 0);
115*c87b03e5Sespie   rtx op1 = XEXP (x, 1);
116*c87b03e5Sespie   switch (code)
117*c87b03e5Sespie     {
118*c87b03e5Sespie       /* class '2' */
119*c87b03e5Sespie       case COMPARE: opname = "?"; break;
120*c87b03e5Sespie       case MINUS: opname = "-"; break;
121*c87b03e5Sespie       case DIV: opname = "/"; break;
122*c87b03e5Sespie       case UDIV: opname = "u/"; break;
123*c87b03e5Sespie       case MOD: opname = "%"; break;
124*c87b03e5Sespie       case UMOD: opname = "u%"; break;
125*c87b03e5Sespie       case ASHIFT: opname = "<<"; break;
126*c87b03e5Sespie       case ASHIFTRT: opname = "a>>"; break;
127*c87b03e5Sespie       case LSHIFTRT: opname = "l>>"; break;
128*c87b03e5Sespie       /* class 'c' */
129*c87b03e5Sespie       case PLUS: opname = "+"; break;
130*c87b03e5Sespie       case MULT: opname = "*"; break;
131*c87b03e5Sespie       case AND: opname = "&"; break;
132*c87b03e5Sespie       case IOR: opname = "|"; break;
133*c87b03e5Sespie       case XOR: opname = "^"; break;
134*c87b03e5Sespie       /* class '<' */
135*c87b03e5Sespie       case NE: opname = "!="; break;
136*c87b03e5Sespie       case EQ: opname = "=="; break;
137*c87b03e5Sespie       case GE: opname = "s>="; break;
138*c87b03e5Sespie       case GT: opname = "s>"; break;
139*c87b03e5Sespie       case LE: opname = "s<="; break;
140*c87b03e5Sespie       case LT: opname = "s<"; break;
141*c87b03e5Sespie       case GEU: opname = "u>="; break;
142*c87b03e5Sespie       case GTU: opname = "u>"; break;
143*c87b03e5Sespie       case LEU: opname = "u<="; break;
144*c87b03e5Sespie       case LTU: opname = "u<"; break;
145*c87b03e5Sespie       default:
146*c87b03e5Sespie 		infix = 0;
147*c87b03e5Sespie 		opname = GET_RTX_NAME (code);
148*c87b03e5Sespie 		break;
149*c87b03e5Sespie     }
150*c87b03e5Sespie   if (infix)
151*c87b03e5Sespie     {
152*c87b03e5Sespie       fputs ("(", file);
153*c87b03e5Sespie       ra_print_rtx (file, op0, 0);
154*c87b03e5Sespie       fprintf (file, " %s ", opname);
155*c87b03e5Sespie       ra_print_rtx (file, op1, 0);
156*c87b03e5Sespie       fputs (")", file);
157*c87b03e5Sespie     }
158*c87b03e5Sespie   else
159*c87b03e5Sespie     {
160*c87b03e5Sespie       fprintf (file, "%s(", opname);
161*c87b03e5Sespie       ra_print_rtx (file, op0, 0);
162*c87b03e5Sespie       fputs (", ", file);
163*c87b03e5Sespie       ra_print_rtx (file, op1, 0);
164*c87b03e5Sespie       fputs (")", file);
165*c87b03e5Sespie     }
166*c87b03e5Sespie }
167*c87b03e5Sespie 
168*c87b03e5Sespie /* Print rtx X, which a three operand rtx to FILE.
169*c87b03e5Sespie    I.e. X is either an IF_THEN_ELSE, or a bitmap operation.  */
170*c87b03e5Sespie 
171*c87b03e5Sespie static void
ra_print_rtx_3op(file,x)172*c87b03e5Sespie ra_print_rtx_3op (file, x)
173*c87b03e5Sespie      FILE *file;
174*c87b03e5Sespie      rtx x;
175*c87b03e5Sespie {
176*c87b03e5Sespie   enum rtx_code code = GET_CODE (x);
177*c87b03e5Sespie   rtx op0 = XEXP (x, 0);
178*c87b03e5Sespie   rtx op1 = XEXP (x, 1);
179*c87b03e5Sespie   rtx op2 = XEXP (x, 2);
180*c87b03e5Sespie   if (code == IF_THEN_ELSE)
181*c87b03e5Sespie     {
182*c87b03e5Sespie       ra_print_rtx (file, op0, 0);
183*c87b03e5Sespie       fputs (" ? ", file);
184*c87b03e5Sespie       ra_print_rtx (file, op1, 0);
185*c87b03e5Sespie       fputs (" : ", file);
186*c87b03e5Sespie       ra_print_rtx (file, op2, 0);
187*c87b03e5Sespie     }
188*c87b03e5Sespie   else
189*c87b03e5Sespie     {
190*c87b03e5Sespie       /* Bitmap-operation */
191*c87b03e5Sespie       fprintf (file, "%s:%s(", GET_RTX_NAME (code),
192*c87b03e5Sespie 	       GET_MODE_NAME (GET_MODE (x)));
193*c87b03e5Sespie       ra_print_rtx (file, op0, 0);
194*c87b03e5Sespie       fputs (", ", file);
195*c87b03e5Sespie       ra_print_rtx (file, op1, 0);
196*c87b03e5Sespie       fputs (", ", file);
197*c87b03e5Sespie       ra_print_rtx (file, op2, 0);
198*c87b03e5Sespie       fputs (")", file);
199*c87b03e5Sespie     }
200*c87b03e5Sespie }
201*c87b03e5Sespie 
202*c87b03e5Sespie /* Print rtx X, which represents an object (class 'o' or some constructs
203*c87b03e5Sespie    of class 'x' (e.g. subreg)), to FILE.
204*c87b03e5Sespie    (reg XX) rtl is represented as "pXX", of XX was a pseudo,
205*c87b03e5Sespie    as "name" it name is the nonnull hardreg name, or as "hXX", if XX
206*c87b03e5Sespie    is a hardreg, whose name is NULL, or empty.  */
207*c87b03e5Sespie 
208*c87b03e5Sespie static void
ra_print_rtx_object(file,x)209*c87b03e5Sespie ra_print_rtx_object (file, x)
210*c87b03e5Sespie      FILE *file;
211*c87b03e5Sespie      rtx x;
212*c87b03e5Sespie {
213*c87b03e5Sespie   enum rtx_code code = GET_CODE (x);
214*c87b03e5Sespie   enum machine_mode mode = GET_MODE (x);
215*c87b03e5Sespie   switch (code)
216*c87b03e5Sespie     {
217*c87b03e5Sespie       case CONST_INT:
218*c87b03e5Sespie 	  fprintf (file, HOST_WIDE_INT_PRINT_DEC, XWINT (x, 0));
219*c87b03e5Sespie 	  break;
220*c87b03e5Sespie       case CONST_DOUBLE:
221*c87b03e5Sespie 	    {
222*c87b03e5Sespie 	      int i, num = 0;
223*c87b03e5Sespie 	      const char *fmt = GET_RTX_FORMAT (code);
224*c87b03e5Sespie 	      fputs ("dbl(", file);
225*c87b03e5Sespie 	      for (i = 0; i < GET_RTX_LENGTH (code); i++)
226*c87b03e5Sespie 		{
227*c87b03e5Sespie 		  if (num)
228*c87b03e5Sespie 		    fputs (", ", file);
229*c87b03e5Sespie 		  if (fmt[i] == 'e' && XEXP (x, i))
230*c87b03e5Sespie 		    /* The MEM or other stuff */
231*c87b03e5Sespie 		    {
232*c87b03e5Sespie 		      ra_print_rtx (file, XEXP (x, i), 0);
233*c87b03e5Sespie 		      num++;
234*c87b03e5Sespie 		    }
235*c87b03e5Sespie 		  else if (fmt[i] == 'w')
236*c87b03e5Sespie 		    {
237*c87b03e5Sespie 		      fprintf (file, HOST_WIDE_INT_PRINT_HEX, XWINT (x, i));
238*c87b03e5Sespie 		      num++;
239*c87b03e5Sespie 		    }
240*c87b03e5Sespie 		}
241*c87b03e5Sespie 	      break;
242*c87b03e5Sespie 	    }
243*c87b03e5Sespie       case CONST_STRING: fprintf (file, "\"%s\"", XSTR (x, 0)); break;
244*c87b03e5Sespie       case CONST: fputs ("const(", file);
245*c87b03e5Sespie 		  ra_print_rtx (file, XEXP (x, 0), 0);
246*c87b03e5Sespie 		  fputs (")", file);
247*c87b03e5Sespie 		  break;
248*c87b03e5Sespie       case PC: fputs ("pc", file); break;
249*c87b03e5Sespie       case REG:
250*c87b03e5Sespie 	       {
251*c87b03e5Sespie 		 int regno = REGNO (x);
252*c87b03e5Sespie 		 if (regno < FIRST_PSEUDO_REGISTER)
253*c87b03e5Sespie 		   {
254*c87b03e5Sespie 		     int i, nregs = HARD_REGNO_NREGS (regno, mode);
255*c87b03e5Sespie 		     if (nregs > 1)
256*c87b03e5Sespie 		       fputs ("[", file);
257*c87b03e5Sespie 		     for (i = 0; i < nregs; i++)
258*c87b03e5Sespie 		       {
259*c87b03e5Sespie 			 if (i)
260*c87b03e5Sespie 			   fputs (", ", file);
261*c87b03e5Sespie 			 if (reg_names[regno+i] && *reg_names[regno + i])
262*c87b03e5Sespie 			   fprintf (file, "%s", reg_names[regno + i]);
263*c87b03e5Sespie 			 else
264*c87b03e5Sespie 			   fprintf (file, "h%d", regno + i);
265*c87b03e5Sespie 		       }
266*c87b03e5Sespie 		     if (nregs > 1)
267*c87b03e5Sespie 		       fputs ("]", file);
268*c87b03e5Sespie 		   }
269*c87b03e5Sespie 		 else
270*c87b03e5Sespie 		   fprintf (file, "p%d", regno);
271*c87b03e5Sespie 		 break;
272*c87b03e5Sespie 	       }
273*c87b03e5Sespie       case SUBREG:
274*c87b03e5Sespie 	       {
275*c87b03e5Sespie 		 rtx sub = SUBREG_REG (x);
276*c87b03e5Sespie 		 int ofs = SUBREG_BYTE (x);
277*c87b03e5Sespie 		 if (GET_CODE (sub) == REG
278*c87b03e5Sespie 		     && REGNO (sub) < FIRST_PSEUDO_REGISTER)
279*c87b03e5Sespie 		   {
280*c87b03e5Sespie 		     int regno = REGNO (sub);
281*c87b03e5Sespie 		     int i, nregs = HARD_REGNO_NREGS (regno, mode);
282*c87b03e5Sespie 		     regno += subreg_regno_offset (regno, GET_MODE (sub),
283*c87b03e5Sespie 						   ofs, mode);
284*c87b03e5Sespie 		     if (nregs > 1)
285*c87b03e5Sespie 		       fputs ("[", file);
286*c87b03e5Sespie 		     for (i = 0; i < nregs; i++)
287*c87b03e5Sespie 		       {
288*c87b03e5Sespie 			 if (i)
289*c87b03e5Sespie 			   fputs (", ", file);
290*c87b03e5Sespie 			 if (reg_names[regno+i])
291*c87b03e5Sespie 			   fprintf (file, "%s", reg_names[regno + i]);
292*c87b03e5Sespie 			 else
293*c87b03e5Sespie 			   fprintf (file, "h%d", regno + i);
294*c87b03e5Sespie 		       }
295*c87b03e5Sespie 		     if (nregs > 1)
296*c87b03e5Sespie 		       fputs ("]", file);
297*c87b03e5Sespie 		   }
298*c87b03e5Sespie 		 else
299*c87b03e5Sespie 		   {
300*c87b03e5Sespie 		     ra_print_rtx (file, sub, 0);
301*c87b03e5Sespie 		     fprintf (file, ":[%s+%d]", GET_MODE_NAME (mode), ofs);
302*c87b03e5Sespie 		   }
303*c87b03e5Sespie 		 break;
304*c87b03e5Sespie 	       }
305*c87b03e5Sespie       case SCRATCH: fputs ("scratch", file); break;
306*c87b03e5Sespie       case CONCAT: ra_print_rtx_2op (file, x); break;
307*c87b03e5Sespie       case HIGH: ra_print_rtx_1op (file, x); break;
308*c87b03e5Sespie       case LO_SUM:
309*c87b03e5Sespie 		 fputs ("(", file);
310*c87b03e5Sespie 		 ra_print_rtx (file, XEXP (x, 0), 0);
311*c87b03e5Sespie 		 fputs (" + lo(", file);
312*c87b03e5Sespie 		 ra_print_rtx (file, XEXP (x, 1), 0);
313*c87b03e5Sespie 		 fputs ("))", file);
314*c87b03e5Sespie 		 break;
315*c87b03e5Sespie       case MEM: fputs ("[", file);
316*c87b03e5Sespie 		ra_print_rtx (file, XEXP (x, 0), 0);
317*c87b03e5Sespie 		fprintf (file, "]:%s", GET_MODE_NAME (GET_MODE (x)));
318*c87b03e5Sespie 		/* XXX print alias set too ?? */
319*c87b03e5Sespie 		break;
320*c87b03e5Sespie       case LABEL_REF:
321*c87b03e5Sespie 		  {
322*c87b03e5Sespie 		    rtx sub = XEXP (x, 0);
323*c87b03e5Sespie 		    if (GET_CODE (sub) == NOTE
324*c87b03e5Sespie 			&& NOTE_LINE_NUMBER (sub) == NOTE_INSN_DELETED_LABEL)
325*c87b03e5Sespie 		      fprintf (file, "(deleted uid=%d)", INSN_UID (sub));
326*c87b03e5Sespie 		    else if (GET_CODE (sub) == CODE_LABEL)
327*c87b03e5Sespie 		      fprintf (file, "L%d", CODE_LABEL_NUMBER (sub));
328*c87b03e5Sespie 		    else
329*c87b03e5Sespie 		      fprintf (file, "(nonlabel uid=%d)", INSN_UID (sub));
330*c87b03e5Sespie 		  }
331*c87b03e5Sespie 		break;
332*c87b03e5Sespie       case SYMBOL_REF:
333*c87b03e5Sespie 		fprintf (file, "sym(\"%s\")", XSTR (x, 0)); break;
334*c87b03e5Sespie       case CC0: fputs ("cc0", file); break;
335*c87b03e5Sespie       default: print_inline_rtx (file, x, 0); break;
336*c87b03e5Sespie     }
337*c87b03e5Sespie }
338*c87b03e5Sespie 
339*c87b03e5Sespie /* Print a general rtx X to FILE in nice infix form.
340*c87b03e5Sespie    If WITH_PN is set, and X is one of the toplevel constructs
341*c87b03e5Sespie    (insns, notes, labels or barriers), then print also the UIDs of
342*c87b03e5Sespie    the preceding and following insn.  */
343*c87b03e5Sespie 
344*c87b03e5Sespie void
ra_print_rtx(file,x,with_pn)345*c87b03e5Sespie ra_print_rtx (file, x, with_pn)
346*c87b03e5Sespie      FILE *file;
347*c87b03e5Sespie      rtx x;
348*c87b03e5Sespie      int with_pn;
349*c87b03e5Sespie {
350*c87b03e5Sespie   enum rtx_code code;
351*c87b03e5Sespie   char class;
352*c87b03e5Sespie   int unhandled = 0;
353*c87b03e5Sespie   if (!x)
354*c87b03e5Sespie     return;
355*c87b03e5Sespie   code = GET_CODE (x);
356*c87b03e5Sespie   class = GET_RTX_CLASS (code);
357*c87b03e5Sespie 
358*c87b03e5Sespie   /* First handle the insn like constructs.  */
359*c87b03e5Sespie   if (INSN_P (x) || code == NOTE || code == CODE_LABEL || code == BARRIER)
360*c87b03e5Sespie     {
361*c87b03e5Sespie       if (INSN_P (x))
362*c87b03e5Sespie 	fputs ("  ", file);
363*c87b03e5Sespie       /* Non-insns are prefixed by a ';'.  */
364*c87b03e5Sespie       if (code == BARRIER)
365*c87b03e5Sespie 	fputs ("; ", file);
366*c87b03e5Sespie       else if (code == NOTE)
367*c87b03e5Sespie 	/* But notes are indented very far right.  */
368*c87b03e5Sespie 	fprintf (file, "\t\t\t\t\t; ");
369*c87b03e5Sespie       else if (code == CODE_LABEL)
370*c87b03e5Sespie 	/* And labels have their Lxx name first, before the actual UID.  */
371*c87b03e5Sespie 	{
372*c87b03e5Sespie 	  fprintf (file, "L%d:\t; ", CODE_LABEL_NUMBER (x));
373*c87b03e5Sespie 	  if (LABEL_NAME (x))
374*c87b03e5Sespie 	    fprintf (file, "(%s) ", LABEL_NAME (x));
375*c87b03e5Sespie 	  switch (LABEL_KIND (x))
376*c87b03e5Sespie 	    {
377*c87b03e5Sespie 	    case LABEL_NORMAL: break;
378*c87b03e5Sespie 	    case LABEL_STATIC_ENTRY: fputs (" (entry)", file); break;
379*c87b03e5Sespie 	    case LABEL_GLOBAL_ENTRY: fputs (" (global entry)", file); break;
380*c87b03e5Sespie 	    case LABEL_WEAK_ENTRY: fputs (" (weak entry)", file); break;
381*c87b03e5Sespie 	    default: abort();
382*c87b03e5Sespie 	    }
383*c87b03e5Sespie 	  fprintf (file, " [%d uses] uid=(", LABEL_NUSES (x));
384*c87b03e5Sespie 	}
385*c87b03e5Sespie       fprintf (file, "%d", INSN_UID (x));
386*c87b03e5Sespie       if (with_pn)
387*c87b03e5Sespie 	fprintf (file, " %d %d", PREV_INSN (x) ? INSN_UID (PREV_INSN (x)) : 0,
388*c87b03e5Sespie 		 NEXT_INSN (x) ? INSN_UID (NEXT_INSN (x)) : 0);
389*c87b03e5Sespie       if (code == BARRIER)
390*c87b03e5Sespie 	fputs (" -------- barrier ---------", file);
391*c87b03e5Sespie       else if (code == CODE_LABEL)
392*c87b03e5Sespie 	fputs (")", file);
393*c87b03e5Sespie       else if (code == NOTE)
394*c87b03e5Sespie 	{
395*c87b03e5Sespie 	  int ln = NOTE_LINE_NUMBER (x);
396*c87b03e5Sespie 	  if (ln >= (int) NOTE_INSN_BIAS && ln < (int) NOTE_INSN_MAX)
397*c87b03e5Sespie 	    fprintf (file, " %s", GET_NOTE_INSN_NAME (ln));
398*c87b03e5Sespie 	  else
399*c87b03e5Sespie 	    {
400*c87b03e5Sespie 	      fprintf (file, " line %d", ln);
401*c87b03e5Sespie 	      if (NOTE_SOURCE_FILE (x))
402*c87b03e5Sespie 		fprintf (file, ":%s", NOTE_SOURCE_FILE (x));
403*c87b03e5Sespie 	    }
404*c87b03e5Sespie 	}
405*c87b03e5Sespie       else
406*c87b03e5Sespie 	{
407*c87b03e5Sespie 	  fprintf (file, "\t");
408*c87b03e5Sespie 	  ra_print_rtx (file, PATTERN (x), 0);
409*c87b03e5Sespie 	}
410*c87b03e5Sespie       return;
411*c87b03e5Sespie     }
412*c87b03e5Sespie   switch (code)
413*c87b03e5Sespie     {
414*c87b03e5Sespie       /* Top-level stuff.  */
415*c87b03e5Sespie       case PARALLEL:
416*c87b03e5Sespie 	    {
417*c87b03e5Sespie 	      int j;
418*c87b03e5Sespie 	      for (j = 0; j < XVECLEN (x, 0); j++)
419*c87b03e5Sespie 		{
420*c87b03e5Sespie 		  if (j)
421*c87b03e5Sespie 		    fputs ("\t;; ", file);
422*c87b03e5Sespie 		  ra_print_rtx (file, XVECEXP (x, 0, j), 0);
423*c87b03e5Sespie 		}
424*c87b03e5Sespie 	      break;
425*c87b03e5Sespie 	    }
426*c87b03e5Sespie       case UNSPEC: case UNSPEC_VOLATILE:
427*c87b03e5Sespie 	    {
428*c87b03e5Sespie 	      int j;
429*c87b03e5Sespie 	      fprintf (file, "unspec%s(%d",
430*c87b03e5Sespie 		       (code == UNSPEC) ? "" : "_vol", XINT (x, 1));
431*c87b03e5Sespie 	      for (j = 0; j < XVECLEN (x, 0); j++)
432*c87b03e5Sespie 		{
433*c87b03e5Sespie 		  fputs (", ", file);
434*c87b03e5Sespie 		  ra_print_rtx (file, XVECEXP (x, 0, j), 0);
435*c87b03e5Sespie 		}
436*c87b03e5Sespie 	      fputs (")", file);
437*c87b03e5Sespie 	      break;
438*c87b03e5Sespie 	    }
439*c87b03e5Sespie       case SET:
440*c87b03e5Sespie 	  if (GET_CODE (SET_DEST (x)) == PC)
441*c87b03e5Sespie 	    {
442*c87b03e5Sespie 	      if (GET_CODE (SET_SRC (x)) == IF_THEN_ELSE
443*c87b03e5Sespie 		  && GET_CODE (XEXP (SET_SRC(x), 2)) == PC)
444*c87b03e5Sespie 		{
445*c87b03e5Sespie 		  fputs ("if ", file);
446*c87b03e5Sespie 		  ra_print_rtx (file, XEXP (SET_SRC (x), 0), 0);
447*c87b03e5Sespie 		  fputs (" jump ", file);
448*c87b03e5Sespie 		  ra_print_rtx (file, XEXP (SET_SRC (x), 1), 0);
449*c87b03e5Sespie 		}
450*c87b03e5Sespie 	      else
451*c87b03e5Sespie 		{
452*c87b03e5Sespie 		  fputs ("jump ", file);
453*c87b03e5Sespie 		  ra_print_rtx (file, SET_SRC (x), 0);
454*c87b03e5Sespie 		}
455*c87b03e5Sespie 	    }
456*c87b03e5Sespie 	  else
457*c87b03e5Sespie 	    {
458*c87b03e5Sespie 	      ra_print_rtx (file, SET_DEST (x), 0);
459*c87b03e5Sespie 	      fputs (" <= ", file);
460*c87b03e5Sespie 	      ra_print_rtx (file, SET_SRC (x), 0);
461*c87b03e5Sespie 	    }
462*c87b03e5Sespie 	  break;
463*c87b03e5Sespie       case USE:
464*c87b03e5Sespie 	      fputs ("use <= ", file);
465*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 0), 0);
466*c87b03e5Sespie 	      break;
467*c87b03e5Sespie       case CLOBBER:
468*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 0), 0);
469*c87b03e5Sespie 	      fputs (" <= clobber", file);
470*c87b03e5Sespie 	      break;
471*c87b03e5Sespie       case CALL:
472*c87b03e5Sespie 	      fputs ("call ", file);
473*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 0), 0); /* Address */
474*c87b03e5Sespie 	      fputs (" numargs=", file);
475*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 1), 0); /* Num arguments */
476*c87b03e5Sespie 	      break;
477*c87b03e5Sespie       case RETURN:
478*c87b03e5Sespie 	      fputs ("return", file);
479*c87b03e5Sespie 	      break;
480*c87b03e5Sespie       case TRAP_IF:
481*c87b03e5Sespie 	      fputs ("if (", file);
482*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 0), 0);
483*c87b03e5Sespie 	      fputs (") trap ", file);
484*c87b03e5Sespie 	      ra_print_rtx (file, XEXP (x, 1), 0);
485*c87b03e5Sespie 	      break;
486*c87b03e5Sespie       case RESX:
487*c87b03e5Sespie 	      fprintf (file, "resx from region %d", XINT (x, 0));
488*c87b03e5Sespie 	      break;
489*c87b03e5Sespie 
490*c87b03e5Sespie       /* Different things of class 'x' */
491*c87b03e5Sespie       case SUBREG: ra_print_rtx_object (file, x); break;
492*c87b03e5Sespie       case STRICT_LOW_PART:
493*c87b03e5Sespie 		   fputs ("low(", file);
494*c87b03e5Sespie 		   ra_print_rtx (file, XEXP (x, 0), 0);
495*c87b03e5Sespie 		   fputs (")", file);
496*c87b03e5Sespie 		   break;
497*c87b03e5Sespie       default:
498*c87b03e5Sespie 	unhandled = 1;
499*c87b03e5Sespie 	break;
500*c87b03e5Sespie     }
501*c87b03e5Sespie   if (!unhandled)
502*c87b03e5Sespie     return;
503*c87b03e5Sespie   if (class == '1')
504*c87b03e5Sespie     ra_print_rtx_1op (file, x);
505*c87b03e5Sespie   else if (class == '2' || class == 'c' || class == '<')
506*c87b03e5Sespie     ra_print_rtx_2op (file, x);
507*c87b03e5Sespie   else if (class == '3' || class == 'b')
508*c87b03e5Sespie     ra_print_rtx_3op (file, x);
509*c87b03e5Sespie   else if (class == 'o')
510*c87b03e5Sespie     ra_print_rtx_object (file, x);
511*c87b03e5Sespie   else
512*c87b03e5Sespie     print_inline_rtx (file, x, 0);
513*c87b03e5Sespie }
514*c87b03e5Sespie 
515*c87b03e5Sespie /* This only calls ra_print_rtx(), but emits a final newline.  */
516*c87b03e5Sespie 
517*c87b03e5Sespie void
ra_print_rtx_top(file,x,with_pn)518*c87b03e5Sespie ra_print_rtx_top (file, x, with_pn)
519*c87b03e5Sespie      FILE *file;
520*c87b03e5Sespie      rtx x;
521*c87b03e5Sespie      int with_pn;
522*c87b03e5Sespie {
523*c87b03e5Sespie   ra_print_rtx (file, x, with_pn);
524*c87b03e5Sespie   fprintf (file, "\n");
525*c87b03e5Sespie }
526*c87b03e5Sespie 
527*c87b03e5Sespie /* Callable from gdb.  This prints rtx X onto stderr.  */
528*c87b03e5Sespie 
529*c87b03e5Sespie void
ra_debug_rtx(x)530*c87b03e5Sespie ra_debug_rtx (x)
531*c87b03e5Sespie      rtx x;
532*c87b03e5Sespie {
533*c87b03e5Sespie   ra_print_rtx_top (stderr, x, 1);
534*c87b03e5Sespie }
535*c87b03e5Sespie 
536*c87b03e5Sespie /* This prints the content of basic block with index BBI.
537*c87b03e5Sespie    The first and last insn are emitted with UIDs of prev and next insns.  */
538*c87b03e5Sespie 
539*c87b03e5Sespie void
ra_debug_bbi(bbi)540*c87b03e5Sespie ra_debug_bbi (bbi)
541*c87b03e5Sespie      int bbi;
542*c87b03e5Sespie {
543*c87b03e5Sespie   basic_block bb = BASIC_BLOCK (bbi);
544*c87b03e5Sespie   rtx insn;
545*c87b03e5Sespie   for (insn = bb->head; insn; insn = NEXT_INSN (insn))
546*c87b03e5Sespie     {
547*c87b03e5Sespie       ra_print_rtx_top (stderr, insn, (insn == bb->head || insn == bb->end));
548*c87b03e5Sespie       fprintf (stderr, "\n");
549*c87b03e5Sespie       if (insn == bb->end)
550*c87b03e5Sespie 	break;
551*c87b03e5Sespie     }
552*c87b03e5Sespie }
553*c87b03e5Sespie 
554*c87b03e5Sespie /* Beginning from INSN, emit NUM insns (if NUM is non-negative)
555*c87b03e5Sespie    or emit a window of NUM insns around INSN, to stderr.  */
556*c87b03e5Sespie 
557*c87b03e5Sespie void
ra_debug_insns(insn,num)558*c87b03e5Sespie ra_debug_insns (insn, num)
559*c87b03e5Sespie      rtx insn;
560*c87b03e5Sespie      int num;
561*c87b03e5Sespie {
562*c87b03e5Sespie   int i, count = (num == 0 ? 1 : num < 0 ? -num : num);
563*c87b03e5Sespie   if (num < 0)
564*c87b03e5Sespie     for (i = count / 2; i > 0 && PREV_INSN (insn); i--)
565*c87b03e5Sespie       insn = PREV_INSN (insn);
566*c87b03e5Sespie   for (i = count; i > 0 && insn; insn = NEXT_INSN (insn), i--)
567*c87b03e5Sespie     {
568*c87b03e5Sespie       if (GET_CODE (insn) == CODE_LABEL)
569*c87b03e5Sespie 	fprintf (stderr, "\n");
570*c87b03e5Sespie       ra_print_rtx_top (stderr, insn, (i == count || i == 1));
571*c87b03e5Sespie     }
572*c87b03e5Sespie }
573*c87b03e5Sespie 
574*c87b03e5Sespie /* Beginning with INSN, emit the whole insn chain into FILE.
575*c87b03e5Sespie    This also outputs comments when basic blocks start or end and omits
576*c87b03e5Sespie    some notes, if flag_ra_dump_notes is zero.  */
577*c87b03e5Sespie 
578*c87b03e5Sespie void
ra_print_rtl_with_bb(file,insn)579*c87b03e5Sespie ra_print_rtl_with_bb (file, insn)
580*c87b03e5Sespie      FILE *file;
581*c87b03e5Sespie      rtx insn;
582*c87b03e5Sespie {
583*c87b03e5Sespie   basic_block last_bb, bb;
584*c87b03e5Sespie   unsigned int num = 0;
585*c87b03e5Sespie   if (!insn)
586*c87b03e5Sespie     fputs ("nil", file);
587*c87b03e5Sespie   last_bb = NULL;
588*c87b03e5Sespie   for (; insn; insn = NEXT_INSN (insn))
589*c87b03e5Sespie     {
590*c87b03e5Sespie       if (GET_CODE (insn) == BARRIER)
591*c87b03e5Sespie 	bb = NULL;
592*c87b03e5Sespie       else
593*c87b03e5Sespie 	bb = BLOCK_FOR_INSN (insn);
594*c87b03e5Sespie       if (bb != last_bb)
595*c87b03e5Sespie 	{
596*c87b03e5Sespie 	  if (last_bb)
597*c87b03e5Sespie 	    fprintf (file, ";; End of basic block %d\n", last_bb->index);
598*c87b03e5Sespie 	  if (bb)
599*c87b03e5Sespie 	    fprintf (file, ";; Begin of basic block %d\n", bb->index);
600*c87b03e5Sespie 	  last_bb = bb;
601*c87b03e5Sespie 	}
602*c87b03e5Sespie       if (GET_CODE (insn) == CODE_LABEL)
603*c87b03e5Sespie 	fputc ('\n', file);
604*c87b03e5Sespie       if (GET_CODE (insn) == NOTE)
605*c87b03e5Sespie 	{
606*c87b03e5Sespie 	  /* Ignore basic block and maybe other notes not referencing
607*c87b03e5Sespie 	     deleted things.  */
608*c87b03e5Sespie 	  if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
609*c87b03e5Sespie 	      && (flag_ra_dump_notes
610*c87b03e5Sespie 		  || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED
611*c87b03e5Sespie 		  || NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))
612*c87b03e5Sespie 	    {
613*c87b03e5Sespie 	      ra_print_rtx_top (file, insn, (num == 0 || !NEXT_INSN (insn)));
614*c87b03e5Sespie 	      num++;
615*c87b03e5Sespie 	    }
616*c87b03e5Sespie 	}
617*c87b03e5Sespie       else
618*c87b03e5Sespie 	{
619*c87b03e5Sespie 	  ra_print_rtx_top (file, insn, (num == 0 || !NEXT_INSN (insn)));
620*c87b03e5Sespie 	  num++;
621*c87b03e5Sespie 	}
622*c87b03e5Sespie     }
623*c87b03e5Sespie }
624*c87b03e5Sespie 
625*c87b03e5Sespie /* Count how many insns were seen how often, while building the interference
626*c87b03e5Sespie    graph, and prints the findings.  */
627*c87b03e5Sespie 
628*c87b03e5Sespie void
dump_number_seen()629*c87b03e5Sespie dump_number_seen ()
630*c87b03e5Sespie {
631*c87b03e5Sespie #define N 17
632*c87b03e5Sespie   int num[N];
633*c87b03e5Sespie   int i;
634*c87b03e5Sespie 
635*c87b03e5Sespie   for (i = 0; i < N; i++)
636*c87b03e5Sespie     num[i] = 0;
637*c87b03e5Sespie   for (i = 0; i < get_max_uid (); i++)
638*c87b03e5Sespie     if (number_seen[i] < N - 1)
639*c87b03e5Sespie       num[number_seen[i]]++;
640*c87b03e5Sespie     else
641*c87b03e5Sespie       num[N - 1]++;
642*c87b03e5Sespie   for (i = 0; i < N - 1; i++)
643*c87b03e5Sespie     if (num[i])
644*c87b03e5Sespie       ra_debug_msg (DUMP_PROCESS, "%d insns seen %d times\n", num[i], i);
645*c87b03e5Sespie   if (num[N - 1])
646*c87b03e5Sespie     ra_debug_msg (DUMP_PROCESS, "%d insns seen %d and more times\n", num[i],
647*c87b03e5Sespie 	       N - 1);
648*c87b03e5Sespie   ra_debug_msg (DUMP_PROCESS, "from overall %d insns\n", get_max_uid ());
649*c87b03e5Sespie #undef N
650*c87b03e5Sespie }
651*c87b03e5Sespie 
652*c87b03e5Sespie /* Dump the interference graph, the move list and the webs.  */
653*c87b03e5Sespie 
654*c87b03e5Sespie void
dump_igraph(df)655*c87b03e5Sespie dump_igraph (df)
656*c87b03e5Sespie      struct df *df ATTRIBUTE_UNUSED;
657*c87b03e5Sespie {
658*c87b03e5Sespie   struct move_list *ml;
659*c87b03e5Sespie   unsigned int def1, def2;
660*c87b03e5Sespie   int num = 0;
661*c87b03e5Sespie   int num2;
662*c87b03e5Sespie   unsigned int i;
663*c87b03e5Sespie   if (!rtl_dump_file || (debug_new_regalloc & (DUMP_IGRAPH | DUMP_WEBS)) == 0)
664*c87b03e5Sespie     return;
665*c87b03e5Sespie   ra_debug_msg (DUMP_IGRAPH, "conflicts:\n  ");
666*c87b03e5Sespie   for (def1 = 0; def1 < num_webs; def1++)
667*c87b03e5Sespie     {
668*c87b03e5Sespie       int num1 = num;
669*c87b03e5Sespie       for (num2=0, def2 = 0; def2 < num_webs; def2++)
670*c87b03e5Sespie         if (def1 != def2 && TEST_BIT (igraph, igraph_index (def1, def2)))
671*c87b03e5Sespie 	  {
672*c87b03e5Sespie 	    if (num1 == num)
673*c87b03e5Sespie 	      {
674*c87b03e5Sespie 	        if (SUBWEB_P (ID2WEB (def1)))
675*c87b03e5Sespie 		  ra_debug_msg (DUMP_IGRAPH, "%d (SUBREG %d, %d) with ", def1,
676*c87b03e5Sespie 			     ID2WEB (def1)->regno,
677*c87b03e5Sespie 			     SUBREG_BYTE (ID2WEB (def1)->orig_x));
678*c87b03e5Sespie 	        else
679*c87b03e5Sespie 	          ra_debug_msg (DUMP_IGRAPH, "%d (REG %d) with ", def1,
680*c87b03e5Sespie 			     ID2WEB (def1)->regno);
681*c87b03e5Sespie 	      }
682*c87b03e5Sespie 	    if ((num2 % 9) == 8)
683*c87b03e5Sespie 	      ra_debug_msg (DUMP_IGRAPH, "\n              ");
684*c87b03e5Sespie 	    num++;
685*c87b03e5Sespie 	    num2++;
686*c87b03e5Sespie 	    if (SUBWEB_P (ID2WEB (def2)))
687*c87b03e5Sespie 	      ra_debug_msg (DUMP_IGRAPH, "%d(%d,%d) ", def2, ID2WEB (def2)->regno,
688*c87b03e5Sespie 			 SUBREG_BYTE (ID2WEB (def2)->orig_x));
689*c87b03e5Sespie 	    else
690*c87b03e5Sespie 	      ra_debug_msg (DUMP_IGRAPH, "%d(%d) ", def2, ID2WEB (def2)->regno);
691*c87b03e5Sespie 	  }
692*c87b03e5Sespie       if (num1 != num)
693*c87b03e5Sespie 	ra_debug_msg (DUMP_IGRAPH, "\n  ");
694*c87b03e5Sespie     }
695*c87b03e5Sespie   ra_debug_msg (DUMP_IGRAPH, "\n");
696*c87b03e5Sespie   for (ml = wl_moves; ml; ml = ml->next)
697*c87b03e5Sespie     if (ml->move)
698*c87b03e5Sespie       {
699*c87b03e5Sespie         ra_debug_msg (DUMP_IGRAPH, "move: insn %d: Web %d <-- Web %d\n",
700*c87b03e5Sespie 	         INSN_UID (ml->move->insn), ml->move->target_web->id,
701*c87b03e5Sespie 	         ml->move->source_web->id);
702*c87b03e5Sespie       }
703*c87b03e5Sespie   ra_debug_msg (DUMP_WEBS, "\nWebs:\n");
704*c87b03e5Sespie   for (i = 0; i < num_webs; i++)
705*c87b03e5Sespie     {
706*c87b03e5Sespie       struct web *web = ID2WEB (i);
707*c87b03e5Sespie 
708*c87b03e5Sespie       ra_debug_msg (DUMP_WEBS, "  %4d : regno %3d", i, web->regno);
709*c87b03e5Sespie       if (SUBWEB_P (web))
710*c87b03e5Sespie 	{
711*c87b03e5Sespie 	  ra_debug_msg (DUMP_WEBS, " sub %d", SUBREG_BYTE (web->orig_x));
712*c87b03e5Sespie 	  ra_debug_msg (DUMP_WEBS, " par %d", find_web_for_subweb (web)->id);
713*c87b03e5Sespie 	}
714*c87b03e5Sespie       ra_debug_msg (DUMP_WEBS, " +%d (span %d, cost ",
715*c87b03e5Sespie 		    web->add_hardregs, web->span_deaths);
716*c87b03e5Sespie       ra_debug_msg (DUMP_WEBS, HOST_WIDE_INT_PRINT_DEC, web->spill_cost);
717*c87b03e5Sespie       ra_debug_msg (DUMP_WEBS, ") (%s)", reg_class_names[web->regclass]);
718*c87b03e5Sespie       if (web->spill_temp == 1)
719*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " (spilltemp)");
720*c87b03e5Sespie       else if (web->spill_temp == 2)
721*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " (spilltem2)");
722*c87b03e5Sespie       else if (web->spill_temp == 3)
723*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " (short)");
724*c87b03e5Sespie       if (web->type == PRECOLORED)
725*c87b03e5Sespie         ra_debug_msg (DUMP_WEBS, " (precolored, color=%d)", web->color);
726*c87b03e5Sespie       else if (find_web_for_subweb (web)->num_uses == 0)
727*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " dead");
728*c87b03e5Sespie       if (web->crosses_call)
729*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " xcall");
730*c87b03e5Sespie       if (web->regno >= max_normal_pseudo)
731*c87b03e5Sespie 	ra_debug_msg (DUMP_WEBS, " stack");
732*c87b03e5Sespie       ra_debug_msg (DUMP_WEBS, "\n");
733*c87b03e5Sespie     }
734*c87b03e5Sespie }
735*c87b03e5Sespie 
736*c87b03e5Sespie /* Dump the interference graph and webs in a format easily
737*c87b03e5Sespie    parsable by programs.  Used to emit real world interference graph
738*c87b03e5Sespie    to my custom graph colorizer.  */
739*c87b03e5Sespie 
740*c87b03e5Sespie void
dump_igraph_machine()741*c87b03e5Sespie dump_igraph_machine ()
742*c87b03e5Sespie {
743*c87b03e5Sespie   unsigned int i;
744*c87b03e5Sespie 
745*c87b03e5Sespie   if (!rtl_dump_file || (debug_new_regalloc & DUMP_IGRAPH_M) == 0)
746*c87b03e5Sespie     return;
747*c87b03e5Sespie   ra_debug_msg (DUMP_IGRAPH_M, "g %d %d\n", num_webs - num_subwebs,
748*c87b03e5Sespie 	     FIRST_PSEUDO_REGISTER);
749*c87b03e5Sespie   for (i = 0; i < num_webs - num_subwebs; i++)
750*c87b03e5Sespie     {
751*c87b03e5Sespie       struct web *web = ID2WEB (i);
752*c87b03e5Sespie       struct conflict_link *cl;
753*c87b03e5Sespie       int flags = 0;
754*c87b03e5Sespie       int numc = 0;
755*c87b03e5Sespie       int col = 0;
756*c87b03e5Sespie       flags = web->spill_temp & 0xF;
757*c87b03e5Sespie       flags |= ((web->type == PRECOLORED) ? 1 : 0) << 4;
758*c87b03e5Sespie       flags |= (web->add_hardregs & 0xF) << 5;
759*c87b03e5Sespie       for (cl = web->conflict_list; cl; cl = cl->next)
760*c87b03e5Sespie 	if (cl->t->id < web->id)
761*c87b03e5Sespie 	  numc++;
762*c87b03e5Sespie       ra_debug_msg (DUMP_IGRAPH_M, "n %d %d %d %d %d %d %d\n",
763*c87b03e5Sespie 		 web->id, web->color, flags,
764*c87b03e5Sespie 		 (unsigned int)web->spill_cost, web->num_defs, web->num_uses,
765*c87b03e5Sespie 		 numc);
766*c87b03e5Sespie       if (web->type != PRECOLORED)
767*c87b03e5Sespie 	{
768*c87b03e5Sespie 	  ra_debug_msg (DUMP_IGRAPH_M, "s %d", web->id);
769*c87b03e5Sespie 	  while (1)
770*c87b03e5Sespie 	    {
771*c87b03e5Sespie 	      unsigned int u = 0;
772*c87b03e5Sespie 	      int n;
773*c87b03e5Sespie 	      for (n = 0; n < 32 && col < FIRST_PSEUDO_REGISTER; n++, col++)
774*c87b03e5Sespie 		if (TEST_HARD_REG_BIT (web->usable_regs, col))
775*c87b03e5Sespie 		  u |= 1 << n;
776*c87b03e5Sespie 	      ra_debug_msg (DUMP_IGRAPH_M, " %u", u);
777*c87b03e5Sespie 	      if (col >= FIRST_PSEUDO_REGISTER)
778*c87b03e5Sespie 		break;
779*c87b03e5Sespie 	    }
780*c87b03e5Sespie 	  ra_debug_msg (DUMP_IGRAPH_M, "\n");
781*c87b03e5Sespie 	}
782*c87b03e5Sespie       if (numc)
783*c87b03e5Sespie 	{
784*c87b03e5Sespie 	  ra_debug_msg (DUMP_IGRAPH_M, "c %d", web->id);
785*c87b03e5Sespie 	  for (cl = web->conflict_list; cl; cl = cl->next)
786*c87b03e5Sespie 	    {
787*c87b03e5Sespie 	      if (cl->t->id < web->id)
788*c87b03e5Sespie 		ra_debug_msg (DUMP_IGRAPH_M, " %d", cl->t->id);
789*c87b03e5Sespie 	    }
790*c87b03e5Sespie 	  ra_debug_msg (DUMP_IGRAPH_M, "\n");
791*c87b03e5Sespie 	}
792*c87b03e5Sespie     }
793*c87b03e5Sespie   ra_debug_msg (DUMP_IGRAPH_M, "e\n");
794*c87b03e5Sespie }
795*c87b03e5Sespie 
796*c87b03e5Sespie /* This runs after colorization and changing the insn stream.
797*c87b03e5Sespie    It temporarily replaces all pseudo registers with their colors,
798*c87b03e5Sespie    and emits information, if the resulting insns are strictly valid.  */
799*c87b03e5Sespie 
800*c87b03e5Sespie void
dump_constraints()801*c87b03e5Sespie dump_constraints ()
802*c87b03e5Sespie {
803*c87b03e5Sespie   rtx insn;
804*c87b03e5Sespie   int i;
805*c87b03e5Sespie   if (!rtl_dump_file || (debug_new_regalloc & DUMP_CONSTRAINTS) == 0)
806*c87b03e5Sespie     return;
807*c87b03e5Sespie   for (i = FIRST_PSEUDO_REGISTER; i < ra_max_regno; i++)
808*c87b03e5Sespie     if (regno_reg_rtx[i] && GET_CODE (regno_reg_rtx[i]) == REG)
809*c87b03e5Sespie       REGNO (regno_reg_rtx[i])
810*c87b03e5Sespie 	  = ra_reg_renumber[i] >= 0 ? ra_reg_renumber[i] : i;
811*c87b03e5Sespie   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
812*c87b03e5Sespie     if (INSN_P (insn))
813*c87b03e5Sespie       {
814*c87b03e5Sespie 	int code;
815*c87b03e5Sespie 	int uid = INSN_UID (insn);
816*c87b03e5Sespie 	int o;
817*c87b03e5Sespie 	/* Don't simply force rerecognition, as combine might left us
818*c87b03e5Sespie 	   with some unrecongnizable ones, which later leads to aborts
819*c87b03e5Sespie 	   in regclass, if we now destroy the remembered INSN_CODE().  */
820*c87b03e5Sespie 	/*INSN_CODE (insn) = -1;*/
821*c87b03e5Sespie 	code = recog_memoized (insn);
822*c87b03e5Sespie 	if (code < 0)
823*c87b03e5Sespie 	  {
824*c87b03e5Sespie 	    ra_debug_msg (DUMP_CONSTRAINTS,
825*c87b03e5Sespie 		       "%d: asm insn or not recognizable.\n", uid);
826*c87b03e5Sespie 	    continue;
827*c87b03e5Sespie 	  }
828*c87b03e5Sespie 	ra_debug_msg (DUMP_CONSTRAINTS,
829*c87b03e5Sespie 		   "%d: code %d {%s}, %d operands, constraints: ",
830*c87b03e5Sespie 		   uid, code, insn_data[code].name, recog_data.n_operands);
831*c87b03e5Sespie         extract_insn (insn);
832*c87b03e5Sespie 	/*preprocess_constraints ();*/
833*c87b03e5Sespie 	for (o = 0; o < recog_data.n_operands; o++)
834*c87b03e5Sespie 	  {
835*c87b03e5Sespie 	    ra_debug_msg (DUMP_CONSTRAINTS,
836*c87b03e5Sespie 		       "%d:%s ", o, recog_data.constraints[o]);
837*c87b03e5Sespie 	  }
838*c87b03e5Sespie 	if (constrain_operands (1))
839*c87b03e5Sespie 	  ra_debug_msg (DUMP_CONSTRAINTS, "matches strictly alternative %d",
840*c87b03e5Sespie 		     which_alternative);
841*c87b03e5Sespie 	else
842*c87b03e5Sespie 	  ra_debug_msg (DUMP_CONSTRAINTS, "doesn't match strictly");
843*c87b03e5Sespie 	ra_debug_msg (DUMP_CONSTRAINTS, "\n");
844*c87b03e5Sespie       }
845*c87b03e5Sespie   for (i = FIRST_PSEUDO_REGISTER; i < ra_max_regno; i++)
846*c87b03e5Sespie     if (regno_reg_rtx[i] && GET_CODE (regno_reg_rtx[i]) == REG)
847*c87b03e5Sespie       REGNO (regno_reg_rtx[i]) = i;
848*c87b03e5Sespie }
849*c87b03e5Sespie 
850*c87b03e5Sespie /* This counts and emits the cumulated cost of all spilled webs,
851*c87b03e5Sespie    preceded by a custom message MSG, with debug level LEVEL.  */
852*c87b03e5Sespie 
853*c87b03e5Sespie void
dump_graph_cost(level,msg)854*c87b03e5Sespie dump_graph_cost (level, msg)
855*c87b03e5Sespie      unsigned int level;
856*c87b03e5Sespie      const char *msg;
857*c87b03e5Sespie {
858*c87b03e5Sespie   unsigned int i;
859*c87b03e5Sespie   unsigned HOST_WIDE_INT cost;
860*c87b03e5Sespie   if (!rtl_dump_file || (debug_new_regalloc & level) == 0)
861*c87b03e5Sespie     return;
862*c87b03e5Sespie 
863*c87b03e5Sespie   cost = 0;
864*c87b03e5Sespie   for (i = 0; i < num_webs; i++)
865*c87b03e5Sespie     {
866*c87b03e5Sespie       struct web *web = id2web[i];
867*c87b03e5Sespie       if (alias (web)->type == SPILLED)
868*c87b03e5Sespie 	cost += web->orig_spill_cost;
869*c87b03e5Sespie     }
870*c87b03e5Sespie   ra_debug_msg (level, " spill cost of graph (%s) = ", msg ? msg : "");
871*c87b03e5Sespie   ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, cost);
872*c87b03e5Sespie   ra_debug_msg (level, "\n");
873*c87b03e5Sespie }
874*c87b03e5Sespie 
875*c87b03e5Sespie /* Dump the color assignment per web, the coalesced and spilled webs.  */
876*c87b03e5Sespie 
877*c87b03e5Sespie void
dump_ra(df)878*c87b03e5Sespie dump_ra (df)
879*c87b03e5Sespie      struct df *df ATTRIBUTE_UNUSED;
880*c87b03e5Sespie {
881*c87b03e5Sespie   struct web *web;
882*c87b03e5Sespie   struct dlist *d;
883*c87b03e5Sespie   if (!rtl_dump_file || (debug_new_regalloc & DUMP_RESULTS) == 0)
884*c87b03e5Sespie     return;
885*c87b03e5Sespie 
886*c87b03e5Sespie   ra_debug_msg (DUMP_RESULTS, "\nColored:\n");
887*c87b03e5Sespie   for (d = WEBS(COLORED); d; d = d->next)
888*c87b03e5Sespie     {
889*c87b03e5Sespie       web = DLIST_WEB (d);
890*c87b03e5Sespie       ra_debug_msg (DUMP_RESULTS, "  %4d : color %d\n", web->id, web->color);
891*c87b03e5Sespie     }
892*c87b03e5Sespie   ra_debug_msg (DUMP_RESULTS, "\nCoalesced:\n");
893*c87b03e5Sespie   for (d = WEBS(COALESCED); d; d = d->next)
894*c87b03e5Sespie     {
895*c87b03e5Sespie       web = DLIST_WEB (d);
896*c87b03e5Sespie       ra_debug_msg (DUMP_RESULTS, "  %4d : to web %d, color %d\n", web->id,
897*c87b03e5Sespie 	         alias (web)->id, web->color);
898*c87b03e5Sespie     }
899*c87b03e5Sespie   ra_debug_msg (DUMP_RESULTS, "\nSpilled:\n");
900*c87b03e5Sespie   for (d = WEBS(SPILLED); d; d = d->next)
901*c87b03e5Sespie     {
902*c87b03e5Sespie       web = DLIST_WEB (d);
903*c87b03e5Sespie       ra_debug_msg (DUMP_RESULTS, "  %4d\n", web->id);
904*c87b03e5Sespie     }
905*c87b03e5Sespie   ra_debug_msg (DUMP_RESULTS, "\n");
906*c87b03e5Sespie   dump_cost (DUMP_RESULTS);
907*c87b03e5Sespie }
908*c87b03e5Sespie 
909*c87b03e5Sespie /* Calculate and dump the cumulated costs of certain types of insns
910*c87b03e5Sespie    (loads, stores and copies).  */
911*c87b03e5Sespie 
912*c87b03e5Sespie void
dump_static_insn_cost(file,message,prefix)913*c87b03e5Sespie dump_static_insn_cost (file, message, prefix)
914*c87b03e5Sespie      FILE *file;
915*c87b03e5Sespie      const char *message;
916*c87b03e5Sespie      const char *prefix;
917*c87b03e5Sespie {
918*c87b03e5Sespie   struct cost
919*c87b03e5Sespie     {
920*c87b03e5Sespie       unsigned HOST_WIDE_INT cost;
921*c87b03e5Sespie       unsigned int count;
922*c87b03e5Sespie     };
923*c87b03e5Sespie   basic_block bb;
924*c87b03e5Sespie   struct cost load, store, regcopy, selfcopy, overall;
925*c87b03e5Sespie   memset (&load, 0, sizeof(load));
926*c87b03e5Sespie   memset (&store, 0, sizeof(store));
927*c87b03e5Sespie   memset (&regcopy, 0, sizeof(regcopy));
928*c87b03e5Sespie   memset (&selfcopy, 0, sizeof(selfcopy));
929*c87b03e5Sespie   memset (&overall, 0, sizeof(overall));
930*c87b03e5Sespie 
931*c87b03e5Sespie   if (!file)
932*c87b03e5Sespie     return;
933*c87b03e5Sespie 
934*c87b03e5Sespie   FOR_EACH_BB (bb)
935*c87b03e5Sespie     {
936*c87b03e5Sespie       unsigned HOST_WIDE_INT block_cost = bb->frequency;
937*c87b03e5Sespie       rtx insn, set;
938*c87b03e5Sespie       for (insn = bb->head; insn; insn = NEXT_INSN (insn))
939*c87b03e5Sespie 	{
940*c87b03e5Sespie 	  /* Yes, yes.  We don't calculate the costs precisely.
941*c87b03e5Sespie 	     Only for "simple enough" insns.  Those containing single
942*c87b03e5Sespie 	     sets only.  */
943*c87b03e5Sespie 	  if (INSN_P (insn) && ((set = single_set (insn)) != NULL))
944*c87b03e5Sespie 	    {
945*c87b03e5Sespie 	      rtx src = SET_SRC (set);
946*c87b03e5Sespie 	      rtx dest = SET_DEST (set);
947*c87b03e5Sespie 	      struct cost *pcost = NULL;
948*c87b03e5Sespie 	      overall.cost += block_cost;
949*c87b03e5Sespie 	      overall.count++;
950*c87b03e5Sespie 	      if (rtx_equal_p (src, dest))
951*c87b03e5Sespie 		pcost = &selfcopy;
952*c87b03e5Sespie 	      else if (GET_CODE (src) == GET_CODE (dest)
953*c87b03e5Sespie 		       && ((GET_CODE (src) == REG)
954*c87b03e5Sespie 			   || (GET_CODE (src) == SUBREG
955*c87b03e5Sespie 			       && GET_CODE (SUBREG_REG (src)) == REG
956*c87b03e5Sespie 			       && GET_CODE (SUBREG_REG (dest)) == REG)))
957*c87b03e5Sespie 		pcost = &regcopy;
958*c87b03e5Sespie 	      else
959*c87b03e5Sespie 		{
960*c87b03e5Sespie 		  if (GET_CODE (src) == SUBREG)
961*c87b03e5Sespie 		    src = SUBREG_REG (src);
962*c87b03e5Sespie 		  if (GET_CODE (dest) == SUBREG)
963*c87b03e5Sespie 		    dest = SUBREG_REG (dest);
964*c87b03e5Sespie 		  if (GET_CODE (src) == MEM && GET_CODE (dest) != MEM
965*c87b03e5Sespie 		      && memref_is_stack_slot (src))
966*c87b03e5Sespie 		    pcost = &load;
967*c87b03e5Sespie 		  else if (GET_CODE (src) != MEM && GET_CODE (dest) == MEM
968*c87b03e5Sespie 			   && memref_is_stack_slot (dest))
969*c87b03e5Sespie 		    pcost = &store;
970*c87b03e5Sespie 		}
971*c87b03e5Sespie 	      if (pcost)
972*c87b03e5Sespie 		{
973*c87b03e5Sespie 		  pcost->cost += block_cost;
974*c87b03e5Sespie 		  pcost->count++;
975*c87b03e5Sespie 		}
976*c87b03e5Sespie 	    }
977*c87b03e5Sespie 	  if (insn == bb->end)
978*c87b03e5Sespie 	    break;
979*c87b03e5Sespie 	}
980*c87b03e5Sespie     }
981*c87b03e5Sespie 
982*c87b03e5Sespie   if (!prefix)
983*c87b03e5Sespie     prefix = "";
984*c87b03e5Sespie   fprintf (file, "static insn cost %s\n", message ? message : "");
985*c87b03e5Sespie   fprintf (file, "  %soverall:\tnum=%6d\tcost=", prefix, overall.count);
986*c87b03e5Sespie   fprintf (file, HOST_WIDE_INT_PRINT_DEC_SPACE, 8, overall.cost);
987*c87b03e5Sespie   fprintf (file, "\n");
988*c87b03e5Sespie   fprintf (file, "  %sloads:\tnum=%6d\tcost=", prefix, load.count);
989*c87b03e5Sespie   fprintf (file, HOST_WIDE_INT_PRINT_DEC_SPACE, 8, load.cost);
990*c87b03e5Sespie   fprintf (file, "\n");
991*c87b03e5Sespie   fprintf (file, "  %sstores:\tnum=%6d\tcost=", prefix, store.count);
992*c87b03e5Sespie   fprintf (file, HOST_WIDE_INT_PRINT_DEC_SPACE, 8, store.cost);
993*c87b03e5Sespie   fprintf (file, "\n");
994*c87b03e5Sespie   fprintf (file, "  %sregcopy:\tnum=%6d\tcost=", prefix, regcopy.count);
995*c87b03e5Sespie   fprintf (file, HOST_WIDE_INT_PRINT_DEC_SPACE, 8, regcopy.cost);
996*c87b03e5Sespie   fprintf (file, "\n");
997*c87b03e5Sespie   fprintf (file, "  %sselfcpy:\tnum=%6d\tcost=", prefix, selfcopy.count);
998*c87b03e5Sespie   fprintf (file, HOST_WIDE_INT_PRINT_DEC_SPACE, 8, selfcopy.cost);
999*c87b03e5Sespie   fprintf (file, "\n");
1000*c87b03e5Sespie }
1001*c87b03e5Sespie 
1002*c87b03e5Sespie /* Returns nonzero, if WEB1 and WEB2 have some possible
1003*c87b03e5Sespie    hardregs in common.  */
1004*c87b03e5Sespie 
1005*c87b03e5Sespie int
web_conflicts_p(web1,web2)1006*c87b03e5Sespie web_conflicts_p (web1, web2)
1007*c87b03e5Sespie      struct web *web1;
1008*c87b03e5Sespie      struct web *web2;
1009*c87b03e5Sespie {
1010*c87b03e5Sespie   if (web1->type == PRECOLORED && web2->type == PRECOLORED)
1011*c87b03e5Sespie     return 0;
1012*c87b03e5Sespie 
1013*c87b03e5Sespie   if (web1->type == PRECOLORED)
1014*c87b03e5Sespie     return TEST_HARD_REG_BIT (web2->usable_regs, web1->regno);
1015*c87b03e5Sespie 
1016*c87b03e5Sespie   if (web2->type == PRECOLORED)
1017*c87b03e5Sespie     return TEST_HARD_REG_BIT (web1->usable_regs, web2->regno);
1018*c87b03e5Sespie 
1019*c87b03e5Sespie   return hard_regs_intersect_p (&web1->usable_regs, &web2->usable_regs);
1020*c87b03e5Sespie }
1021*c87b03e5Sespie 
1022*c87b03e5Sespie /* Dump all uids of insns in which WEB is mentioned.  */
1023*c87b03e5Sespie 
1024*c87b03e5Sespie void
dump_web_insns(web)1025*c87b03e5Sespie dump_web_insns (web)
1026*c87b03e5Sespie      struct web *web;
1027*c87b03e5Sespie {
1028*c87b03e5Sespie   unsigned int i;
1029*c87b03e5Sespie 
1030*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "Web: %i(%i)+%i class: %s freedom: %i degree %i\n",
1031*c87b03e5Sespie 	     web->id, web->regno, web->add_hardregs,
1032*c87b03e5Sespie 	     reg_class_names[web->regclass],
1033*c87b03e5Sespie 	     web->num_freedom, web->num_conflicts);
1034*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "   def insns:");
1035*c87b03e5Sespie 
1036*c87b03e5Sespie   for (i = 0; i < web->num_defs; ++i)
1037*c87b03e5Sespie     {
1038*c87b03e5Sespie       ra_debug_msg (DUMP_EVER, " %d ", INSN_UID (web->defs[i]->insn));
1039*c87b03e5Sespie     }
1040*c87b03e5Sespie 
1041*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "\n   use insns:");
1042*c87b03e5Sespie   for (i = 0; i < web->num_uses; ++i)
1043*c87b03e5Sespie     {
1044*c87b03e5Sespie       ra_debug_msg (DUMP_EVER, " %d ", INSN_UID (web->uses[i]->insn));
1045*c87b03e5Sespie     }
1046*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "\n");
1047*c87b03e5Sespie }
1048*c87b03e5Sespie 
1049*c87b03e5Sespie /* Dump conflicts for web WEB.  */
1050*c87b03e5Sespie 
1051*c87b03e5Sespie void
dump_web_conflicts(web)1052*c87b03e5Sespie dump_web_conflicts (web)
1053*c87b03e5Sespie      struct web *web;
1054*c87b03e5Sespie {
1055*c87b03e5Sespie   int num = 0;
1056*c87b03e5Sespie   unsigned int def2;
1057*c87b03e5Sespie 
1058*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "Web: %i(%i)+%i class: %s freedom: %i degree %i\n",
1059*c87b03e5Sespie 	     web->id, web->regno, web->add_hardregs,
1060*c87b03e5Sespie 	     reg_class_names[web->regclass],
1061*c87b03e5Sespie 	     web->num_freedom, web->num_conflicts);
1062*c87b03e5Sespie 
1063*c87b03e5Sespie   for (def2 = 0; def2 < num_webs; def2++)
1064*c87b03e5Sespie     if (TEST_BIT (igraph, igraph_index (web->id, def2)) && web->id != def2)
1065*c87b03e5Sespie       {
1066*c87b03e5Sespie 	if ((num % 9) == 5)
1067*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER, "\n             ");
1068*c87b03e5Sespie 	num++;
1069*c87b03e5Sespie 
1070*c87b03e5Sespie 	ra_debug_msg (DUMP_EVER, " %d(%d)", def2, id2web[def2]->regno);
1071*c87b03e5Sespie 	if (id2web[def2]->add_hardregs)
1072*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER, "+%d", id2web[def2]->add_hardregs);
1073*c87b03e5Sespie 
1074*c87b03e5Sespie 	if (web_conflicts_p (web, id2web[def2]))
1075*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER, "/x");
1076*c87b03e5Sespie 
1077*c87b03e5Sespie 	if (id2web[def2]->type == SELECT)
1078*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER, "/s");
1079*c87b03e5Sespie 
1080*c87b03e5Sespie 	if (id2web[def2]->type == COALESCED)
1081*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER,"/c/%d", alias (id2web[def2])->id);
1082*c87b03e5Sespie       }
1083*c87b03e5Sespie   ra_debug_msg (DUMP_EVER, "\n");
1084*c87b03e5Sespie   {
1085*c87b03e5Sespie     struct conflict_link *wl;
1086*c87b03e5Sespie     num = 0;
1087*c87b03e5Sespie     ra_debug_msg (DUMP_EVER, "By conflicts:     ");
1088*c87b03e5Sespie     for (wl = web->conflict_list; wl; wl = wl->next)
1089*c87b03e5Sespie       {
1090*c87b03e5Sespie 	struct web* w = wl->t;
1091*c87b03e5Sespie 	if ((num % 9) == 8)
1092*c87b03e5Sespie 	  ra_debug_msg (DUMP_EVER, "\n              ");
1093*c87b03e5Sespie 	num++;
1094*c87b03e5Sespie 	ra_debug_msg (DUMP_EVER, "%d(%d)%s ", w->id, w->regno,
1095*c87b03e5Sespie 		   web_conflicts_p (web, w) ? "+" : "");
1096*c87b03e5Sespie       }
1097*c87b03e5Sespie     ra_debug_msg (DUMP_EVER, "\n");
1098*c87b03e5Sespie   }
1099*c87b03e5Sespie }
1100*c87b03e5Sespie 
1101*c87b03e5Sespie /* Output HARD_REG_SET to stderr.  */
1102*c87b03e5Sespie 
1103*c87b03e5Sespie void
debug_hard_reg_set(set)1104*c87b03e5Sespie debug_hard_reg_set (set)
1105*c87b03e5Sespie      HARD_REG_SET set;
1106*c87b03e5Sespie {
1107*c87b03e5Sespie   int i;
1108*c87b03e5Sespie   for (i=0; i < FIRST_PSEUDO_REGISTER; ++i)
1109*c87b03e5Sespie     {
1110*c87b03e5Sespie       if (TEST_HARD_REG_BIT (set, i))
1111*c87b03e5Sespie 	{
1112*c87b03e5Sespie 	  fprintf (stderr, "%s ", reg_names[i]);
1113*c87b03e5Sespie 	}
1114*c87b03e5Sespie     }
1115*c87b03e5Sespie   fprintf (stderr, "\n");
1116*c87b03e5Sespie }
1117*c87b03e5Sespie 
1118*c87b03e5Sespie /*
1119*c87b03e5Sespie vim:cinoptions={.5s,g0,p5,t0,(0,^-0.5s,n-0.5s:tw=78:cindent:sw=4:
1120*c87b03e5Sespie */
1121