1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-code-hoisting -fdump-tree-optimized -w" } */
3
4 typedef struct rtx_def *rtx;
5 enum rtx_code
6 {
7 UNKNOWN, VALUE, DEBUG_EXPR, EXPR_LIST, INSN_LIST, SEQUENCE, ADDRESS,
8 DEBUG_INSN, INSN, JUMP_INSN, CALL_INSN, BARRIER, CODE_LABEL, NOTE,
9 COND_EXEC, PARALLEL, ASM_INPUT, ASM_OPERANDS, UNSPEC, UNSPEC_VOLATILE,
10 ADDR_VEC, ADDR_DIFF_VEC, PREFETCH, SET, USE, CLOBBER, CALL, RETURN,
11 EH_RETURN, TRAP_IF, CONST_INT, CONST_FIXED, CONST_DOUBLE, CONST_VECTOR,
12 CONST_STRING, CONST, PC, REG, SCRATCH, SUBREG, STRICT_LOW_PART, CONCAT,
13 CONCATN, MEM, LABEL_REF, SYMBOL_REF, CC0, IF_THEN_ELSE, COMPARE, PLUS,
14 MINUS, NEG, MULT, SS_MULT, US_MULT, DIV, SS_DIV, US_DIV, MOD, UDIV, UMOD,
15 AND, IOR, XOR, NOT, ASHIFT, ROTATE, ASHIFTRT, LSHIFTRT, ROTATERT, SMIN,
16 SMAX, UMIN, UMAX, PRE_DEC, PRE_INC, POST_DEC, POST_INC, PRE_MODIFY,
17 POST_MODIFY, NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU, UNORDERED,
18 ORDERED, UNEQ, UNGE, UNGT, UNLE, UNLT, LTGT, SIGN_EXTEND, ZERO_EXTEND,
19 TRUNCATE, FLOAT_EXTEND, FLOAT_TRUNCATE, FLOAT, FIX, UNSIGNED_FLOAT,
20 UNSIGNED_FIX, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT,
21 UNSIGNED_SAT_FRACT, ABS, SQRT, BSWAP, FFS, CLZ, CTZ, POPCOUNT, PARITY,
22 SIGN_EXTRACT, ZERO_EXTRACT, HIGH, LO_SUM, VEC_MERGE, VEC_SELECT,
23 VEC_CONCAT, VEC_DUPLICATE, SS_PLUS, US_PLUS, SS_MINUS, SS_NEG, US_NEG,
24 SS_ABS, SS_ASHIFT, US_ASHIFT, US_MINUS, SS_TRUNCATE, US_TRUNCATE, FMA,
25 VAR_LOCATION, DEBUG_IMPLICIT_PTR, ENTRY_VALUE, LAST_AND_UNUSED_RTX_CODE
26 };
27 enum rtx_class
28 {
29 RTX_COMPARE, RTX_COMM_COMPARE, RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_UNARY,
30 RTX_EXTRA, RTX_MATCH, RTX_INSN, RTX_OBJ, RTX_CONST_OBJ, RTX_TERNARY,
31 RTX_BITFIELD_OPS, RTX_AUTOINC
32 };
33 extern const unsigned char rtx_length[((int) LAST_AND_UNUSED_RTX_CODE)];
34 extern const enum rtx_class rtx_class[((int) LAST_AND_UNUSED_RTX_CODE)];
35 union rtunion_def
36 {
37 rtx rt_rtx;
38 };
39 typedef union rtunion_def rtunion;
40 struct rtx_def
41 {
42 enum rtx_code code:8;
43 union u
44 {
45 rtunion fld[1];
46 }
47 u;
48 };
49 struct cse_reg_info
50 {
51 unsigned int timestamp;
52 int reg_qty;
53 int reg_tick;
54 int reg_in_table;
55 unsigned int subreg_ticked;
56 };
57 static struct cse_reg_info *cse_reg_info_table;
58 static unsigned int cse_reg_info_timestamp;
59
60 static __inline__ struct cse_reg_info *
get_cse_reg_info(unsigned int regno)61 get_cse_reg_info (unsigned int regno)
62 {
63 struct cse_reg_info *p = &cse_reg_info_table[regno];
64 if (p->timestamp != cse_reg_info_timestamp)
65 cse_reg_info_table[regno].timestamp = cse_reg_info_timestamp;
66 }
67
68 int
mention_regs(rtx x)69 mention_regs (rtx x)
70 {
71 enum rtx_code code;
72 int i, j;
73 const char *fmt;
74 int changed = 0;
75 code = ((x)->code);
76 if (code == SUBREG
77 && ((((((x)->u.fld[0]).rt_rtx))->code) == REG))
78 {
79 (get_cse_reg_info (i)->reg_in_table) = (get_cse_reg_info (i)->reg_tick);
80 (get_cse_reg_info (i)->subreg_ticked) =
81 (rhs_regno ((((x)->u.fld[0]).rt_rtx)));
82 }
83 if ((((rtx_class[(int) (((x)->code))]) & (~1)) == (RTX_COMPARE & (~1))))
84 {
85 if (((((((x)->u.fld[0]).rt_rtx))->code) == REG))
86 foop ();
87 }
88 for (i = (rtx_length[(int) (code)]) - 1; i >= 0; i--)
89 arf ();
90 }
91
92 /* Make sure the constant 39 gets propagated into the PHI at the join point. */
93 /* { dg-final { scan-tree-dump "PHI <.*, 39" "optimized"} } */
94
95