Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr38385.c
blobc3e5ac66c2e493815b1c58240819d4216f3f54ce
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribution" } */
4 struct rtx_def
6 int a;
7 };
9 typedef struct rtx_def *rtx;
11 struct rd {
12 int alternative_enabled_p[100];
13 rtx operand[100];
14 int n_operands;
17 rtx this_insn;
18 int n_reloads;
19 int n_replacements;
20 int n_earlyclobbers;
21 int replace_reloads;
22 int hard_regs_live_known;
23 short* static_reload_reg_p;
24 struct rd recog_data;
25 int ix86_preferred_reload_class (rtx, int);
27 int
28 find_reloads (rtx insn, int replace, int ind_levels, int live_known,
29 short *reload_reg_p)
31 int i, j;
32 int noperands = replace;
34 int no_input_reloads = 0;
35 int n_alternatives = replace;
36 char this_alternative_match_win[30];
37 char this_alternative_win[30];
38 char this_alternative_earlyclobber[30];
39 int this_alternative_matches[30];
40 int goal_alternative[30];
41 int this_alternative_number;
43 char goal_alternative_match_win[30];
44 char goal_alternative_win[30];
45 int best;
47 int operand_mode[30];
48 int retval = 0;
50 for (this_alternative_number = 0;
51 this_alternative_number < n_alternatives;
52 this_alternative_number++)
55 int losers = 0;
56 int bad = 0;
58 if (!recog_data.alternative_enabled_p[this_alternative_number])
60 int i;
62 for (i = 0; i < recog_data.n_operands; i++)
65 continue;
68 for (i = 0; i < noperands; i++)
69 if (this_alternative_earlyclobber[i]
70 && (this_alternative_win[i] || this_alternative_match_win[i]))
72 if (j != noperands)
74 losers++;
76 for (j = 0; j < noperands; j++)
77 if (this_alternative_matches[j] == i
78 && this_alternative_match_win[j])
80 this_alternative_win[j] = 0;
81 this_alternative_match_win[j] = 0;
82 losers++;
87 if (losers == 0)
89 for (i = 0; i < noperands; i++)
91 goal_alternative_win[i] = 0;
92 goal_alternative_match_win[i] = 0;
95 goto finish;
98 if (! bad && best > losers)
100 for (i = 0; i < noperands; i++)
102 goal_alternative[i] = 0;
103 goal_alternative_win[i] = 0;
109 finish:
111 for (i = 0; i < noperands; i++)
112 if (! goal_alternative_win[i])
114 rtx op = recog_data.operand[i];
115 int mode = operand_mode[i];
117 if (((ix86_preferred_reload_class ((op), (goal_alternative[i])) == 2)
118 || no_input_reloads)
119 && mode != 0)
123 return retval;