aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-3.c
blob: 5a5dd33e9276714942444a71c26c97b7983e56bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* { dg-do compile } */

typedef union rtunion_def {
  struct rtx_def *rtx;
} rtunion;
typedef struct rtx_def {
  unsigned short code;
  rtunion fld[1];
} *rtx;
extern rtx recog_operand[];
extern rtx *recog_operand_loc[];
extern int reload_n_operands;
extern void find_dummy_reload (int, int);
extern int asm_noperands (rtx);
extern int n_occurrences (char **);
char operands_match[10][10];
void find_reloads (rtx insn, int n_alternatives, int commutative)
{
  register int i, j;
  int noperands;
  char *constraints[10];
  int address_reloaded[10];
  int this_alternative[10];
  char this_alternative_win[10];
  int this_alternative_matches[10];
  int this_alternative_number;
  rtx body = ((insn)->fld[3].rtx);
  int operand_mode[10];
  if (body->code == 1)
    {
      reload_n_operands = noperands = asm_noperands (body);
      n_alternatives = n_occurrences (constraints);
    }
  for (this_alternative_number = 0;
       this_alternative_number < n_alternatives;
       this_alternative_number++)
    for (i = 0;
	 i < noperands;
	 i++)
      {
	register char *p = constraints[i];
	register int win = 0;
	int badop = 1;
	int c;
	register rtx operand = recog_operand[i];
	int force_reload = 0;
	this_alternative_win[i] = 0;
	this_alternative[i] = 1;
	while (*p && (c = *p++) != ',')
	  switch (c)
	    {
	    case '4':
	      c -= '0';
	      this_alternative_matches[i] = c;
	      if ((c != commutative
		   || i != commutative + 1)
		  && operands_match[c][i])
		win = this_alternative_win[c];
	      else
		find_dummy_reload (operand_mode[i], this_alternative[c]);
	      if (! win || force_reload)
		for (j = 0; j < i; j++)
		  if (this_alternative_matches[j]
		      == this_alternative_matches[i])
		    badop = 1;
	      break;
	    case '<':
	      if (operand->code == 2
		  && ! address_reloaded[i]
		  && operand->fld[0].rtx->code == 3)
		win = 1;
	    }
      }
}