Line data Source code
1 : /* Generated automatically by the program `genmatch' from
2 : a IL pattern matching and simplification description. */
3 : #pragma GCC diagnostic push
4 : #pragma GCC diagnostic ignored "-Wunused-variable"
5 : #pragma GCC diagnostic ignored "-Wunused-function"
6 :
7 : #include "generic-match-auto.h"
8 :
9 : bool
10 107223225 : tree_logical_inverted_value (tree t, tree *res_ops)
11 : {
12 107223225 : const tree type = TREE_TYPE (t);
13 107223225 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
14 107223225 : if (TREE_SIDE_EFFECTS (t)) return false;
15 98256664 : switch (TREE_CODE (t))
16 : {
17 590084 : case TRUTH_NOT_EXPR:
18 590084 : {
19 590084 : tree _p0 = TREE_OPERAND (t, 0);
20 590084 : {
21 590084 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
22 590084 : {
23 590084 : res_ops[0] = captures[0];
24 590084 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 23, __FILE__, __LINE__, false);
25 : return true;
26 : }
27 : }
28 169269 : break;
29 : }
30 169269 : case BIT_NOT_EXPR:
31 169269 : {
32 169269 : tree _p0 = TREE_OPERAND (t, 0);
33 169269 : if (tree_truth_valued_p (_p0))
34 : {
35 12134 : {
36 12134 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
37 12134 : {
38 12134 : res_ops[0] = captures[0];
39 12134 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 24, __FILE__, __LINE__, false);
40 12134 : return true;
41 : }
42 : }
43 : }
44 : break;
45 : }
46 1395850 : case EQ_EXPR:
47 1395850 : {
48 1395850 : tree _p0 = TREE_OPERAND (t, 0);
49 1395850 : tree _p1 = TREE_OPERAND (t, 1);
50 1395850 : if (integer_zerop (_p1))
51 : {
52 549633 : {
53 549633 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
54 549633 : {
55 549633 : res_ops[0] = captures[0];
56 549633 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 25, __FILE__, __LINE__, false);
57 549633 : return true;
58 : }
59 : }
60 : }
61 : break;
62 : }
63 2139215 : case NE_EXPR:
64 2139215 : {
65 2139215 : tree _p0 = TREE_OPERAND (t, 0);
66 2139215 : tree _p1 = TREE_OPERAND (t, 1);
67 2139215 : if (tree_truth_valued_p (_p0))
68 : {
69 2715 : if (integer_truep (_p1))
70 : {
71 0 : {
72 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
73 0 : {
74 0 : res_ops[0] = captures[0];
75 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 26, __FILE__, __LINE__, false);
76 0 : return true;
77 : }
78 : }
79 : }
80 : }
81 : break;
82 : }
83 108235 : case BIT_XOR_EXPR:
84 108235 : {
85 108235 : tree _p0 = TREE_OPERAND (t, 0);
86 108235 : tree _p1 = TREE_OPERAND (t, 1);
87 108235 : if (tree_truth_valued_p (_p0))
88 : {
89 15504 : if (integer_truep (_p1))
90 : {
91 0 : {
92 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
93 0 : {
94 0 : res_ops[0] = captures[0];
95 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 27, __FILE__, __LINE__, false);
96 0 : return true;
97 : }
98 : }
99 : }
100 : }
101 : break;
102 : }
103 : default:;
104 : }
105 : return false;
106 : }
107 :
108 : tree
109 3 : generic_simplify_3 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
110 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
111 : const enum tree_code ARG_UNUSED (op))
112 : {
113 3 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
114 3 : if (INTEGRAL_TYPE_P (type)
115 : )
116 : {
117 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail74;
118 3 : {
119 3 : tree res_op0;
120 3 : {
121 3 : tree _o1[2], _r1;
122 3 : _o1[0] = captures[1];
123 3 : _o1[1] = captures[4];
124 3 : _r1 = fold_build2_loc (loc, op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
125 3 : res_op0 = _r1;
126 : }
127 3 : tree res_op1;
128 3 : res_op1 = captures[2];
129 3 : tree _r;
130 3 : _r = fold_build2_loc (loc, LSHIFT_EXPR, type, res_op0, res_op1);
131 3 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 51, __FILE__, __LINE__, true);
132 3 : return _r;
133 : }
134 0 : next_after_fail74:;
135 : }
136 : return NULL_TREE;
137 : }
138 :
139 : tree
140 90 : generic_simplify_11 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
141 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
142 : {
143 90 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
144 90 : {
145 90 : bool wascmp;
146 90 : if (bitwise_inverted_equal_p (captures[0], captures[2], wascmp)
147 90 : && (!wascmp || element_precision (type) == 1)
148 : )
149 : {
150 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail85;
151 0 : {
152 0 : tree _r;
153 0 : _r = captures[0];
154 0 : if (TREE_SIDE_EFFECTS (captures[1]))
155 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
156 0 : if (TREE_SIDE_EFFECTS (captures[2]))
157 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
158 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 60, __FILE__, __LINE__, true);
159 0 : return _r;
160 : }
161 0 : next_after_fail85:;
162 : }
163 : }
164 90 : return NULL_TREE;
165 : }
166 :
167 : tree
168 608 : generic_simplify_18 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
169 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
170 : {
171 608 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
172 608 : if (bitwise_equal_p (captures[0], captures[2])
173 : )
174 : {
175 88 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail92;
176 88 : {
177 88 : tree res_op0;
178 88 : {
179 88 : tree _o1[1], _r1;
180 88 : {
181 88 : tree _o2[2], _r2;
182 88 : _o2[0] = captures[0];
183 88 : {
184 88 : tree _o3[1], _r3;
185 88 : _o3[0] = captures[1];
186 88 : if (TREE_TYPE (_o3[0]) != TREE_TYPE (_o2[0]))
187 : {
188 8 : _r3 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (_o2[0]), _o3[0]);
189 : }
190 : else
191 : _r3 = _o3[0];
192 88 : _o2[1] = _r3;
193 : }
194 88 : _r2 = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
195 88 : _o1[0] = _r2;
196 : }
197 88 : _r1 = fold_build1_loc (loc, BIT_NOT_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
198 88 : res_op0 = _r1;
199 : }
200 88 : tree _r;
201 88 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
202 88 : if (TREE_SIDE_EFFECTS (captures[2]))
203 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
204 88 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 67, __FILE__, __LINE__, true);
205 88 : return _r;
206 : }
207 0 : next_after_fail92:;
208 : }
209 : return NULL_TREE;
210 : }
211 :
212 : tree
213 3365545 : generic_simplify_31 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
214 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
215 : const enum tree_code ARG_UNUSED (bitop))
216 : {
217 3365545 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
218 3365545 : if (((TREE_CODE (captures[3]) == INTEGER_CST
219 1051750 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
220 863539 : && (int_fits_type_p (captures[3], TREE_TYPE (captures[1]))
221 12583 : || tree_nop_conversion_p (TREE_TYPE (captures[1]), type)))
222 2512345 : || types_match (captures[1], captures[3]))
223 1285390 : && !POINTER_TYPE_P (TREE_TYPE (captures[1]))
224 1285390 : && !VECTOR_TYPE_P (TREE_TYPE (captures[1]))
225 1285161 : && TREE_CODE (TREE_TYPE (captures[1])) != OFFSET_TYPE
226 1285161 : && (bitop != BIT_AND_EXPR ||
227 :
228 : )
229 3365545 : && (
230 62908 : TYPE_PRECISION (TREE_TYPE (captures[1])) < TYPE_PRECISION (type)
231 : || (
232 :
233 : && TYPE_PRECISION (TREE_TYPE (captures[1])) == TYPE_PRECISION (type))
234 61786 : || GET_MODE_CLASS (TYPE_MODE (type)) != MODE_INT
235 61786 : || !type_has_mode_precision_p (type)
236 61786 : || (
237 :
238 : && TREE_CODE (captures[3]) != INTEGER_CST
239 : && tree_nop_conversion_p (type, TREE_TYPE (captures[1]))
240 : && single_use (captures[0])
241 : && single_use (captures[2])))
242 : )
243 : {
244 1125 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail105;
245 1125 : {
246 1125 : tree res_op0;
247 1125 : {
248 1125 : tree _o1[2], _r1;
249 1125 : _o1[0] = captures[1];
250 1125 : {
251 1125 : tree _o2[1], _r2;
252 1125 : _o2[0] = captures[3];
253 1125 : if (TREE_TYPE (_o2[0]) != TREE_TYPE (_o1[0]))
254 : {
255 1125 : _r2 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (_o1[0]), _o2[0]);
256 : }
257 : else
258 : _r2 = _o2[0];
259 1125 : _o1[1] = _r2;
260 : }
261 1125 : _r1 = fold_build2_loc (loc, bitop, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
262 1125 : res_op0 = _r1;
263 : }
264 1125 : tree _r;
265 1125 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
266 1125 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 79, __FILE__, __LINE__, true);
267 1125 : return _r;
268 : }
269 0 : next_after_fail105:;
270 : }
271 : return NULL_TREE;
272 : }
273 :
274 : tree
275 7 : generic_simplify_45 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
276 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
277 : const enum tree_code ARG_UNUSED (op))
278 : {
279 7 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
280 14 : if (INTEGRAL_TYPE_P (type)
281 7 : && tree_int_cst_sgn (captures[2]) > 0
282 7 : && tree_int_cst_sgn (captures[4]) > 0
283 28 : && (tree_nonzero_bits (captures[0]) & tree_nonzero_bits (captures[3])) == 0
284 : )
285 : {
286 4 : {
287 4 : tree t = type;
288 4 : if (!TYPE_OVERFLOW_WRAPS (t))
289 4 : t = unsigned_type_for (t);
290 4 : wide_int wone = wi::one (TYPE_PRECISION (t));
291 8 : wide_int c = wi::add (wi::lshift (wone, wi::to_wide (captures[2])),
292 8 : wi::lshift (wone, wi::to_wide (captures[4])));
293 4 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail122;
294 4 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail122;
295 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail122;
296 4 : {
297 4 : tree res_op0;
298 4 : {
299 4 : tree _o1[2], _r1;
300 4 : {
301 4 : tree _o2[1], _r2;
302 4 : _o2[0] = captures[1];
303 4 : if (TREE_TYPE (_o2[0]) != t)
304 : {
305 4 : _r2 = fold_build1_loc (loc, NOP_EXPR, t, _o2[0]);
306 : }
307 : else
308 : _r2 = _o2[0];
309 4 : _o1[0] = _r2;
310 : }
311 4 : _o1[1] = wide_int_to_tree (t,c);
312 4 : _r1 = fold_build2_loc (loc, MULT_EXPR, t, _o1[0], _o1[1]);
313 4 : res_op0 = _r1;
314 : }
315 4 : tree _r;
316 4 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
317 4 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 92, __FILE__, __LINE__, true);
318 4 : return _r;
319 : }
320 0 : next_after_fail122:;
321 4 : }
322 : }
323 : return NULL_TREE;
324 : }
325 :
326 : tree
327 311 : generic_simplify_54 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
328 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
329 : const enum tree_code ARG_UNUSED (outer_op),
330 : const enum tree_code ARG_UNUSED (inner_op))
331 : {
332 311 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
333 311 : if (real_zerop (captures[2])
334 34 : && real_zerop (captures[3])
335 345 : && !HONOR_SIGN_DEPENDENT_ROUNDING (type)
336 : )
337 : {
338 10 : {
339 10 : bool inner_plus = ((inner_op == PLUS_EXPR)
340 10 : ^ REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (captures[2])));
341 10 : bool outer_plus
342 10 : = ((outer_op == PLUS_EXPR)
343 10 : ^ REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (captures[3])));
344 10 : if (outer_plus && !inner_plus
345 : )
346 : {
347 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail133;
348 2 : {
349 2 : tree res_op0;
350 2 : res_op0 = captures[1];
351 2 : tree res_op1;
352 2 : res_op1 = captures[3];
353 2 : tree _r;
354 2 : _r = fold_build2_loc (loc, outer_op, type, res_op0, res_op1);
355 2 : if (TREE_SIDE_EFFECTS (captures[2]))
356 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
357 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 102, __FILE__, __LINE__, true);
358 2 : return _r;
359 : }
360 0 : next_after_fail133:;
361 : }
362 : else
363 : {
364 8 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail134;
365 8 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail134;
366 8 : {
367 8 : tree _r;
368 8 : _r = captures[0];
369 8 : if (TREE_SIDE_EFFECTS (captures[3]))
370 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[3]), _r);
371 8 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 103, __FILE__, __LINE__, true);
372 8 : return _r;
373 : }
374 : next_after_fail134:;
375 : }
376 : }
377 : }
378 : return NULL_TREE;
379 : }
380 :
381 : tree
382 2339740 : generic_simplify_70 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
383 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
384 : const enum tree_code ARG_UNUSED (plusminus))
385 : {
386 2339740 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
387 2339740 : if (!TYPE_SATURATING (type)
388 2339740 : && (!FLOAT_TYPE_P (type) || flag_associative_math)
389 : )
390 : {
391 110 : if (!ANY_INTEGRAL_TYPE_P (type)
392 2339516 : || TYPE_OVERFLOW_WRAPS (type)
393 4068326 : || (INTEGRAL_TYPE_P (type)
394 1728700 : && tree_expr_nonzero_p (captures[1])
395 3272957 : && expr_not_equal_to (captures[1], wi::minus_one (TYPE_PRECISION (type)),
396 : gimple_match_ctx (captures[0])))
397 : )
398 : {
399 1543953 : if (single_use (captures[0]) || single_use (captures[3])
400 : )
401 : {
402 1543953 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail158;
403 1543953 : {
404 1543953 : tree res_op0;
405 1543953 : {
406 1543953 : tree _o1[2], _r1;
407 1543953 : _o1[0] = captures[2];
408 1543953 : _o1[1] = captures[4];
409 1543953 : _r1 = fold_build2_loc (loc, plusminus, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
410 1543953 : res_op0 = _r1;
411 : }
412 1543953 : tree res_op1;
413 1543953 : res_op1 = captures[1];
414 1543953 : tree _r;
415 1543953 : _r = fold_build2_loc (loc, MULT_EXPR, type, res_op0, res_op1);
416 1543953 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 127, __FILE__, __LINE__, true);
417 1543953 : return _r;
418 : }
419 0 : next_after_fail158:;
420 : }
421 : else
422 : {
423 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail159;
424 : {
425 : tree res_op0;
426 : {
427 : tree _o1[2], _r1;
428 : _o1[0] = captures[2];
429 : _o1[1] = captures[4];
430 : _r1 = fold_build2_loc (loc, plusminus, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
431 : res_op0 = _r1;
432 : }
433 : tree res_op1;
434 : res_op1 = captures[1];
435 : tree _r;
436 : _r = fold_build2_loc (loc, MULT_EXPR, type, res_op0, res_op1);
437 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 128, __FILE__, __LINE__, true);
438 : return _r;
439 : }
440 : next_after_fail159:;
441 : }
442 : }
443 : }
444 : return NULL_TREE;
445 : }
446 :
447 : tree
448 117 : generic_simplify_81 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
449 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
450 : const combined_fn ARG_UNUSED (POPCOUNT))
451 : {
452 117 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
453 234 : if (INTEGRAL_TYPE_P (type)
454 585 : && (wi::bit_and (widest_int::from (tree_nonzero_bits (captures[1]), UNSIGNED),
455 468 : widest_int::from (tree_nonzero_bits (captures[3]), UNSIGNED))
456 351 : == 0)
457 : )
458 : {
459 1 : {
460 1 : tree utype = TREE_TYPE (captures[1]);
461 1 : if (TYPE_PRECISION (utype) < TYPE_PRECISION (TREE_TYPE (captures[3])))
462 0 : utype = TREE_TYPE (captures[3]);
463 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail171;
464 1 : {
465 1 : tree res_op0;
466 1 : {
467 1 : tree _o1[2], _r1;
468 1 : {
469 1 : tree _o2[1], _r2;
470 1 : _o2[0] = captures[1];
471 1 : if (TREE_TYPE (_o2[0]) != utype)
472 : {
473 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
474 : }
475 : else
476 : _r2 = _o2[0];
477 1 : _o1[0] = _r2;
478 : }
479 1 : {
480 1 : tree _o2[1], _r2;
481 1 : _o2[0] = captures[3];
482 1 : if (TREE_TYPE (_o2[0]) != utype)
483 : {
484 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
485 : }
486 : else
487 : _r2 = _o2[0];
488 1 : _o1[1] = _r2;
489 : }
490 1 : _r1 = fold_build2_loc (loc, BIT_IOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
491 1 : res_op0 = _r1;
492 : }
493 1 : tree _r;
494 1 : _r = maybe_build_call_expr_loc (loc, POPCOUNT, type, 1, res_op0);
495 1 : if (!_r)
496 0 : goto next_after_fail171;
497 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 140, __FILE__, __LINE__, true);
498 1 : return _r;
499 : }
500 : next_after_fail171:;
501 : }
502 : }
503 : return NULL_TREE;
504 : }
505 :
506 : tree
507 1 : generic_simplify_92 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
508 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
509 : {
510 1 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
511 1 : if (!TYPE_OVERFLOW_SANITIZED (type) && !TYPE_OVERFLOW_TRAPS (type)
512 1 : && !TYPE_SATURATING (type) && !TYPE_OVERFLOW_SANITIZED (TREE_TYPE (captures[0]))
513 1 : && !TYPE_OVERFLOW_TRAPS (TREE_TYPE (captures[0]))
514 2 : && !TYPE_SATURATING (TREE_TYPE (captures[0]))
515 : )
516 : {
517 1 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail182;
518 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail182;
519 1 : {
520 1 : tree res_op0;
521 1 : {
522 1 : tree _o1[1], _r1;
523 1 : {
524 1 : tree _o2[2], _r2;
525 1 : _o2[0] = captures[1];
526 1 : _o2[1] = captures[2];
527 1 : _r2 = fold_build2_loc (loc, BIT_XOR_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
528 1 : _o1[0] = _r2;
529 : }
530 1 : if (TREE_TYPE (_o1[0]) != type)
531 : {
532 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
533 : }
534 : else
535 : _r1 = _o1[0];
536 1 : res_op0 = _r1;
537 : }
538 1 : tree _r;
539 1 : _r = fold_build1_loc (loc, BIT_NOT_EXPR, type, res_op0);
540 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 151, __FILE__, __LINE__, true);
541 1 : return _r;
542 : }
543 : next_after_fail182:;
544 : }
545 : return NULL_TREE;
546 : }
547 :
548 : tree
549 12248 : generic_simplify_105 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
550 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
551 : {
552 12248 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
553 12248 : if (!TYPE_SATURATING (type)
554 : )
555 : {
556 12248 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
557 24496 : && !FIXED_POINT_TYPE_P (type)
558 : )
559 : {
560 12248 : if (element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
561 12248 : || (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
562 3016 : && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[1])))
563 : )
564 : {
565 12128 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail199;
566 12128 : {
567 12128 : tree res_op0;
568 12128 : res_op0 = captures[1];
569 12128 : tree _r;
570 12128 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
571 12128 : if (TREE_SIDE_EFFECTS (captures[2]))
572 15 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
573 12128 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 167, __FILE__, __LINE__, true);
574 12128 : return _r;
575 : }
576 0 : next_after_fail199:;
577 : }
578 : }
579 : }
580 : return NULL_TREE;
581 : }
582 :
583 : tree
584 2 : generic_simplify_110 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
585 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
586 : const combined_fn ARG_UNUSED (logs))
587 : {
588 2 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
589 2 : if (flag_unsafe_math_optimizations
590 : )
591 : {
592 2 : if (! HONOR_SIGN_DEPENDENT_ROUNDING (type)
593 2 : && ! HONOR_NANS (type) && ! HONOR_INFINITIES (type)
594 2 : && ! flag_trapping_math
595 4 : && ! flag_errno_math
596 : )
597 : {
598 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail206;
599 2 : {
600 2 : tree res_op0;
601 2 : {
602 2 : tree _o1[2], _r1;
603 2 : _o1[0] = captures[1];
604 2 : _o1[1] = captures[3];
605 2 : _r1 = fold_build2_loc (loc, RDIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
606 2 : res_op0 = _r1;
607 : }
608 2 : tree _r;
609 2 : _r = maybe_build_call_expr_loc (loc, logs, type, 1, res_op0);
610 2 : if (!_r)
611 0 : goto next_after_fail206;
612 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 174, __FILE__, __LINE__, true);
613 2 : return _r;
614 : }
615 : next_after_fail206:;
616 : }
617 : }
618 : return NULL_TREE;
619 : }
620 :
621 : tree
622 16 : generic_simplify_117 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
623 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
624 : {
625 16 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
626 16 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail215;
627 16 : {
628 16 : tree res_op0;
629 16 : res_op0 = captures[0];
630 16 : tree res_op1;
631 16 : res_op1 = captures[1];
632 16 : tree _r;
633 16 : _r = fold_build2_loc (loc, BIT_IOR_EXPR, type, res_op0, res_op1);
634 16 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 181, __FILE__, __LINE__, true);
635 : return _r;
636 : }
637 0 : next_after_fail215:;
638 0 : return NULL_TREE;
639 : }
640 :
641 : tree
642 16 : generic_simplify_122 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
643 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
644 : {
645 16 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
646 32 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
647 32 : && TYPE_PRECISION (TREE_TYPE (captures[0])) == 1
648 : )
649 : {
650 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail220;
651 0 : {
652 0 : tree res_op0;
653 0 : res_op0 = captures[0];
654 0 : tree res_op1;
655 0 : {
656 0 : tree _o1[2], _r1;
657 0 : _o1[0] = captures[1];
658 0 : _o1[1] = build_one_cst (type);
659 0 : _r1 = fold_build2_loc (loc, BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
660 0 : res_op1 = _r1;
661 : }
662 0 : tree _r;
663 0 : _r = fold_build2_loc (loc, BIT_IOR_EXPR, type, res_op0, res_op1);
664 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 185, __FILE__, __LINE__, true);
665 0 : return _r;
666 : }
667 0 : next_after_fail220:;
668 : }
669 : return NULL_TREE;
670 : }
671 :
672 : tree
673 1 : generic_simplify_134 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
674 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
675 : {
676 1 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
677 1 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail232;
678 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail232;
679 1 : {
680 1 : tree _r;
681 1 : _r = captures[0];
682 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 193, __FILE__, __LINE__, true);
683 : return _r;
684 : }
685 : next_after_fail232:;
686 : return NULL_TREE;
687 : }
688 :
689 : tree
690 0 : generic_simplify_143 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
691 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
692 : const enum tree_code ARG_UNUSED (op))
693 : {
694 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
695 0 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[3]))
696 0 : && tree_nop_conversion_p (type, TREE_TYPE (captures[6]))
697 : )
698 : {
699 0 : if (single_use (captures[4]) && single_use (captures[5])
700 : )
701 : {
702 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail244;
703 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail244;
704 0 : {
705 0 : tree res_op0;
706 0 : res_op0 = captures[0];
707 0 : tree res_op1;
708 0 : {
709 0 : tree _o1[1], _r1;
710 0 : _o1[0] = captures[6];
711 0 : if (TREE_TYPE (_o1[0]) != type)
712 : {
713 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
714 : }
715 : else
716 : _r1 = _o1[0];
717 0 : res_op1 = _r1;
718 : }
719 0 : tree _r;
720 0 : _r = fold_build2_loc (loc, op, type, res_op0, res_op1);
721 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 197, __FILE__, __LINE__, true);
722 0 : return _r;
723 : }
724 : next_after_fail244:;
725 : }
726 : else
727 : {
728 : if (single_use (captures[0]) && single_use (captures[1])
729 : )
730 : {
731 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail245;
732 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail245;
733 : {
734 : tree res_op0;
735 : {
736 : tree _o1[1], _r1;
737 : _o1[0] = captures[3];
738 : if (TREE_TYPE (_o1[0]) != type)
739 : {
740 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
741 : }
742 : else
743 : _r1 = _o1[0];
744 : res_op0 = _r1;
745 : }
746 : tree res_op1;
747 : res_op1 = captures[4];
748 : tree _r;
749 : _r = fold_build2_loc (loc, op, type, res_op0, res_op1);
750 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 198, __FILE__, __LINE__, true);
751 : return _r;
752 : }
753 : next_after_fail245:;
754 : }
755 : }
756 : }
757 : return NULL_TREE;
758 : }
759 :
760 : tree
761 4 : generic_simplify_158 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
762 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
763 : {
764 4 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
765 4 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail264;
766 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail264;
767 4 : {
768 4 : tree _r;
769 4 : _r = captures[2];
770 4 : if (TREE_SIDE_EFFECTS (captures[1]))
771 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
772 4 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 212, __FILE__, __LINE__, true);
773 : return _r;
774 : }
775 : next_after_fail264:;
776 : return NULL_TREE;
777 : }
778 :
779 : tree
780 426 : generic_simplify_161 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
781 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
782 : const enum tree_code ARG_UNUSED (code2),
783 : const enum tree_code ARG_UNUSED (code1))
784 : {
785 426 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
786 426 : if ((TREE_CODE (captures[2]) == INTEGER_CST
787 394 : && TREE_CODE (captures[5]) == INTEGER_CST)
788 426 : || ((INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
789 3 : || (VECTOR_TYPE_P (TREE_TYPE (captures[2])))
790 0 : || POINTER_TYPE_P (TREE_TYPE (captures[2])))
791 32 : && bitwise_equal_p (captures[2], captures[5]))
792 : )
793 : {
794 396 : {
795 396 : bool one_before = false;
796 396 : bool one_after = false;
797 396 : int cmp = 0;
798 396 : bool allbits = true;
799 396 : if (TREE_CODE (captures[2]) == INTEGER_CST
800 394 : && TREE_CODE (captures[5]) == INTEGER_CST)
801 : {
802 394 : allbits = TYPE_PRECISION (TREE_TYPE (captures[2])) <= TYPE_PRECISION (TREE_TYPE (captures[5]));
803 394 : auto t1 = wi::to_wide (fold_convert (TREE_TYPE (captures[5]), captures[2]));
804 394 : auto t2 = wi::to_wide (captures[5]);
805 394 : cmp = wi::cmp (t1, t2, TYPE_SIGN (TREE_TYPE (captures[5])));
806 394 : if (cmp < 0
807 394 : && t1 == t2 - 1)
808 : one_before = true;
809 394 : if (cmp > 0
810 394 : && t1 == t2 + 1)
811 : one_after = true;
812 : }
813 396 : bool val;
814 396 : switch (code2)
815 : {
816 380 : case EQ_EXPR: val = (cmp == 0); break;
817 0 : case NE_EXPR: val = (cmp != 0); break;
818 2 : case LT_EXPR: val = (cmp < 0); break;
819 0 : case GT_EXPR: val = (cmp > 0); break;
820 14 : case LE_EXPR: val = (cmp <= 0); break;
821 0 : case GE_EXPR: val = (cmp >= 0); break;
822 0 : default: gcc_unreachable ();
823 : }
824 396 : if (code1 == EQ_EXPR && val
825 : )
826 : {
827 7 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail273;
828 7 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail273;
829 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail273;
830 7 : {
831 7 : tree _r;
832 7 : _r = captures[3];
833 7 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 214, __FILE__, __LINE__, true);
834 7 : return _r;
835 : }
836 : next_after_fail273:;
837 : }
838 : else
839 : {
840 389 : if (code1 == NE_EXPR && val && allbits
841 : )
842 : {
843 7 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail274;
844 7 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail274;
845 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail274;
846 7 : {
847 7 : tree _r;
848 7 : _r = constant_boolean_node (true, type);
849 7 : if (TREE_SIDE_EFFECTS (captures[4]))
850 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[4]), _r);
851 7 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 215, __FILE__, __LINE__, true);
852 7 : return _r;
853 : }
854 : next_after_fail274:;
855 : }
856 : else
857 : {
858 382 : if (code1 == NE_EXPR && !val && allbits
859 : )
860 : {
861 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail275;
862 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail275;
863 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail275;
864 0 : {
865 0 : tree _r;
866 0 : _r = captures[0];
867 0 : if (TREE_SIDE_EFFECTS (captures[4]))
868 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[4]), _r);
869 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 216, __FILE__, __LINE__, true);
870 0 : return _r;
871 : }
872 : next_after_fail275:;
873 : }
874 : else
875 : {
876 382 : if (code1 == EQ_EXPR
877 382 : && code2 == GT_EXPR
878 0 : && cmp == 0
879 0 : && allbits
880 382 : && ((VECTOR_BOOLEAN_TYPE_P (type)
881 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, GE_EXPR))
882 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
883 : )
884 : {
885 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail276;
886 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail276;
887 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail276;
888 0 : {
889 0 : tree res_op0;
890 0 : res_op0 = captures[4];
891 0 : tree res_op1;
892 0 : res_op1 = captures[5];
893 0 : tree _r;
894 0 : _r = fold_build2_loc (loc, GE_EXPR, type, res_op0, res_op1);
895 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 217, __FILE__, __LINE__, true);
896 0 : return _r;
897 : }
898 : next_after_fail276:;
899 : }
900 : else
901 : {
902 382 : if (code1 == EQ_EXPR
903 382 : && code2 == LT_EXPR
904 2 : && cmp == 0
905 2 : && allbits
906 384 : && ((VECTOR_BOOLEAN_TYPE_P (type)
907 2 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, LE_EXPR))
908 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
909 : )
910 : {
911 2 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail277;
912 2 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail277;
913 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail277;
914 2 : {
915 2 : tree res_op0;
916 2 : res_op0 = captures[4];
917 2 : tree res_op1;
918 2 : res_op1 = captures[5];
919 2 : tree _r;
920 2 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
921 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 218, __FILE__, __LINE__, true);
922 2 : return _r;
923 : }
924 : next_after_fail277:;
925 : }
926 : else
927 : {
928 380 : if (code1 == EQ_EXPR
929 380 : && code2 == GE_EXPR
930 : && one_before
931 0 : && allbits
932 380 : && ((VECTOR_BOOLEAN_TYPE_P (type)
933 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, GE_EXPR))
934 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
935 : )
936 : {
937 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail278;
938 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail278;
939 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail278;
940 0 : {
941 0 : tree res_op0;
942 0 : res_op0 = captures[4];
943 0 : tree res_op1;
944 0 : {
945 0 : tree _o1[1], _r1;
946 0 : _o1[0] = captures[2];
947 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
948 : {
949 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
950 : }
951 : else
952 : _r1 = _o1[0];
953 0 : res_op1 = _r1;
954 : }
955 0 : tree _r;
956 0 : _r = fold_build2_loc (loc, GE_EXPR, type, res_op0, res_op1);
957 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 219, __FILE__, __LINE__, true);
958 0 : return _r;
959 : }
960 : next_after_fail278:;
961 : }
962 : else
963 : {
964 380 : if (code1 == EQ_EXPR
965 380 : && code2 == LE_EXPR
966 : && one_after
967 0 : && allbits
968 380 : && ((VECTOR_BOOLEAN_TYPE_P (type)
969 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, LE_EXPR))
970 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
971 : )
972 : {
973 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail279;
974 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail279;
975 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail279;
976 0 : {
977 0 : tree res_op0;
978 0 : res_op0 = captures[4];
979 0 : tree res_op1;
980 0 : {
981 0 : tree _o1[1], _r1;
982 0 : _o1[0] = captures[2];
983 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
984 : {
985 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
986 : }
987 : else
988 : _r1 = _o1[0];
989 0 : res_op1 = _r1;
990 : }
991 0 : tree _r;
992 0 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
993 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 220, __FILE__, __LINE__, true);
994 0 : return _r;
995 : }
996 : next_after_fail279:;
997 : }
998 : }
999 : }
1000 : }
1001 : }
1002 : }
1003 : }
1004 : }
1005 : }
1006 : return NULL_TREE;
1007 : }
1008 :
1009 : tree
1010 9 : generic_simplify_205 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1011 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1012 : const combined_fn ARG_UNUSED (LDEXP))
1013 : {
1014 9 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1015 9 : if (flag_unsafe_math_optimizations
1016 : )
1017 : {
1018 9 : if (real_equal (TREE_REAL_CST_PTR (captures[1]), &dconst1)
1019 : )
1020 : {
1021 9 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail347;
1022 9 : {
1023 9 : tree res_op0;
1024 9 : res_op0 = captures[0];
1025 9 : tree res_op1;
1026 9 : res_op1 = captures[2];
1027 9 : tree _r;
1028 9 : _r = maybe_build_call_expr_loc (loc, LDEXP, type, 2, res_op0, res_op1);
1029 9 : if (!_r)
1030 0 : goto next_after_fail347;
1031 9 : if (TREE_SIDE_EFFECTS (captures[1]))
1032 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1033 9 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 260, __FILE__, __LINE__, true);
1034 9 : return _r;
1035 : }
1036 : next_after_fail347:;
1037 : }
1038 : }
1039 : return NULL_TREE;
1040 : }
1041 :
1042 : tree
1043 12 : generic_simplify_213 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1044 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1045 : const enum tree_code ARG_UNUSED (cmp))
1046 : {
1047 12 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1048 12 : if (element_precision (captures[0]) >= element_precision (captures[1])
1049 12 : && types_match (captures[1], captures[3])
1050 : )
1051 : {
1052 12 : if (wi::lt_p (wi::to_wide (captures[2]), 0, TYPE_SIGN (TREE_TYPE (captures[2])))
1053 : )
1054 : {
1055 0 : if (!TYPE_UNSIGNED (TREE_TYPE (captures[0]))
1056 : )
1057 : {
1058 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail355;
1059 0 : {
1060 0 : tree res_op0;
1061 0 : res_op0 = captures[3];
1062 0 : tree res_op1;
1063 0 : res_op1 = captures[1];
1064 0 : tree _r;
1065 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1066 0 : if (TREE_SIDE_EFFECTS (captures[2]))
1067 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1068 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 268, __FILE__, __LINE__, true);
1069 0 : return _r;
1070 : }
1071 0 : next_after_fail355:;
1072 : }
1073 : else
1074 : {
1075 0 : if (tree_expr_nonzero_p (captures[1]) && tree_expr_nonzero_p (captures[3])
1076 : )
1077 : {
1078 0 : {
1079 0 : tree utype = unsigned_type_for (TREE_TYPE (captures[1]));
1080 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail356;
1081 0 : {
1082 0 : tree res_op0;
1083 0 : {
1084 0 : tree _o1[1], _r1;
1085 0 : _o1[0] = captures[3];
1086 0 : if (TREE_TYPE (_o1[0]) != utype)
1087 : {
1088 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, utype, _o1[0]);
1089 : }
1090 : else
1091 : _r1 = _o1[0];
1092 0 : res_op0 = _r1;
1093 : }
1094 0 : tree res_op1;
1095 0 : {
1096 0 : tree _o1[1], _r1;
1097 0 : _o1[0] = captures[1];
1098 0 : if (TREE_TYPE (_o1[0]) != utype)
1099 : {
1100 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, utype, _o1[0]);
1101 : }
1102 : else
1103 : _r1 = _o1[0];
1104 0 : res_op1 = _r1;
1105 : }
1106 0 : tree _r;
1107 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1108 0 : if (TREE_SIDE_EFFECTS (captures[2]))
1109 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1110 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 269, __FILE__, __LINE__, true);
1111 0 : return _r;
1112 : }
1113 0 : next_after_fail356:;
1114 : }
1115 : }
1116 : }
1117 : }
1118 : else
1119 : {
1120 12 : if (wi::gt_p (wi::to_wide (captures[2]), 1, TYPE_SIGN (TREE_TYPE (captures[2])))
1121 : )
1122 : {
1123 12 : if (TYPE_UNSIGNED (TREE_TYPE (captures[1])) || !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
1124 : )
1125 : {
1126 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail357;
1127 12 : {
1128 12 : tree res_op0;
1129 12 : res_op0 = captures[1];
1130 12 : tree res_op1;
1131 12 : res_op1 = captures[3];
1132 12 : tree _r;
1133 12 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1134 12 : if (TREE_SIDE_EFFECTS (captures[2]))
1135 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1136 12 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 270, __FILE__, __LINE__, true);
1137 12 : return _r;
1138 : }
1139 0 : next_after_fail357:;
1140 : }
1141 : else
1142 : {
1143 0 : {
1144 0 : tree utype = unsigned_type_for (TREE_TYPE (captures[1]));
1145 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail358;
1146 0 : {
1147 0 : tree res_op0;
1148 0 : {
1149 0 : tree _o1[1], _r1;
1150 0 : _o1[0] = captures[1];
1151 0 : if (TREE_TYPE (_o1[0]) != utype)
1152 : {
1153 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, utype, _o1[0]);
1154 : }
1155 : else
1156 : _r1 = _o1[0];
1157 0 : res_op0 = _r1;
1158 : }
1159 0 : tree res_op1;
1160 0 : {
1161 0 : tree _o1[1], _r1;
1162 0 : _o1[0] = captures[3];
1163 0 : if (TREE_TYPE (_o1[0]) != utype)
1164 : {
1165 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, utype, _o1[0]);
1166 : }
1167 : else
1168 : _r1 = _o1[0];
1169 0 : res_op1 = _r1;
1170 : }
1171 0 : tree _r;
1172 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1173 0 : if (TREE_SIDE_EFFECTS (captures[2]))
1174 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1175 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 271, __FILE__, __LINE__, true);
1176 0 : return _r;
1177 : }
1178 0 : next_after_fail358:;
1179 : }
1180 : }
1181 : }
1182 : }
1183 : }
1184 : return NULL_TREE;
1185 : }
1186 :
1187 : tree
1188 179 : generic_simplify_244 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1189 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1190 : const enum tree_code ARG_UNUSED (cmp))
1191 : {
1192 179 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1193 179 : {
1194 179 : int cand = wi::ctz (wi::to_wide (captures[2])) - wi::ctz (wi::to_wide (captures[0]));
1195 358 : if (cand < 0
1196 158 : || (!integer_zerop (captures[2])
1197 246 : && wi::lshift (wi::to_wide (captures[0]), cand) != wi::to_wide (captures[2]))
1198 337 : || !wi::fits_to_tree_p (wi::shwi (cand, HOST_BITS_PER_INT),
1199 144 : TREE_TYPE (captures[1]))
1200 : )
1201 : {
1202 35 : if (TREE_SIDE_EFFECTS (captures[0])) goto next_after_fail414;
1203 35 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail414;
1204 35 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail414;
1205 35 : {
1206 35 : tree _r;
1207 35 : _r = constant_boolean_node (cmp == NE_EXPR, type);
1208 35 : if (TREE_SIDE_EFFECTS (captures[1]))
1209 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1210 35 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 325, __FILE__, __LINE__, true);
1211 88 : return _r;
1212 : }
1213 91 : next_after_fail414:;
1214 : }
1215 : else
1216 : {
1217 144 : if (!integer_zerop (captures[2])
1218 144 : && wi::lshift (wi::to_wide (captures[0]), cand) == wi::to_wide (captures[2])
1219 : )
1220 : {
1221 53 : if (TREE_SIDE_EFFECTS (captures[0])) goto next_after_fail415;
1222 53 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail415;
1223 53 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail415;
1224 53 : {
1225 53 : tree res_op0;
1226 53 : res_op0 = captures[1];
1227 53 : tree res_op1;
1228 53 : res_op1 = build_int_cst (TREE_TYPE (captures[1]), cand);
1229 53 : tree _r;
1230 53 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1231 53 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 326, __FILE__, __LINE__, true);
1232 53 : return _r;
1233 : }
1234 91 : next_after_fail415:;
1235 : }
1236 : }
1237 : }
1238 91 : return NULL_TREE;
1239 : }
1240 :
1241 : tree
1242 93852 : generic_simplify_253 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1243 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1244 : const enum tree_code ARG_UNUSED (cmp))
1245 : {
1246 93852 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1247 93852 : if (single_use (captures[0])
1248 : )
1249 : {
1250 93852 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail425;
1251 93852 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail425;
1252 93852 : {
1253 93852 : tree res_op0;
1254 93852 : res_op0 = captures[1];
1255 93852 : tree res_op1;
1256 93852 : res_op1 = captures[2];
1257 93852 : tree _r;
1258 93852 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1259 93852 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 336, __FILE__, __LINE__, true);
1260 93852 : return _r;
1261 : }
1262 : next_after_fail425:;
1263 : }
1264 : return NULL_TREE;
1265 : }
1266 :
1267 : tree
1268 46380731 : generic_simplify_258 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1269 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1270 : const enum tree_code ARG_UNUSED (cmp))
1271 : {
1272 46380731 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1273 46380731 : {
1274 46380731 : bool wascmp;
1275 46380731 : if (types_match (TREE_TYPE (captures[0]), TREE_TYPE (captures[1]))
1276 46380731 : && bitwise_inverted_equal_p (captures[0], captures[1], wascmp)
1277 : )
1278 : {
1279 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail435;
1280 6 : {
1281 6 : tree _r;
1282 6 : _r = constant_boolean_node (cmp == NE_EXPR, type);
1283 6 : if (TREE_SIDE_EFFECTS (captures[0]))
1284 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
1285 6 : if (TREE_SIDE_EFFECTS (captures[1]))
1286 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1287 6 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 345, __FILE__, __LINE__, true);
1288 6 : return _r;
1289 : }
1290 0 : next_after_fail435:;
1291 : }
1292 : }
1293 46380725 : return NULL_TREE;
1294 : }
1295 :
1296 : tree
1297 8871 : generic_simplify_263 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1298 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1299 : const enum tree_code ARG_UNUSED (op),
1300 : const enum tree_code ARG_UNUSED (cmp))
1301 : {
1302 8871 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1303 8871 : if (flag_unsafe_math_optimizations
1304 : )
1305 : {
1306 5 : {
1307 8 : tree tem = const_binop (op == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR,
1308 5 : TREE_TYPE (captures[1]), captures[2], captures[1]);
1309 5 : if (tem && !TREE_OVERFLOW (tem)
1310 : )
1311 : {
1312 4 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail454;
1313 4 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail454;
1314 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail454;
1315 4 : {
1316 4 : tree res_op0;
1317 4 : res_op0 = captures[0];
1318 4 : tree res_op1;
1319 4 : res_op1 = tem;
1320 4 : tree _r;
1321 4 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1322 4 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 363, __FILE__, __LINE__, true);
1323 4 : return _r;
1324 : }
1325 : next_after_fail454:;
1326 : }
1327 : }
1328 : }
1329 : return NULL_TREE;
1330 : }
1331 :
1332 : tree
1333 59 : generic_simplify_270 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1334 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1335 : const enum tree_code ARG_UNUSED (cmp),
1336 : const enum tree_code ARG_UNUSED (scmp))
1337 : {
1338 59 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1339 96 : if (FLOAT_TYPE_P (TREE_TYPE (captures[0]))
1340 96 : || (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
1341 37 : && (cmp == EQ_EXPR
1342 37 : || cmp == NE_EXPR
1343 36 : || TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))))
1344 : )
1345 : {
1346 23 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail488;
1347 23 : {
1348 23 : tree res_op0;
1349 23 : res_op0 = captures[0];
1350 23 : tree res_op1;
1351 23 : res_op1 = captures[1];
1352 23 : tree _r;
1353 23 : _r = fold_build2_loc (loc, scmp, type, res_op0, res_op1);
1354 23 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 397, __FILE__, __LINE__, true);
1355 23 : return _r;
1356 : }
1357 0 : next_after_fail488:;
1358 : }
1359 : return NULL_TREE;
1360 : }
1361 :
1362 : tree
1363 19698261 : generic_simplify_273 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1364 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1365 : const enum tree_code ARG_UNUSED (cmp))
1366 : {
1367 19698261 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1368 39107271 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
1369 11929519 : && !(targetm.have_canonicalize_funcptr_for_compare ()
1370 0 : && ((POINTER_TYPE_P (TREE_TYPE (captures[1]))
1371 0 : && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (captures[1]))))
1372 0 : || (POINTER_TYPE_P (TREE_TYPE (captures[3]))
1373 0 : && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (captures[3]))))))
1374 19698261 : && single_use (captures[0])
1375 : )
1376 : {
1377 11929519 : if (TYPE_PRECISION (TREE_TYPE (captures[1])) == TYPE_PRECISION (TREE_TYPE (captures[0]))
1378 5181928 : && (TREE_CODE (captures[3]) == INTEGER_CST
1379 1933106 : || captures[2] != captures[3])
1380 3248822 : && (TYPE_UNSIGNED (TREE_TYPE (captures[1])) == TYPE_UNSIGNED (TREE_TYPE (captures[0]))
1381 : || cmp == NE_EXPR
1382 1484607 : || cmp == EQ_EXPR)
1383 2226387 : && !POINTER_TYPE_P (TREE_TYPE (captures[1]))
1384 14116069 : && (TREE_CODE (TREE_TYPE (captures[1])) != BOOLEAN_TYPE
1385 1655 : || TREE_CODE (TREE_TYPE (captures[3])) == BOOLEAN_TYPE)
1386 : )
1387 : {
1388 2186522 : if (TREE_CODE (captures[2]) == INTEGER_CST
1389 : )
1390 : {
1391 2186522 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail498;
1392 2186522 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail498;
1393 2186522 : {
1394 2186522 : tree res_op0;
1395 2186522 : res_op0 = captures[1];
1396 2186522 : tree res_op1;
1397 2186522 : res_op1 = force_fit_type (TREE_TYPE (captures[1]),
1398 2186522 : wide_int::from (wi::to_wide (captures[2]),
1399 2186522 : MAX (TYPE_PRECISION (TREE_TYPE (captures[2])),
1400 : TYPE_PRECISION (TREE_TYPE (captures[1]))),
1401 2186522 : TYPE_SIGN (TREE_TYPE (captures[2]))),
1402 2186522 : 0, TREE_OVERFLOW (captures[2]));
1403 2186522 : tree _r;
1404 2186522 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1405 2186522 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 399, __FILE__, __LINE__, true);
1406 2186522 : return _r;
1407 : }
1408 : next_after_fail498:;
1409 : }
1410 : else
1411 : {
1412 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail499;
1413 0 : {
1414 0 : tree res_op0;
1415 0 : res_op0 = captures[1];
1416 0 : tree res_op1;
1417 0 : {
1418 0 : tree _o1[1], _r1;
1419 0 : _o1[0] = captures[2];
1420 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
1421 : {
1422 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
1423 : }
1424 : else
1425 : _r1 = _o1[0];
1426 0 : res_op1 = _r1;
1427 : }
1428 0 : tree _r;
1429 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1430 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 400, __FILE__, __LINE__, true);
1431 0 : return _r;
1432 : }
1433 0 : next_after_fail499:;
1434 : }
1435 : }
1436 : else
1437 : {
1438 9742997 : if (TYPE_PRECISION (TREE_TYPE (captures[0])) > TYPE_PRECISION (TREE_TYPE (captures[1]))
1439 : )
1440 : {
1441 5782179 : if ((cmp == EQ_EXPR || cmp == NE_EXPR
1442 2953689 : || TYPE_UNSIGNED (TREE_TYPE (captures[0])) == TYPE_UNSIGNED (TREE_TYPE (captures[1]))
1443 402956 : || (!TYPE_UNSIGNED (TREE_TYPE (captures[0]))
1444 318445 : && TYPE_UNSIGNED (TREE_TYPE (captures[1]))))
1445 8651357 : && (types_match (TREE_TYPE (captures[3]), TREE_TYPE (captures[1]))
1446 5697650 : || ((TYPE_PRECISION (TREE_TYPE (captures[1]))
1447 5697650 : >= TYPE_PRECISION (TREE_TYPE (captures[3])))
1448 0 : && (TYPE_UNSIGNED (TREE_TYPE (captures[1]))
1449 0 : == TYPE_UNSIGNED (TREE_TYPE (captures[3]))))
1450 5697650 : || (TREE_CODE (captures[2]) == INTEGER_CST
1451 4594428 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
1452 4594428 : && int_fits_type_p (captures[2], TREE_TYPE (captures[1]))))
1453 : )
1454 : {
1455 4560366 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail500;
1456 4560366 : {
1457 4560366 : tree res_op0;
1458 4560366 : res_op0 = captures[1];
1459 4560366 : tree res_op1;
1460 4560366 : {
1461 4560366 : tree _o1[1], _r1;
1462 4560366 : _o1[0] = captures[3];
1463 4560366 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
1464 : {
1465 4560348 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
1466 : }
1467 : else
1468 : _r1 = _o1[0];
1469 4560366 : res_op1 = _r1;
1470 : }
1471 4560366 : tree _r;
1472 4560366 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1473 4560366 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 401, __FILE__, __LINE__, true);
1474 4560366 : return _r;
1475 : }
1476 0 : next_after_fail500:;
1477 : }
1478 : else
1479 : {
1480 1221813 : if (TREE_CODE (captures[2]) == INTEGER_CST
1481 82905 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
1482 1304718 : && !int_fits_type_p (captures[2], TREE_TYPE (captures[1]))
1483 : )
1484 : {
1485 37370 : {
1486 37370 : tree min = lower_bound_in_type (TREE_TYPE (captures[3]), TREE_TYPE (captures[1]));
1487 37370 : tree max = upper_bound_in_type (TREE_TYPE (captures[3]), TREE_TYPE (captures[1]));
1488 37370 : bool above = integer_nonzerop (const_binop (LT_EXPR, type, max, captures[2]));
1489 37370 : bool below = integer_nonzerop (const_binop (LT_EXPR, type, captures[2], min));
1490 37370 : if (above || below
1491 : )
1492 : {
1493 31444 : if (cmp == EQ_EXPR || cmp == NE_EXPR
1494 : )
1495 : {
1496 26660 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail501;
1497 26660 : {
1498 26660 : tree _r;
1499 26660 : _r = constant_boolean_node (cmp != EQ_EXPR, type);
1500 26660 : if (TREE_SIDE_EFFECTS (captures[1]))
1501 10 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1502 26660 : if (TREE_SIDE_EFFECTS (captures[2]))
1503 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1504 26660 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 402, __FILE__, __LINE__, true);
1505 26660 : return _r;
1506 : }
1507 0 : next_after_fail501:;
1508 : }
1509 : else
1510 : {
1511 4784 : if (cmp == LT_EXPR || cmp == LE_EXPR
1512 : )
1513 : {
1514 4241 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail502;
1515 4241 : {
1516 4241 : tree _r;
1517 4241 : _r = constant_boolean_node (above, type);
1518 4241 : if (TREE_SIDE_EFFECTS (captures[1]))
1519 10 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1520 4241 : if (TREE_SIDE_EFFECTS (captures[2]))
1521 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1522 4241 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 403, __FILE__, __LINE__, true);
1523 4241 : return _r;
1524 : }
1525 0 : next_after_fail502:;
1526 : }
1527 : else
1528 : {
1529 543 : if (cmp == GT_EXPR || cmp == GE_EXPR
1530 : )
1531 : {
1532 543 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail503;
1533 543 : {
1534 543 : tree _r;
1535 543 : _r = constant_boolean_node (!above, type);
1536 543 : if (TREE_SIDE_EFFECTS (captures[1]))
1537 4 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1538 543 : if (TREE_SIDE_EFFECTS (captures[2]))
1539 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1540 543 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 404, __FILE__, __LINE__, true);
1541 543 : return _r;
1542 : }
1543 0 : next_after_fail503:;
1544 : }
1545 : }
1546 : }
1547 : }
1548 : }
1549 : }
1550 : }
1551 : }
1552 : else
1553 : {
1554 7918841 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
1555 3727310 : && (TYPE_PRECISION (TREE_TYPE (captures[0]))
1556 3727310 : < TYPE_PRECISION (TREE_TYPE (captures[1])))
1557 965326 : && (cmp == EQ_EXPR || cmp == NE_EXPR)
1558 4601951 : && types_match (TREE_TYPE (captures[1]),
1559 641133 : TREE_TYPE (captures[3]))
1560 : )
1561 : {
1562 0 : {
1563 0 : tree itype = TREE_TYPE (captures[0]);
1564 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail504;
1565 0 : {
1566 0 : tree res_op0;
1567 0 : {
1568 0 : tree _o1[1], _r1;
1569 0 : {
1570 0 : tree _o2[2], _r2;
1571 0 : _o2[0] = captures[1];
1572 0 : _o2[1] = captures[3];
1573 0 : _r2 = fold_build2_loc (loc, BIT_XOR_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
1574 0 : _o1[0] = _r2;
1575 : }
1576 0 : if (TREE_TYPE (_o1[0]) != itype)
1577 : {
1578 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, itype, _o1[0]);
1579 : }
1580 : else
1581 : _r1 = _o1[0];
1582 0 : res_op0 = _r1;
1583 : }
1584 0 : tree res_op1;
1585 0 : res_op1 = build_zero_cst (itype);
1586 0 : tree _r;
1587 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1588 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 405, __FILE__, __LINE__, true);
1589 0 : return _r;
1590 : }
1591 0 : next_after_fail504:;
1592 : }
1593 : }
1594 : }
1595 : }
1596 : }
1597 : else
1598 : {
1599 14985812 : if (FLOAT_TYPE_P (TREE_TYPE (captures[1]))
1600 1130420 : && (DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[0]))
1601 565210 : == DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[1])))
1602 8898924 : && (DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[0]))
1603 565091 : == DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[3])))
1604 : )
1605 : {
1606 565091 : {
1607 565091 : tree type1 = TREE_TYPE (captures[3]);
1608 565091 : if (TREE_CODE (captures[3]) == REAL_CST && !DECIMAL_FLOAT_TYPE_P (type1))
1609 : {
1610 357993 : REAL_VALUE_TYPE orig = TREE_REAL_CST (captures[3]);
1611 357993 : if (TYPE_PRECISION (type1) > TYPE_PRECISION (float_type_node)
1612 357993 : && exact_real_truncate (TYPE_MODE (float_type_node), &orig))
1613 181440 : type1 = float_type_node;
1614 357993 : if (TYPE_PRECISION (type1) > TYPE_PRECISION (double_type_node)
1615 357993 : && exact_real_truncate (TYPE_MODE (double_type_node), &orig))
1616 292 : type1 = double_type_node;
1617 : }
1618 565091 : tree newtype
1619 565091 : = (element_precision (TREE_TYPE (captures[1])) > element_precision (type1)
1620 565091 : ? TREE_TYPE (captures[1]) : type1);
1621 565091 : if (element_precision (TREE_TYPE (captures[0])) > element_precision (newtype)
1622 565091 : && (!VECTOR_TYPE_P (type) || is_truth_type_for (newtype, type))
1623 : )
1624 : {
1625 44742 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail505;
1626 44742 : {
1627 44742 : tree res_op0;
1628 44742 : {
1629 44742 : tree _o1[1], _r1;
1630 44742 : _o1[0] = captures[1];
1631 44742 : if (TREE_TYPE (_o1[0]) != newtype)
1632 : {
1633 11488 : _r1 = fold_build1_loc (loc, NOP_EXPR, newtype, _o1[0]);
1634 : }
1635 : else
1636 : _r1 = _o1[0];
1637 44742 : res_op0 = _r1;
1638 : }
1639 44742 : tree res_op1;
1640 44742 : {
1641 44742 : tree _o1[1], _r1;
1642 44742 : _o1[0] = captures[3];
1643 44742 : if (TREE_TYPE (_o1[0]) != newtype)
1644 : {
1645 44742 : _r1 = fold_build1_loc (loc, NOP_EXPR, newtype, _o1[0]);
1646 : }
1647 : else
1648 : _r1 = _o1[0];
1649 44742 : res_op1 = _r1;
1650 : }
1651 44742 : tree _r;
1652 44742 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1653 44742 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 406, __FILE__, __LINE__, true);
1654 44742 : return _r;
1655 : }
1656 0 : next_after_fail505:;
1657 : }
1658 : }
1659 : }
1660 : }
1661 : return NULL_TREE;
1662 : }
1663 :
1664 : tree
1665 0 : generic_simplify_305 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1666 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1667 : const enum tree_code ARG_UNUSED (cmp))
1668 : {
1669 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1670 0 : if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (captures[0])))
1671 0 : && can_compare_p (cmp == EQ_EXPR ? EQ : NE, TYPE_MODE (TREE_TYPE (captures[0])),
1672 : ccp_jump)
1673 : )
1674 : {
1675 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail573;
1676 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail573;
1677 0 : {
1678 0 : tree res_op0;
1679 0 : res_op0 = captures[0];
1680 0 : tree res_op1;
1681 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
1682 0 : tree _r;
1683 0 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
1684 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 464, __FILE__, __LINE__, true);
1685 0 : return _r;
1686 : }
1687 : next_after_fail573:;
1688 : }
1689 : return NULL_TREE;
1690 : }
1691 :
1692 : tree
1693 0 : generic_simplify_310 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1694 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1695 : const combined_fn ARG_UNUSED (copysigns))
1696 : {
1697 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1698 0 : if (!REAL_VALUE_NEGATIVE (TREE_REAL_CST (captures[1]))
1699 : )
1700 : {
1701 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail579;
1702 0 : {
1703 0 : tree res_op0;
1704 0 : res_op0 = captures[0];
1705 0 : tree _r;
1706 0 : _r = fold_build1_loc (loc, ABS_EXPR, type, res_op0);
1707 0 : if (TREE_SIDE_EFFECTS (captures[1]))
1708 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
1709 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 470, __FILE__, __LINE__, true);
1710 0 : return _r;
1711 : }
1712 0 : next_after_fail579:;
1713 : }
1714 : return NULL_TREE;
1715 : }
1716 :
1717 : tree
1718 23 : generic_simplify_316 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1719 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1720 : const enum tree_code ARG_UNUSED (div))
1721 : {
1722 23 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1723 30 : if ((TYPE_UNSIGNED (type) || tree_expr_nonnegative_p (captures[0]))
1724 16 : && (!VECTOR_TYPE_P (type)
1725 0 : || target_supports_op_p (type, RSHIFT_EXPR, optab_vector)
1726 0 : || target_supports_op_p (type, RSHIFT_EXPR, optab_scalar))
1727 39 : && (useless_type_conversion_p (type, TREE_TYPE (captures[2]))
1728 7 : || (element_precision (type) >= element_precision (TREE_TYPE (captures[2]))
1729 7 : && (TYPE_UNSIGNED (TREE_TYPE (captures[2]))
1730 14 : || (element_precision (type)
1731 7 : == element_precision (TREE_TYPE (captures[2])))
1732 7 : || (INTEGRAL_TYPE_P (type)
1733 14 : && (tree_nonzero_bits (captures[0])
1734 44 : & wi::mask (element_precision (TREE_TYPE (captures[2])) - 1,
1735 : true,
1736 37 : element_precision (type))) == 0))))
1737 : )
1738 : {
1739 9 : if (!VECTOR_TYPE_P (type)
1740 9 : && useless_type_conversion_p (TREE_TYPE (captures[1]), TREE_TYPE (captures[2]))
1741 18 : && element_precision (TREE_TYPE (captures[1])) < element_precision (type)
1742 : )
1743 : {
1744 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail586;
1745 0 : {
1746 0 : tree res_op0;
1747 0 : {
1748 0 : tree _o1[2], _r1;
1749 0 : _o1[0] = captures[1];
1750 0 : _o1[1] = captures[3];
1751 0 : _r1 = fold_build2_loc (loc, RSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
1752 0 : res_op0 = _r1;
1753 : }
1754 0 : tree _r;
1755 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
1756 0 : if (TREE_SIDE_EFFECTS (captures[2]))
1757 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1758 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 475, __FILE__, __LINE__, true);
1759 0 : return _r;
1760 : }
1761 0 : next_after_fail586:;
1762 : }
1763 : else
1764 : {
1765 9 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail587;
1766 9 : {
1767 9 : tree res_op0;
1768 9 : res_op0 = captures[0];
1769 9 : tree res_op1;
1770 9 : res_op1 = captures[3];
1771 9 : tree _r;
1772 9 : _r = fold_build2_loc (loc, RSHIFT_EXPR, type, res_op0, res_op1);
1773 9 : if (TREE_SIDE_EFFECTS (captures[2]))
1774 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
1775 9 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 476, __FILE__, __LINE__, true);
1776 9 : return _r;
1777 : }
1778 0 : next_after_fail587:;
1779 : }
1780 : }
1781 : return NULL_TREE;
1782 : }
1783 :
1784 : tree
1785 230 : generic_simplify_332 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1786 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1787 : const enum tree_code ARG_UNUSED (mod))
1788 : {
1789 230 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1790 230 : if (!integer_zerop (captures[0])
1791 : )
1792 : {
1793 93 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail604;
1794 93 : {
1795 93 : tree _r;
1796 93 : _r = build_zero_cst (type);
1797 93 : if (TREE_SIDE_EFFECTS (captures[0]))
1798 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
1799 93 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 493, __FILE__, __LINE__, true);
1800 93 : return _r;
1801 : }
1802 0 : next_after_fail604:;
1803 : }
1804 : return NULL_TREE;
1805 : }
1806 :
1807 : tree
1808 6 : generic_simplify_343 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1809 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1810 : const combined_fn ARG_UNUSED (COS),
1811 : const combined_fn ARG_UNUSED (SIN),
1812 : const combined_fn ARG_UNUSED (TAN))
1813 : {
1814 6 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1815 6 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
1816 : )
1817 : {
1818 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail617;
1819 6 : {
1820 6 : tree res_op0;
1821 6 : res_op0 = build_one_cst (type);
1822 6 : tree res_op1;
1823 6 : {
1824 6 : tree _o1[1], _r1;
1825 6 : _o1[0] = captures[1];
1826 6 : _r1 = maybe_build_call_expr_loc (loc, TAN, TREE_TYPE (_o1[0]), 1, _o1[0]);
1827 6 : if (!_r1)
1828 0 : goto next_after_fail617;
1829 6 : res_op1 = _r1;
1830 : }
1831 6 : tree _r;
1832 6 : _r = fold_build2_loc (loc, RDIV_EXPR, type, res_op0, res_op1);
1833 6 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 506, __FILE__, __LINE__, true);
1834 6 : return _r;
1835 : }
1836 : next_after_fail617:;
1837 : }
1838 : return NULL_TREE;
1839 : }
1840 :
1841 : tree
1842 39 : generic_simplify_351 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1843 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures),
1844 : const enum tree_code ARG_UNUSED (cmp),
1845 : const enum tree_code ARG_UNUSED (minmax))
1846 : {
1847 39 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1848 39 : {
1849 39 : tree_code code = minmax_from_comparison (cmp, captures[0], captures[1], captures[0], captures[4]);
1850 39 : if ((cmp == LT_EXPR || cmp == LE_EXPR)
1851 15 : && code == MIN_EXPR
1852 43 : && integer_nonzerop (fold_build2 (LE_EXPR, boolean_type_node, captures[3], captures[4]))
1853 : )
1854 : {
1855 4 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail629;
1856 4 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail629;
1857 4 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail629;
1858 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail629;
1859 4 : {
1860 4 : tree res_op0;
1861 4 : res_op0 = captures[2];
1862 4 : tree res_op1;
1863 4 : res_op1 = captures[4];
1864 4 : tree _r;
1865 4 : _r = fold_build2_loc (loc, MIN_EXPR, type, res_op0, res_op1);
1866 4 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 518, __FILE__, __LINE__, true);
1867 4 : return _r;
1868 : }
1869 : next_after_fail629:;
1870 : }
1871 : else
1872 : {
1873 35 : if ((cmp == GT_EXPR || cmp == GE_EXPR)
1874 24 : && code == MAX_EXPR
1875 59 : && integer_nonzerop (fold_build2 (GE_EXPR, boolean_type_node, captures[3], captures[4]))
1876 : )
1877 : {
1878 10 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail630;
1879 10 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail630;
1880 10 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail630;
1881 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail630;
1882 10 : {
1883 10 : tree res_op0;
1884 10 : res_op0 = captures[2];
1885 10 : tree res_op1;
1886 10 : res_op1 = captures[4];
1887 10 : tree _r;
1888 10 : _r = fold_build2_loc (loc, MAX_EXPR, type, res_op0, res_op1);
1889 10 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 519, __FILE__, __LINE__, true);
1890 10 : return _r;
1891 : }
1892 : next_after_fail630:;
1893 : }
1894 : }
1895 : }
1896 : return NULL_TREE;
1897 : }
1898 :
1899 : tree
1900 58 : generic_simplify_364 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1901 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures),
1902 : const enum tree_code ARG_UNUSED (op))
1903 : {
1904 58 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1905 58 : if (bitwise_equal_p (captures[0], captures[2])
1906 8 : && tree_expr_nonzero_p (captures[3])
1907 66 : && expr_no_side_effects_p (captures[3])
1908 : )
1909 : {
1910 1 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail644;
1911 1 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail644;
1912 1 : if (TREE_SIDE_EFFECTS (_p2)) goto next_after_fail644;
1913 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail644;
1914 1 : {
1915 1 : tree _r;
1916 1 : _r = captures[1];
1917 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 533, __FILE__, __LINE__, true);
1918 1 : return _r;
1919 : }
1920 : next_after_fail644:;
1921 : }
1922 : return NULL_TREE;
1923 : }
1924 :
1925 : tree
1926 6 : generic_simplify_371 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1927 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures),
1928 : const enum tree_code ARG_UNUSED (neeq),
1929 : const combined_fn ARG_UNUSED (sign))
1930 : {
1931 6 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1932 6 : if (neeq == NE_EXPR
1933 : )
1934 : {
1935 3 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail651;
1936 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail651;
1937 3 : {
1938 3 : tree res_op0;
1939 3 : res_op0 = captures[0];
1940 3 : tree _r;
1941 3 : _r = fold_build1_loc (loc, ABS_EXPR, type, res_op0);
1942 3 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 540, __FILE__, __LINE__, true);
1943 3 : return _r;
1944 : }
1945 : next_after_fail651:;
1946 : }
1947 : else
1948 : {
1949 3 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail652;
1950 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail652;
1951 3 : {
1952 3 : tree res_op0;
1953 3 : {
1954 3 : tree _o1[1], _r1;
1955 3 : _o1[0] = captures[0];
1956 3 : _r1 = fold_build1_loc (loc, ABS_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
1957 3 : res_op0 = _r1;
1958 : }
1959 3 : tree _r;
1960 3 : _r = fold_build1_loc (loc, NEGATE_EXPR, type, res_op0);
1961 3 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 541, __FILE__, __LINE__, true);
1962 3 : return _r;
1963 : }
1964 : next_after_fail652:;
1965 : }
1966 : return NULL_TREE;
1967 : }
1968 :
1969 : tree
1970 83746 : generic_simplify_384 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
1971 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
1972 : const enum tree_code ARG_UNUSED (op))
1973 : {
1974 83746 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1975 167492 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
1976 83746 : && TYPE_UNSIGNED (TREE_TYPE (captures[1]))
1977 167492 : && wi::only_sign_bit_p (wi::to_wide (captures[1]))
1978 : )
1979 : {
1980 5 : {
1981 5 : tree stype = signed_type_for (TREE_TYPE (captures[1]));
1982 5 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail669;
1983 5 : {
1984 5 : tree res_op0;
1985 5 : {
1986 5 : tree _o1[1], _r1;
1987 5 : _o1[0] = captures[0];
1988 5 : if (TREE_TYPE (_o1[0]) != stype)
1989 : {
1990 5 : _r1 = fold_build1_loc (loc, NOP_EXPR, stype, _o1[0]);
1991 : }
1992 : else
1993 : _r1 = _o1[0];
1994 5 : res_op0 = _r1;
1995 : }
1996 5 : tree res_op1;
1997 5 : {
1998 5 : tree _o1[1], _r1;
1999 5 : _o1[0] = captures[2];
2000 5 : if (TREE_TYPE (_o1[0]) != stype)
2001 : {
2002 5 : _r1 = fold_build1_loc (loc, NOP_EXPR, stype, _o1[0]);
2003 : }
2004 : else
2005 : _r1 = _o1[0];
2006 5 : res_op1 = _r1;
2007 : }
2008 5 : tree _r;
2009 5 : _r = fold_build2_loc (loc, op, type, res_op0, res_op1);
2010 5 : if (TREE_SIDE_EFFECTS (captures[1]))
2011 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
2012 5 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 556, __FILE__, __LINE__, true);
2013 5 : return _r;
2014 : }
2015 0 : next_after_fail669:;
2016 : }
2017 : }
2018 : return NULL_TREE;
2019 : }
2020 :
2021 : tree
2022 10 : generic_simplify_393 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2023 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2024 : const enum tree_code ARG_UNUSED (cmp),
2025 : const enum tree_code ARG_UNUSED (op))
2026 : {
2027 10 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2028 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail679;
2029 10 : {
2030 10 : tree res_op0;
2031 10 : res_op0 = captures[0];
2032 10 : tree res_op1;
2033 10 : res_op1 = captures[2];
2034 10 : tree _r;
2035 10 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
2036 10 : if (TREE_SIDE_EFFECTS (captures[1]))
2037 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
2038 10 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 566, __FILE__, __LINE__, true);
2039 : return _r;
2040 : }
2041 0 : next_after_fail679:;
2042 0 : return NULL_TREE;
2043 : }
2044 :
2045 : tree
2046 9026 : generic_simplify_402 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2047 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2048 : const enum tree_code ARG_UNUSED (cmp))
2049 : {
2050 9026 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2051 9026 : if (single_use (captures[0])
2052 9026 : && ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
2053 9010 : && TYPE_UNSIGNED (TREE_TYPE (captures[1]))
2054 : )
2055 : {
2056 6632 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail720;
2057 6632 : {
2058 6632 : tree res_op0;
2059 6632 : res_op0 = captures[2];
2060 6632 : tree res_op1;
2061 6632 : res_op1 = captures[1];
2062 6632 : tree _r;
2063 6632 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
2064 6632 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 590, __FILE__, __LINE__, true);
2065 6632 : return _r;
2066 : }
2067 0 : next_after_fail720:;
2068 : }
2069 : return NULL_TREE;
2070 : }
2071 :
2072 : tree
2073 1554 : generic_simplify_407 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2074 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2075 : const enum tree_code ARG_UNUSED (cmp),
2076 : const enum tree_code ARG_UNUSED (neg_cmp))
2077 : {
2078 1554 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2079 1554 : if (flag_unsafe_math_optimizations
2080 : )
2081 : {
2082 9 : {
2083 9 : tree tem = const_binop (RDIV_EXPR, type, captures[2], captures[1]);
2084 9 : if (tem
2085 27 : && !(REAL_VALUE_ISINF (TREE_REAL_CST (tem))
2086 15 : || (real_zerop (tem) && !real_zerop (captures[1])))
2087 : )
2088 : {
2089 3 : if (real_less (&dconst0, TREE_REAL_CST_PTR (captures[1]))
2090 : )
2091 : {
2092 2 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail725;
2093 2 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail725;
2094 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail725;
2095 2 : {
2096 2 : tree res_op0;
2097 2 : res_op0 = captures[0];
2098 2 : tree res_op1;
2099 2 : res_op1 = tem;
2100 2 : tree _r;
2101 2 : _r = fold_build2_loc (loc, cmp, type, res_op0, res_op1);
2102 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 595, __FILE__, __LINE__, true);
2103 2 : return _r;
2104 : }
2105 : next_after_fail725:;
2106 : }
2107 : else
2108 : {
2109 1 : if (real_less (TREE_REAL_CST_PTR (captures[1]), &dconst0)
2110 : )
2111 : {
2112 1 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail726;
2113 1 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail726;
2114 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail726;
2115 1 : {
2116 1 : tree res_op0;
2117 1 : res_op0 = captures[0];
2118 1 : tree res_op1;
2119 1 : res_op1 = tem;
2120 1 : tree _r;
2121 1 : _r = fold_build2_loc (loc, neg_cmp, type, res_op0, res_op1);
2122 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 596, __FILE__, __LINE__, true);
2123 1 : return _r;
2124 : }
2125 : next_after_fail726:;
2126 : }
2127 : }
2128 : }
2129 : }
2130 : }
2131 : return NULL_TREE;
2132 : }
2133 :
2134 : tree
2135 0 : generic_simplify_416 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2136 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2137 : const enum tree_code ARG_UNUSED (cmp),
2138 : const enum tree_code ARG_UNUSED (out))
2139 : {
2140 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2141 0 : if (TYPE_UNSIGNED (TREE_TYPE (captures[1]))
2142 0 : && types_match (TREE_TYPE (captures[1]), TREE_TYPE (captures[2]))
2143 : )
2144 : {
2145 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail741;
2146 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail741;
2147 0 : {
2148 0 : tree res_op0;
2149 0 : {
2150 0 : tree _o1[1], _r1;
2151 0 : _o1[0] = captures[0];
2152 0 : _r1 = fold_build1_loc (loc, IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o1[0])), _o1[0]);
2153 0 : res_op0 = _r1;
2154 : }
2155 0 : tree res_op1;
2156 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[1]));
2157 0 : tree _r;
2158 0 : _r = fold_build2_loc (loc, out, type, res_op0, res_op1);
2159 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 593, __FILE__, __LINE__, true);
2160 0 : return _r;
2161 : }
2162 : next_after_fail741:;
2163 : }
2164 : return NULL_TREE;
2165 : }
2166 :
2167 : tree
2168 43 : generic_simplify_421 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2169 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2170 : const enum tree_code ARG_UNUSED (cmp),
2171 : const enum tree_code ARG_UNUSED (cmp2),
2172 : const enum tree_code ARG_UNUSED (cmp3),
2173 : const enum tree_code ARG_UNUSED (bit_op),
2174 : const combined_fn ARG_UNUSED (ffs))
2175 : {
2176 43 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2177 43 : {
2178 43 : int prec = TYPE_PRECISION (TREE_TYPE (captures[1]));
2179 43 : if (integer_zerop (captures[2])
2180 : )
2181 : {
2182 11 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail746;
2183 11 : {
2184 11 : tree res_op0;
2185 11 : res_op0 = captures[1];
2186 11 : tree res_op1;
2187 11 : res_op1 = build_zero_cst (TREE_TYPE (captures[1]));
2188 11 : tree _r;
2189 11 : _r = fold_build2_loc (loc, cmp2, type, res_op0, res_op1);
2190 11 : if (TREE_SIDE_EFFECTS (captures[2]))
2191 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
2192 11 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 612, __FILE__, __LINE__, true);
2193 27 : return _r;
2194 : }
2195 0 : next_after_fail746:;
2196 : }
2197 : else
2198 : {
2199 32 : if (tree_int_cst_sgn (captures[2]) < 0
2200 : )
2201 : {
2202 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail747;
2203 0 : {
2204 0 : tree _r;
2205 0 : _r = constant_boolean_node (cmp == GT_EXPR, type);
2206 0 : if (TREE_SIDE_EFFECTS (captures[1]))
2207 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
2208 0 : if (TREE_SIDE_EFFECTS (captures[2]))
2209 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
2210 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 613, __FILE__, __LINE__, true);
2211 0 : return _r;
2212 : }
2213 0 : next_after_fail747:;
2214 : }
2215 : else
2216 : {
2217 32 : if (wi::to_widest (captures[2]) >= prec
2218 : )
2219 : {
2220 14 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail748;
2221 14 : {
2222 14 : tree _r;
2223 14 : _r = constant_boolean_node (cmp != GT_EXPR, type);
2224 14 : if (TREE_SIDE_EFFECTS (captures[1]))
2225 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
2226 14 : if (TREE_SIDE_EFFECTS (captures[2]))
2227 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
2228 14 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 614, __FILE__, __LINE__, true);
2229 14 : return _r;
2230 : }
2231 0 : next_after_fail748:;
2232 : }
2233 : else
2234 : {
2235 18 : if (wi::to_widest (captures[2]) == prec - 1
2236 : )
2237 : {
2238 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail749;
2239 2 : {
2240 2 : tree res_op0;
2241 2 : res_op0 = captures[1];
2242 2 : tree res_op1;
2243 2 : res_op1 = wide_int_to_tree (TREE_TYPE (captures[1]),
2244 2 : wi::shifted_mask (prec - 1, 1,
2245 : false, prec));
2246 2 : tree _r;
2247 2 : _r = fold_build2_loc (loc, cmp3, type, res_op0, res_op1);
2248 2 : if (TREE_SIDE_EFFECTS (captures[2]))
2249 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
2250 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 615, __FILE__, __LINE__, true);
2251 2 : return _r;
2252 : }
2253 0 : next_after_fail749:;
2254 : }
2255 : else
2256 : {
2257 16 : if (single_use (captures[0])
2258 : )
2259 : {
2260 16 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail750;
2261 16 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail750;
2262 16 : {
2263 16 : if (! tree_invariant_p (captures[1])) goto next_after_fail750;
2264 0 : tree res_op0;
2265 0 : {
2266 0 : tree _o1[2], _r1;
2267 0 : _o1[0] = unshare_expr (captures[1]);
2268 0 : _o1[1] = build_zero_cst (TREE_TYPE (captures[1]));
2269 0 : _r1 = fold_build2_loc (loc, cmp2, type, _o1[0], _o1[1]);
2270 0 : res_op0 = _r1;
2271 : }
2272 0 : tree res_op1;
2273 0 : {
2274 0 : tree _o1[2], _r1;
2275 0 : {
2276 0 : tree _o2[2], _r2;
2277 0 : _o2[0] = captures[1];
2278 0 : _o2[1] = wide_int_to_tree (TREE_TYPE (captures[1]),
2279 0 : wi::mask (tree_to_uhwi (captures[2]),
2280 : false, prec));
2281 0 : _r2 = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
2282 0 : _o1[0] = _r2;
2283 : }
2284 0 : _o1[1] = build_zero_cst (TREE_TYPE (captures[1]));
2285 0 : _r1 = fold_build2_loc (loc, cmp3, type, _o1[0], _o1[1]);
2286 0 : res_op1 = _r1;
2287 : }
2288 0 : tree _r;
2289 0 : _r = fold_build2_loc (loc, bit_op, type, res_op0, res_op1);
2290 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 616, __FILE__, __LINE__, true);
2291 0 : return _r;
2292 : }
2293 16 : next_after_fail750:;
2294 : }
2295 : }
2296 : }
2297 : }
2298 : }
2299 : }
2300 16 : return NULL_TREE;
2301 : }
2302 :
2303 : tree
2304 2754601 : generic_simplify_442 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2305 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
2306 : const enum tree_code ARG_UNUSED (op))
2307 : {
2308 2754601 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2309 2754601 : if (INTEGRAL_TYPE_P (type)
2310 2192709 : && op != MULT_EXPR
2311 2192709 : && op != RDIV_EXPR
2312 1402024 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
2313 1402024 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
2314 1402024 : && type_has_mode_precision_p (TREE_TYPE (captures[2]))
2315 1401645 : && type_has_mode_precision_p (TREE_TYPE (captures[4]))
2316 1400875 : && type_has_mode_precision_p (type)
2317 1397022 : && TYPE_PRECISION (TREE_TYPE (captures[1])) > TYPE_PRECISION (TREE_TYPE (captures[2]))
2318 0 : && types_match (captures[2], type)
2319 2754601 : && (types_match (captures[2], captures[4])
2320 0 : || poly_int_tree_p (captures[3]))
2321 : )
2322 : {
2323 0 : if (TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[2]))
2324 : )
2325 : {
2326 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail786;
2327 0 : {
2328 0 : tree res_op0;
2329 0 : res_op0 = captures[2];
2330 0 : tree res_op1;
2331 0 : {
2332 0 : tree _o1[1], _r1;
2333 0 : _o1[0] = captures[4];
2334 0 : if (TREE_TYPE (_o1[0]) != type)
2335 : {
2336 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
2337 : }
2338 : else
2339 : _r1 = _o1[0];
2340 0 : res_op1 = _r1;
2341 : }
2342 0 : tree _r;
2343 0 : _r = fold_build2_loc (loc, op, type, res_op0, res_op1);
2344 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 642, __FILE__, __LINE__, true);
2345 0 : return _r;
2346 : }
2347 0 : next_after_fail786:;
2348 : }
2349 : else
2350 : {
2351 0 : {
2352 0 : tree utype = unsigned_type_for (TREE_TYPE (captures[2]));
2353 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail787;
2354 0 : {
2355 0 : tree res_op0;
2356 0 : {
2357 0 : tree _o1[2], _r1;
2358 0 : {
2359 0 : tree _o2[1], _r2;
2360 0 : _o2[0] = captures[2];
2361 0 : if (TREE_TYPE (_o2[0]) != utype)
2362 : {
2363 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
2364 : }
2365 : else
2366 : _r2 = _o2[0];
2367 0 : _o1[0] = _r2;
2368 : }
2369 0 : {
2370 0 : tree _o2[1], _r2;
2371 0 : _o2[0] = captures[4];
2372 0 : if (TREE_TYPE (_o2[0]) != utype)
2373 : {
2374 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
2375 : }
2376 : else
2377 : _r2 = _o2[0];
2378 0 : _o1[1] = _r2;
2379 : }
2380 0 : _r1 = fold_build2_loc (loc, op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2381 0 : res_op0 = _r1;
2382 : }
2383 0 : tree _r;
2384 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
2385 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 643, __FILE__, __LINE__, true);
2386 0 : return _r;
2387 : }
2388 0 : next_after_fail787:;
2389 : }
2390 : }
2391 : }
2392 : else
2393 : {
2394 2740062 : if (FLOAT_TYPE_P (type)
2395 2769140 : && DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[0]))
2396 14539 : == DECIMAL_FLOAT_TYPE_P (type)
2397 : )
2398 : {
2399 14516 : {
2400 14516 : tree arg0 = strip_float_extensions (captures[2]);
2401 14516 : tree arg1 = strip_float_extensions (captures[4]);
2402 14516 : tree itype = TREE_TYPE (captures[0]);
2403 14516 : tree ty1 = TREE_TYPE (arg0);
2404 14516 : tree ty2 = TREE_TYPE (arg1);
2405 14516 : enum tree_code code = TREE_CODE (itype);
2406 0 : if (FLOAT_TYPE_P (ty1)
2407 14516 : && FLOAT_TYPE_P (ty2)
2408 : )
2409 : {
2410 14516 : {
2411 14516 : tree newtype = type;
2412 14516 : if (TYPE_MODE (ty1) == SDmode
2413 14507 : || TYPE_MODE (ty2) == SDmode
2414 29023 : || TYPE_MODE (type) == SDmode)
2415 9 : newtype = dfloat32_type_node;
2416 14516 : if (TYPE_MODE (ty1) == DDmode
2417 14510 : || TYPE_MODE (ty2) == DDmode
2418 29026 : || TYPE_MODE (type) == DDmode)
2419 6 : newtype = dfloat64_type_node;
2420 14516 : if (TYPE_MODE (ty1) == TDmode
2421 14516 : || TYPE_MODE (ty2) == TDmode
2422 29032 : || TYPE_MODE (type) == TDmode)
2423 15 : newtype = dfloat128_type_node;
2424 14516 : if ((newtype == dfloat32_type_node
2425 14516 : || newtype == dfloat64_type_node
2426 14516 : || newtype == dfloat128_type_node)
2427 15 : && newtype == type
2428 14522 : && types_match (newtype, type)
2429 : )
2430 : {
2431 6 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail788;
2432 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail788;
2433 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail788;
2434 0 : {
2435 0 : tree res_op0;
2436 0 : {
2437 0 : tree _o1[1], _r1;
2438 0 : _o1[0] = captures[2];
2439 0 : if (TREE_TYPE (_o1[0]) != newtype)
2440 : {
2441 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, newtype, _o1[0]);
2442 : }
2443 : else
2444 : _r1 = _o1[0];
2445 0 : res_op0 = _r1;
2446 : }
2447 0 : tree res_op1;
2448 0 : {
2449 0 : tree _o1[1], _r1;
2450 0 : _o1[0] = captures[4];
2451 0 : if (TREE_TYPE (_o1[0]) != newtype)
2452 : {
2453 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, newtype, _o1[0]);
2454 : }
2455 : else
2456 : _r1 = _o1[0];
2457 0 : res_op1 = _r1;
2458 : }
2459 0 : tree _r;
2460 0 : _r = fold_build2_loc (loc, op, type, res_op0, res_op1);
2461 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 644, __FILE__, __LINE__, true);
2462 0 : return _r;
2463 : }
2464 : next_after_fail788:;
2465 : }
2466 : else
2467 : {
2468 14510 : {
2469 14510 : if (element_precision (ty1) > element_precision (newtype))
2470 753 : newtype = ty1;
2471 14510 : if (element_precision (ty2) > element_precision (newtype))
2472 10 : newtype = ty2;
2473 14510 : if (element_precision (newtype) < element_precision (itype)
2474 13170 : && (!VECTOR_MODE_P (TYPE_MODE (newtype))
2475 0 : || target_supports_op_p (newtype, op, optab_default))
2476 13170 : && (flag_unsafe_math_optimizations
2477 13158 : || (element_precision (newtype) == element_precision (type)
2478 13154 : && real_can_shorten_arithmetic (element_mode (itype),
2479 : element_mode (type))
2480 5102 : && !excess_precision_type (newtype)))
2481 15183 : && !types_match (itype, newtype)
2482 : )
2483 : {
2484 673 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail789;
2485 673 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail789;
2486 655 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail789;
2487 655 : {
2488 655 : tree res_op0;
2489 655 : {
2490 655 : tree _o1[2], _r1;
2491 655 : {
2492 655 : tree _o2[1], _r2;
2493 655 : _o2[0] = captures[2];
2494 655 : if (TREE_TYPE (_o2[0]) != newtype)
2495 : {
2496 655 : _r2 = fold_build1_loc (loc, NOP_EXPR, newtype, _o2[0]);
2497 : }
2498 : else
2499 : _r2 = _o2[0];
2500 655 : _o1[0] = _r2;
2501 : }
2502 655 : {
2503 655 : tree _o2[1], _r2;
2504 655 : _o2[0] = captures[4];
2505 655 : if (TREE_TYPE (_o2[0]) != newtype)
2506 : {
2507 604 : _r2 = fold_build1_loc (loc, NOP_EXPR, newtype, _o2[0]);
2508 : }
2509 : else
2510 : _r2 = _o2[0];
2511 655 : _o1[1] = _r2;
2512 : }
2513 655 : _r1 = fold_build2_loc (loc, op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2514 655 : res_op0 = _r1;
2515 : }
2516 655 : tree _r;
2517 655 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
2518 655 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 645, __FILE__, __LINE__, true);
2519 655 : return _r;
2520 : }
2521 : next_after_fail789:;
2522 : }
2523 : }
2524 : }
2525 : }
2526 : }
2527 : }
2528 : }
2529 : }
2530 : return NULL_TREE;
2531 : }
2532 :
2533 : tree
2534 13 : generic_simplify_474 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2535 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
2536 : {
2537 13 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2538 13 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail824;
2539 13 : {
2540 13 : tree _r;
2541 13 : _r = build_zero_cst (type);
2542 13 : if (TREE_SIDE_EFFECTS (captures[0]))
2543 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
2544 13 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 675, __FILE__, __LINE__, true);
2545 : return _r;
2546 : }
2547 0 : next_after_fail824:;
2548 0 : return NULL_TREE;
2549 : }
2550 :
2551 : tree
2552 202 : generic_simplify_481 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2553 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2554 : const enum tree_code ARG_UNUSED (code2),
2555 : const enum tree_code ARG_UNUSED (code1))
2556 : {
2557 202 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2558 202 : if ((TREE_CODE (captures[2]) == INTEGER_CST
2559 2 : && TREE_CODE (captures[5]) == INTEGER_CST)
2560 202 : || ((INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
2561 0 : || ((VECTOR_INTEGER_TYPE_P (TREE_TYPE (captures[2]))
2562 0 : || VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (captures[2])))
2563 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, code2))
2564 0 : || POINTER_TYPE_P (TREE_TYPE (captures[2])))
2565 200 : && bitwise_equal_p (captures[2], captures[5]))
2566 : )
2567 : {
2568 2 : {
2569 2 : bool one_before = false;
2570 2 : bool one_after = false;
2571 2 : int cmp = 0;
2572 2 : bool allbits = true;
2573 2 : if (TREE_CODE (captures[2]) == INTEGER_CST
2574 2 : && TREE_CODE (captures[5]) == INTEGER_CST)
2575 : {
2576 2 : allbits = TYPE_PRECISION (TREE_TYPE (captures[2])) <= TYPE_PRECISION (TREE_TYPE (captures[5]));
2577 2 : auto t1 = wi::to_wide (fold_convert (TREE_TYPE (captures[5]), captures[2]));
2578 2 : auto t2 = wi::to_wide (captures[5]);
2579 2 : cmp = wi::cmp (t1, t2, TYPE_SIGN (TREE_TYPE (captures[5])));
2580 2 : if (cmp < 0
2581 2 : && t1 == t2 - 1)
2582 : one_before = true;
2583 2 : if (cmp > 0
2584 2 : && t1 == t2 + 1)
2585 : one_after = true;
2586 : }
2587 2 : bool val;
2588 2 : switch (code2)
2589 : {
2590 0 : case EQ_EXPR: val = (cmp == 0); break;
2591 2 : case NE_EXPR: val = (cmp != 0); break;
2592 0 : case LT_EXPR: val = (cmp < 0); break;
2593 0 : case GT_EXPR: val = (cmp > 0); break;
2594 0 : case LE_EXPR: val = (cmp <= 0); break;
2595 0 : case GE_EXPR: val = (cmp >= 0); break;
2596 0 : default: gcc_unreachable ();
2597 : }
2598 2 : if (code1 == EQ_EXPR && val
2599 : )
2600 : {
2601 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail839;
2602 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail839;
2603 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail839;
2604 0 : {
2605 0 : tree _r;
2606 0 : _r = captures[0];
2607 0 : if (TREE_SIDE_EFFECTS (captures[4]))
2608 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[4]), _r);
2609 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 682, __FILE__, __LINE__, true);
2610 0 : return _r;
2611 : }
2612 : next_after_fail839:;
2613 : }
2614 : else
2615 : {
2616 2 : if (code1 == EQ_EXPR && !val
2617 : )
2618 : {
2619 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail840;
2620 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail840;
2621 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail840;
2622 0 : {
2623 0 : tree _r;
2624 0 : _r = constant_boolean_node (false, type);
2625 0 : if (TREE_SIDE_EFFECTS (captures[4]))
2626 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[4]), _r);
2627 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 683, __FILE__, __LINE__, true);
2628 0 : return _r;
2629 : }
2630 : next_after_fail840:;
2631 : }
2632 : else
2633 : {
2634 2 : if (code1 == NE_EXPR && !val && allbits
2635 : )
2636 : {
2637 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail841;
2638 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail841;
2639 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail841;
2640 0 : {
2641 0 : tree _r;
2642 0 : _r = captures[3];
2643 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 684, __FILE__, __LINE__, true);
2644 0 : return _r;
2645 : }
2646 : next_after_fail841:;
2647 : }
2648 : else
2649 : {
2650 2 : if ((code1 == NE_EXPR
2651 2 : && code2 == GE_EXPR
2652 0 : && cmp == 0
2653 0 : && allbits)
2654 2 : && ((VECTOR_BOOLEAN_TYPE_P (type)
2655 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, GT_EXPR))
2656 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
2657 : )
2658 : {
2659 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail842;
2660 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail842;
2661 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail842;
2662 0 : {
2663 0 : tree res_op0;
2664 0 : res_op0 = captures[4];
2665 0 : tree res_op1;
2666 0 : {
2667 0 : tree _o1[1], _r1;
2668 0 : _o1[0] = captures[2];
2669 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
2670 : {
2671 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
2672 : }
2673 : else
2674 : _r1 = _o1[0];
2675 0 : res_op1 = _r1;
2676 : }
2677 0 : tree _r;
2678 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
2679 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 685, __FILE__, __LINE__, true);
2680 0 : return _r;
2681 : }
2682 : next_after_fail842:;
2683 : }
2684 : else
2685 : {
2686 2 : if ((code1 == NE_EXPR
2687 2 : && code2 == LE_EXPR
2688 0 : && cmp == 0
2689 0 : && allbits)
2690 2 : && ((VECTOR_BOOLEAN_TYPE_P (type)
2691 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, LT_EXPR))
2692 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
2693 : )
2694 : {
2695 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail843;
2696 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail843;
2697 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail843;
2698 0 : {
2699 0 : tree res_op0;
2700 0 : res_op0 = captures[4];
2701 0 : tree res_op1;
2702 0 : {
2703 0 : tree _o1[1], _r1;
2704 0 : _o1[0] = captures[2];
2705 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
2706 : {
2707 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
2708 : }
2709 : else
2710 : _r1 = _o1[0];
2711 0 : res_op1 = _r1;
2712 : }
2713 0 : tree _r;
2714 0 : _r = fold_build2_loc (loc, LT_EXPR, type, res_op0, res_op1);
2715 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 686, __FILE__, __LINE__, true);
2716 0 : return _r;
2717 : }
2718 : next_after_fail843:;
2719 : }
2720 : else
2721 : {
2722 2 : if ((code1 == NE_EXPR
2723 2 : && code2 == GT_EXPR
2724 : && one_after
2725 0 : && allbits)
2726 2 : && ((VECTOR_BOOLEAN_TYPE_P (type)
2727 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, GT_EXPR))
2728 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
2729 : )
2730 : {
2731 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail844;
2732 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail844;
2733 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail844;
2734 0 : {
2735 0 : tree res_op0;
2736 0 : res_op0 = captures[4];
2737 0 : tree res_op1;
2738 0 : {
2739 0 : tree _o1[1], _r1;
2740 0 : _o1[0] = captures[2];
2741 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
2742 : {
2743 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
2744 : }
2745 : else
2746 : _r1 = _o1[0];
2747 0 : res_op1 = _r1;
2748 : }
2749 0 : tree _r;
2750 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
2751 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 687, __FILE__, __LINE__, true);
2752 0 : return _r;
2753 : }
2754 : next_after_fail844:;
2755 : }
2756 : else
2757 : {
2758 2 : if ((code1 == NE_EXPR
2759 2 : && code2 == LT_EXPR
2760 : && one_before
2761 0 : && allbits)
2762 2 : && ((VECTOR_BOOLEAN_TYPE_P (type)
2763 0 : && expand_vec_cmp_expr_p (TREE_TYPE (captures[2]), type, LT_EXPR))
2764 0 : || !VECTOR_TYPE_P (TREE_TYPE (captures[2])))
2765 : )
2766 : {
2767 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail845;
2768 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail845;
2769 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail845;
2770 0 : {
2771 0 : tree res_op0;
2772 0 : res_op0 = captures[4];
2773 0 : tree res_op1;
2774 0 : {
2775 0 : tree _o1[1], _r1;
2776 0 : _o1[0] = captures[2];
2777 0 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (res_op0))
2778 : {
2779 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, TREE_TYPE (res_op0), _o1[0]);
2780 : }
2781 : else
2782 : _r1 = _o1[0];
2783 0 : res_op1 = _r1;
2784 : }
2785 0 : tree _r;
2786 0 : _r = fold_build2_loc (loc, LT_EXPR, type, res_op0, res_op1);
2787 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 688, __FILE__, __LINE__, true);
2788 0 : return _r;
2789 : }
2790 : next_after_fail845:;
2791 : }
2792 : }
2793 : }
2794 : }
2795 : }
2796 : }
2797 : }
2798 : }
2799 : }
2800 : return NULL_TREE;
2801 : }
2802 :
2803 : tree
2804 145 : generic_simplify_511 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2805 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures))
2806 : {
2807 145 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2808 145 : if (element_precision (type) <= element_precision (TREE_TYPE (captures[0]))
2809 145 : || !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
2810 : )
2811 : {
2812 145 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail905;
2813 145 : {
2814 145 : tree res_op0;
2815 145 : {
2816 145 : tree _o1[2], _r1;
2817 145 : _o1[0] = captures[0];
2818 145 : _o1[1] = build_each_one_cst (TREE_TYPE (captures[0]));
2819 145 : _r1 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2820 145 : res_op0 = _r1;
2821 : }
2822 145 : tree _r;
2823 145 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
2824 145 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 717, __FILE__, __LINE__, true);
2825 145 : return _r;
2826 : }
2827 0 : next_after_fail905:;
2828 : }
2829 : return NULL_TREE;
2830 : }
2831 :
2832 : tree
2833 253 : generic_simplify_518 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2834 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
2835 : const enum tree_code ARG_UNUSED (cmp),
2836 : const enum tree_code ARG_UNUSED (icmp),
2837 : const enum tree_code ARG_UNUSED (ncmp))
2838 : {
2839 253 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2840 253 : if (VECTOR_TYPE_P (type)
2841 253 : || (INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) == 1)
2842 : )
2843 : {
2844 51 : {
2845 51 : enum tree_code ic = invert_tree_comparison
2846 51 : (cmp, HONOR_NANS (captures[0]));
2847 51 : if (ic == icmp
2848 : )
2849 : {
2850 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail912;
2851 12 : {
2852 12 : tree res_op0;
2853 12 : res_op0 = captures[0];
2854 12 : tree res_op1;
2855 12 : res_op1 = captures[1];
2856 12 : tree _r;
2857 12 : _r = fold_build2_loc (loc, icmp, type, res_op0, res_op1);
2858 12 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 722, __FILE__, __LINE__, true);
2859 12 : return _r;
2860 : }
2861 0 : next_after_fail912:;
2862 : }
2863 : else
2864 : {
2865 39 : if (ic == ncmp
2866 : )
2867 : {
2868 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail913;
2869 0 : {
2870 0 : tree res_op0;
2871 0 : res_op0 = captures[0];
2872 0 : tree res_op1;
2873 0 : res_op1 = captures[1];
2874 0 : tree _r;
2875 0 : _r = fold_build2_loc (loc, ncmp, type, res_op0, res_op1);
2876 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 723, __FILE__, __LINE__, true);
2877 0 : return _r;
2878 : }
2879 0 : next_after_fail913:;
2880 : }
2881 : }
2882 : }
2883 : }
2884 : return NULL_TREE;
2885 : }
2886 :
2887 : tree
2888 2 : generic_simplify_531 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2889 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures))
2890 : {
2891 2 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2892 2 : if (TREE_CODE (type) != COMPLEX_TYPE
2893 2 : && (! ANY_INTEGRAL_TYPE_P (type)
2894 1 : || TYPE_OVERFLOW_UNDEFINED (type))
2895 : )
2896 : {
2897 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail927;
2898 2 : {
2899 2 : tree res_op0;
2900 2 : {
2901 2 : tree _o1[1], _r1;
2902 2 : _o1[0] = captures[0];
2903 2 : _r1 = fold_build1_loc (loc, ABS_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
2904 2 : res_op0 = _r1;
2905 : }
2906 2 : tree _r;
2907 2 : _r = fold_build1_loc (loc, NEGATE_EXPR, type, res_op0);
2908 2 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 736, __FILE__, __LINE__, true);
2909 2 : return _r;
2910 : }
2911 0 : next_after_fail927:;
2912 : }
2913 : return NULL_TREE;
2914 : }
2915 :
2916 : tree
2917 0 : generic_simplify_540 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2918 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2919 : const enum tree_code ARG_UNUSED (minmax),
2920 : const enum tree_code ARG_UNUSED (maxmin))
2921 : {
2922 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2923 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail950;
2924 0 : {
2925 0 : tree res_op0;
2926 0 : {
2927 0 : tree _o1[2], _r1;
2928 0 : _o1[0] = captures[1];
2929 0 : _o1[1] = captures[3];
2930 0 : _r1 = fold_build2_loc (loc, maxmin, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2931 0 : res_op0 = _r1;
2932 : }
2933 0 : tree _r;
2934 0 : _r = fold_build1_loc (loc, BIT_NOT_EXPR, type, res_op0);
2935 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 747, __FILE__, __LINE__, true);
2936 : return _r;
2937 : }
2938 0 : next_after_fail950:;
2939 0 : return NULL_TREE;
2940 : }
2941 :
2942 : tree
2943 0 : generic_simplify_546 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2944 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
2945 : const combined_fn ARG_UNUSED (minmax))
2946 : {
2947 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2948 0 : if (!tree_expr_maybe_signaling_nan_p (captures[0])
2949 : )
2950 : {
2951 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail956;
2952 0 : {
2953 0 : tree _r;
2954 0 : _r = captures[0];
2955 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 753, __FILE__, __LINE__, true);
2956 0 : return _r;
2957 : }
2958 0 : next_after_fail956:;
2959 : }
2960 : return NULL_TREE;
2961 : }
2962 :
2963 : tree
2964 6 : generic_simplify_551 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2965 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures))
2966 : {
2967 6 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2968 6 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail961;
2969 6 : if (TREE_SIDE_EFFECTS (_p2)) goto next_after_fail961;
2970 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail961;
2971 6 : {
2972 6 : tree _r;
2973 6 : _r = captures[2];
2974 6 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 537, __FILE__, __LINE__, true);
2975 : return _r;
2976 : }
2977 : next_after_fail961:;
2978 : return NULL_TREE;
2979 : }
2980 :
2981 : tree
2982 0 : generic_simplify_561 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
2983 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures),
2984 : const combined_fn ARG_UNUSED (cond_len_op))
2985 : {
2986 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2987 0 : {
2988 0 : tree op_type = TREE_TYPE (captures[4]);
2989 0 : if (element_precision (type) == element_precision (op_type)
2990 : )
2991 : {
2992 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail971;
2993 0 : {
2994 0 : tree res_op0;
2995 0 : {
2996 0 : tree _o1[7], _r1;
2997 0 : _o1[0] = captures[0];
2998 0 : _o1[1] = captures[1];
2999 0 : _o1[2] = captures[2];
3000 0 : _o1[3] = captures[3];
3001 0 : {
3002 0 : tree _o2[1], _r2;
3003 0 : _o2[0] = captures[7];
3004 0 : if (TREE_TYPE (_o2[0]) != op_type)
3005 : {
3006 0 : _r2 = fold_build1_loc (loc, VIEW_CONVERT_EXPR, op_type, _o2[0]);
3007 : }
3008 : else
3009 : _r2 = _o2[0];
3010 0 : _o1[4] = _r2;
3011 : }
3012 0 : _o1[5] = captures[5];
3013 0 : _o1[6] = captures[6];
3014 0 : _r1 = maybe_build_call_expr_loc (loc, cond_len_op, TREE_TYPE (_o1[1]), 7, _o1[0], _o1[1], _o1[2], _o1[3], _o1[4], _o1[5], _o1[6]);
3015 0 : if (!_r1)
3016 0 : goto next_after_fail971;
3017 0 : res_op0 = _r1;
3018 : }
3019 0 : tree _r;
3020 0 : _r = fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, res_op0);
3021 0 : if (TREE_SIDE_EFFECTS (captures[4]))
3022 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[4]), _r);
3023 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 763, __FILE__, __LINE__, true);
3024 0 : return _r;
3025 : }
3026 : next_after_fail971:;
3027 : }
3028 : }
3029 : return NULL_TREE;
3030 : }
3031 :
3032 : tree
3033 2870166 : generic_simplify_572 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3034 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree *ARG_UNUSED (captures),
3035 : const enum tree_code ARG_UNUSED (cmp))
3036 : {
3037 2870166 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3038 2870166 : if (REAL_VALUE_ISNAN (TREE_REAL_CST (captures[1]))
3039 2870166 : && (cmp != LTGT_EXPR || ! flag_trapping_math)
3040 : )
3041 : {
3042 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail985;
3043 10 : {
3044 10 : tree _r;
3045 10 : _r = constant_boolean_node (cmp != ORDERED_EXPR && cmp != LTGT_EXPR,
3046 : type);
3047 10 : if (TREE_SIDE_EFFECTS (captures[0]))
3048 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
3049 10 : if (TREE_SIDE_EFFECTS (captures[1]))
3050 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
3051 10 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 777, __FILE__, __LINE__, true);
3052 10 : return _r;
3053 : }
3054 0 : next_after_fail985:;
3055 : }
3056 : return NULL_TREE;
3057 : }
3058 :
3059 : tree
3060 0 : generic_simplify_582 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3061 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
3062 : const combined_fn ARG_UNUSED (sinhs),
3063 : const combined_fn ARG_UNUSED (atanhs),
3064 : const combined_fn ARG_UNUSED (sqrts))
3065 : {
3066 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3067 0 : if (!flag_errno_math
3068 : )
3069 : {
3070 0 : {
3071 0 : tree t_one = build_one_cst (type);
3072 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail995;
3073 0 : {
3074 0 : if (! tree_invariant_p (captures[1])) goto next_after_fail995;
3075 0 : tree res_op0;
3076 0 : res_op0 = unshare_expr (captures[1]);
3077 0 : tree res_op1;
3078 0 : {
3079 0 : tree _o1[1], _r1;
3080 0 : {
3081 0 : tree _o2[2], _r2;
3082 0 : {
3083 0 : tree _o3[2], _r3;
3084 0 : _o3[0] = t_one;
3085 0 : _o3[1] = unshare_expr (captures[1]);
3086 0 : _r3 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
3087 0 : _o2[0] = _r3;
3088 : }
3089 0 : {
3090 0 : tree _o3[2], _r3;
3091 0 : _o3[0] = t_one;
3092 0 : _o3[1] = captures[1];
3093 0 : _r3 = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
3094 0 : _o2[1] = _r3;
3095 : }
3096 0 : _r2 = fold_build2_loc (loc, MULT_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
3097 0 : _o1[0] = _r2;
3098 : }
3099 0 : _r1 = maybe_build_call_expr_loc (loc, sqrts, TREE_TYPE (_o1[0]), 1, _o1[0]);
3100 0 : if (!_r1)
3101 0 : goto next_after_fail995;
3102 0 : res_op1 = _r1;
3103 : }
3104 0 : tree _r;
3105 0 : _r = fold_build2_loc (loc, RDIV_EXPR, type, res_op0, res_op1);
3106 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 787, __FILE__, __LINE__, true);
3107 0 : return _r;
3108 : }
3109 : next_after_fail995:;
3110 : }
3111 : }
3112 : return NULL_TREE;
3113 : }
3114 :
3115 : tree
3116 0 : generic_simplify_597 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3117 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
3118 : const combined_fn ARG_UNUSED (SIGNBIT))
3119 : {
3120 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3121 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1010;
3122 0 : {
3123 0 : tree _r;
3124 0 : _r = integer_zero_node;
3125 0 : if (TREE_SIDE_EFFECTS (captures[0]))
3126 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
3127 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 802, __FILE__, __LINE__, true);
3128 : return _r;
3129 : }
3130 0 : next_after_fail1010:;
3131 0 : return NULL_TREE;
3132 : }
3133 :
3134 : tree
3135 0 : generic_simplify_603 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3136 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree *ARG_UNUSED (captures))
3137 : {
3138 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3139 0 : if (canonicalize_math_after_vectorization_p ()
3140 : )
3141 : {
3142 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1016;
3143 : {
3144 : tree res_op0;
3145 : res_op0 = captures[0];
3146 : tree res_op1;
3147 : res_op1 = captures[1];
3148 : tree res_op2;
3149 : res_op2 = captures[2];
3150 : tree _r;
3151 : _r = maybe_build_call_expr_loc (loc, CFN_FNMS, type, 3, res_op0, res_op1, res_op2);
3152 : if (!_r)
3153 : goto next_after_fail1016;
3154 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 808, __FILE__, __LINE__, true);
3155 : return _r;
3156 : }
3157 0 : next_after_fail1016:;
3158 : }
3159 0 : return NULL_TREE;
3160 : }
3161 :
3162 : tree
3163 0 : generic_simplify_612 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3164 : tree ARG_UNUSED (_p0), tree ARG_UNUSED (_p1), tree ARG_UNUSED (_p2), tree ARG_UNUSED (_p3), tree ARG_UNUSED (_p4), tree *ARG_UNUSED (captures))
3165 : {
3166 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3167 0 : if (canonicalize_math_after_vectorization_p ()
3168 : )
3169 : {
3170 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1025;
3171 : {
3172 : tree res_op0;
3173 : res_op0 = captures[0];
3174 : tree res_op1;
3175 : res_op1 = captures[1];
3176 : tree res_op2;
3177 : res_op2 = captures[2];
3178 : tree res_op3;
3179 : res_op3 = captures[3];
3180 : tree res_op4;
3181 : res_op4 = captures[4];
3182 : tree _r;
3183 : _r = maybe_build_call_expr_loc (loc, CFN_COND_FNMA, type, 5, res_op0, res_op1, res_op2, res_op3, res_op4);
3184 : if (!_r)
3185 : goto next_after_fail1025;
3186 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 817, __FILE__, __LINE__, true);
3187 : return _r;
3188 : }
3189 0 : next_after_fail1025:;
3190 : }
3191 0 : return NULL_TREE;
3192 : }
3193 :
3194 : tree
3195 0 : generic_simplify_621 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3196 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
3197 : const combined_fn ARG_UNUSED (bswap),
3198 : const combined_fn ARG_UNUSED (popcount))
3199 : {
3200 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3201 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
3202 0 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
3203 : )
3204 : {
3205 0 : {
3206 0 : tree type0 = TREE_TYPE (captures[0]);
3207 0 : tree type1 = TREE_TYPE (captures[1]);
3208 0 : unsigned int prec0 = TYPE_PRECISION (type0);
3209 0 : unsigned int prec1 = TYPE_PRECISION (type1);
3210 0 : if (prec0 == prec1 || (prec0 > prec1 && TYPE_UNSIGNED (type1))
3211 : )
3212 : {
3213 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1034;
3214 0 : {
3215 0 : tree res_op0;
3216 0 : {
3217 0 : tree _o1[1], _r1;
3218 0 : {
3219 0 : tree _o2[1], _r2;
3220 0 : _o2[0] = captures[2];
3221 0 : if (TREE_TYPE (_o2[0]) != type1)
3222 : {
3223 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, type1, _o2[0]);
3224 : }
3225 : else
3226 : _r2 = _o2[0];
3227 0 : _o1[0] = _r2;
3228 : }
3229 0 : if (TREE_TYPE (_o1[0]) != type0)
3230 : {
3231 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type0, _o1[0]);
3232 : }
3233 : else
3234 : _r1 = _o1[0];
3235 0 : res_op0 = _r1;
3236 : }
3237 0 : tree _r;
3238 0 : _r = maybe_build_call_expr_loc (loc, popcount, type, 1, res_op0);
3239 0 : if (!_r)
3240 0 : goto next_after_fail1034;
3241 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 823, __FILE__, __LINE__, true);
3242 0 : return _r;
3243 : }
3244 : next_after_fail1034:;
3245 : }
3246 : }
3247 : }
3248 : return NULL_TREE;
3249 : }
3250 :
3251 : tree
3252 0 : generic_simplify_632 (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),
3253 : tree ARG_UNUSED (_p0), tree *ARG_UNUSED (captures),
3254 : const combined_fn ARG_UNUSED (reduc))
3255 : {
3256 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3257 0 : {
3258 0 : int i = single_nonzero_element (captures[1]);
3259 0 : if (i >= 0
3260 : )
3261 : {
3262 0 : {
3263 0 : tree elt = vector_cst_elt (captures[1], i);
3264 0 : tree elt_type = TREE_TYPE (elt);
3265 0 : unsigned int elt_bits = tree_to_uhwi (TYPE_SIZE (elt_type));
3266 0 : tree size = bitsize_int (elt_bits);
3267 0 : tree pos = bitsize_int (elt_bits * i);
3268 0 : if (compare_tree_int (TYPE_SIZE (type), elt_bits) == 0
3269 : )
3270 : {
3271 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1047;
3272 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1047;
3273 0 : {
3274 0 : tree res_op0;
3275 0 : {
3276 0 : tree _o1[2], _r1;
3277 0 : {
3278 0 : tree _o2[3], _r2;
3279 0 : _o2[0] = captures[0];
3280 0 : _o2[1] = size;
3281 0 : _o2[2] = pos;
3282 0 : _r2 = fold_build3_loc (loc, BIT_FIELD_REF, elt_type, _o2[0], _o2[1], _o2[2]);
3283 0 : _o1[0] = _r2;
3284 : }
3285 0 : _o1[1] = elt;
3286 0 : _r1 = fold_build2_loc (loc, BIT_AND_EXPR, elt_type, _o1[0], _o1[1]);
3287 0 : res_op0 = _r1;
3288 : }
3289 0 : tree _r;
3290 0 : _r = fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, res_op0);
3291 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 832, __FILE__, __LINE__, true);
3292 0 : return _r;
3293 : }
3294 : next_after_fail1047:;
3295 : }
3296 : }
3297 : }
3298 : }
3299 : return NULL_TREE;
3300 : }
3301 :
3302 : tree
3303 511332 : generic_simplify_FIX_TRUNC_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0)
3304 : {
3305 511332 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3306 511332 : {
3307 511332 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
3308 1022664 : if ((
3309 :
3310 : && useless_type_conversion_p (type, TREE_TYPE (captures[0])))
3311 : || (
3312 : 1
3313 511332 : && type == TREE_TYPE (captures[0]))
3314 : )
3315 : {
3316 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1130;
3317 0 : {
3318 0 : tree _r;
3319 0 : _r = captures[0];
3320 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 847, __FILE__, __LINE__, true);
3321 0 : return _r;
3322 : }
3323 0 : next_after_fail1130:;
3324 : }
3325 : }
3326 511332 : switch (TREE_CODE (_p0))
3327 : {
3328 14982 : CASE_CONVERT:
3329 14982 : {
3330 14982 : tree _q20 = TREE_OPERAND (_p0, 0);
3331 14982 : {
3332 14982 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
3333 14982 : {
3334 14982 : tree inside_type = TREE_TYPE (captures[1]);
3335 14982 : tree inter_type = TREE_TYPE (captures[0]);
3336 14982 : int inside_int = INTEGRAL_TYPE_P (inside_type);
3337 14982 : int inside_ptr = POINTER_TYPE_P (inside_type);
3338 14982 : int inside_float = FLOAT_TYPE_P (inside_type);
3339 14982 : int inside_vec = VECTOR_TYPE_P (inside_type);
3340 14982 : unsigned int inside_prec = element_precision (inside_type);
3341 14982 : int inside_unsignedp = TYPE_UNSIGNED (inside_type);
3342 14982 : int inter_int = INTEGRAL_TYPE_P (inter_type);
3343 14982 : int inter_ptr = POINTER_TYPE_P (inter_type);
3344 14982 : int inter_float = FLOAT_TYPE_P (inter_type);
3345 14982 : int inter_vec = VECTOR_TYPE_P (inter_type);
3346 14982 : unsigned int inter_prec = element_precision (inter_type);
3347 14982 : int inter_unsignedp = TYPE_UNSIGNED (inter_type);
3348 14982 : int final_int = INTEGRAL_TYPE_P (type);
3349 14982 : int final_ptr = POINTER_TYPE_P (type);
3350 14982 : int final_float = FLOAT_TYPE_P (type);
3351 14982 : int final_vec = VECTOR_TYPE_P (type);
3352 14982 : unsigned int final_prec = element_precision (type);
3353 14982 : int final_unsignedp = TYPE_UNSIGNED (type);
3354 14982 : if (((
3355 :
3356 : && useless_type_conversion_p (type, inside_type))
3357 : || (
3358 : 1
3359 14982 : && TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (inside_type)))
3360 0 : && (((inter_int || inter_ptr) && final_int)
3361 0 : || (inter_float && final_float))
3362 14982 : && inter_prec >= final_prec
3363 : )
3364 : {
3365 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1131;
3366 0 : {
3367 0 : tree res_op0;
3368 0 : res_op0 = captures[1];
3369 0 : tree _r;
3370 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3371 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 848, __FILE__, __LINE__, true);
3372 0 : return _r;
3373 : }
3374 0 : next_after_fail1131:;
3375 : }
3376 : else
3377 : {
3378 14982 : if (((inter_int && inside_int) || (inter_float && inside_float))
3379 14982 : && (final_int || final_float)
3380 14982 : && inter_prec >= inside_prec
3381 14764 : && (inter_float || inter_unsignedp == inside_unsignedp)
3382 : )
3383 : {
3384 14764 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1132;
3385 14764 : {
3386 14764 : tree res_op0;
3387 14764 : res_op0 = captures[1];
3388 14764 : tree _r;
3389 14764 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3390 14764 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 849, __FILE__, __LINE__, true);
3391 14764 : return _r;
3392 : }
3393 0 : next_after_fail1132:;
3394 0 : }
3395 : else
3396 : {
3397 218 : if (inside_int && inter_int && final_int
3398 0 : && ((inside_prec < inter_prec && inter_prec < final_prec
3399 0 : && inside_unsignedp && !inter_unsignedp)
3400 0 : || final_prec == inter_prec
3401 0 : || (inside_prec < inter_prec && inter_prec > final_prec
3402 0 : && !inside_unsignedp && inter_unsignedp))
3403 : )
3404 : {
3405 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1133;
3406 0 : {
3407 0 : tree res_op0;
3408 0 : res_op0 = captures[1];
3409 0 : tree _r;
3410 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3411 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 850, __FILE__, __LINE__, true);
3412 0 : return _r;
3413 : }
3414 0 : next_after_fail1133:;
3415 0 : }
3416 : else
3417 : {
3418 218 : if (! inside_float && ! inter_float && ! final_float
3419 : && ! inside_vec && ! inter_vec && ! final_vec
3420 0 : && (inter_prec >= inside_prec || inter_prec >= final_prec)
3421 0 : && ! (inside_int && inter_int
3422 0 : && inter_unsignedp != inside_unsignedp
3423 0 : && inter_prec < final_prec)
3424 0 : && ((inter_unsignedp && inter_prec > inside_prec)
3425 0 : == (final_unsignedp && final_prec > inter_prec))
3426 0 : && ! (inside_ptr && inter_prec != final_prec)
3427 0 : && ! (final_ptr && inside_prec != inter_prec)
3428 : )
3429 : {
3430 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1134;
3431 0 : {
3432 0 : tree res_op0;
3433 0 : res_op0 = captures[1];
3434 0 : tree _r;
3435 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3436 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 851, __FILE__, __LINE__, true);
3437 0 : return _r;
3438 : }
3439 0 : next_after_fail1134:;
3440 0 : }
3441 : else
3442 : {
3443 218 : if (inside_int && inter_int && final_int
3444 0 : && final_prec <= inside_prec
3445 0 : && inter_prec >= inside_prec
3446 : )
3447 : {
3448 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1135;
3449 0 : {
3450 0 : tree res_op0;
3451 0 : res_op0 = captures[1];
3452 0 : tree _r;
3453 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3454 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 852, __FILE__, __LINE__, true);
3455 0 : return _r;
3456 : }
3457 0 : next_after_fail1135:;
3458 0 : }
3459 : else
3460 : {
3461 : if (0
3462 : && final_int && inter_int && inside_int
3463 : && final_prec >= inside_prec
3464 : && inside_prec > inter_prec
3465 : && inter_unsignedp
3466 : )
3467 : {
3468 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1136;
3469 : {
3470 : tree res_op0;
3471 : {
3472 : tree _o1[2], _r1;
3473 : _o1[0] = captures[1];
3474 : _o1[1] = wide_int_to_tree
3475 : (inside_type,
3476 : wi::mask (inter_prec, false,
3477 : TYPE_PRECISION (inside_type)));
3478 : _r1 = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3479 : res_op0 = _r1;
3480 : }
3481 : tree _r;
3482 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3483 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 853, __FILE__, __LINE__, true);
3484 : return _r;
3485 : }
3486 : next_after_fail1136:;
3487 : }
3488 : else
3489 : {
3490 : if (0
3491 : && inside_int && inter_float && final_int &&
3492 : (unsigned) significand_size (TYPE_MODE (inter_type))
3493 : >= inside_prec - !inside_unsignedp
3494 : )
3495 : {
3496 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1137;
3497 : {
3498 : tree res_op0;
3499 : res_op0 = captures[1];
3500 : tree _r;
3501 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3502 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 854, __FILE__, __LINE__, true);
3503 : return _r;
3504 : }
3505 : next_after_fail1137:;
3506 : }
3507 : }
3508 : }
3509 : }
3510 : }
3511 : }
3512 : }
3513 : }
3514 : }
3515 218 : break;
3516 : }
3517 609 : case FLOAT_EXPR:
3518 609 : {
3519 609 : tree _q20 = TREE_OPERAND (_p0, 0);
3520 609 : {
3521 609 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
3522 609 : {
3523 609 : tree inside_type = TREE_TYPE (captures[1]);
3524 609 : tree inter_type = TREE_TYPE (captures[0]);
3525 609 : int inside_int = INTEGRAL_TYPE_P (inside_type);
3526 609 : int inside_ptr = POINTER_TYPE_P (inside_type);
3527 609 : int inside_float = FLOAT_TYPE_P (inside_type);
3528 609 : int inside_vec = VECTOR_TYPE_P (inside_type);
3529 609 : unsigned int inside_prec = element_precision (inside_type);
3530 609 : int inside_unsignedp = TYPE_UNSIGNED (inside_type);
3531 609 : int inter_int = INTEGRAL_TYPE_P (inter_type);
3532 609 : int inter_ptr = POINTER_TYPE_P (inter_type);
3533 609 : int inter_float = FLOAT_TYPE_P (inter_type);
3534 609 : int inter_vec = VECTOR_TYPE_P (inter_type);
3535 609 : unsigned int inter_prec = element_precision (inter_type);
3536 609 : int inter_unsignedp = TYPE_UNSIGNED (inter_type);
3537 609 : int final_int = INTEGRAL_TYPE_P (type);
3538 609 : int final_ptr = POINTER_TYPE_P (type);
3539 609 : int final_float = FLOAT_TYPE_P (type);
3540 609 : int final_vec = VECTOR_TYPE_P (type);
3541 609 : unsigned int final_prec = element_precision (type);
3542 609 : int final_unsignedp = TYPE_UNSIGNED (type);
3543 609 : if (((
3544 :
3545 : && useless_type_conversion_p (type, inside_type))
3546 : || (
3547 : 1
3548 609 : && TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (inside_type)))
3549 60 : && (((inter_int || inter_ptr) && final_int)
3550 60 : || (inter_float && final_float))
3551 609 : && inter_prec >= final_prec
3552 : )
3553 : {
3554 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1138;
3555 0 : {
3556 0 : tree res_op0;
3557 0 : res_op0 = captures[1];
3558 0 : tree _r;
3559 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3560 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 848, __FILE__, __LINE__, true);
3561 0 : return _r;
3562 : }
3563 0 : next_after_fail1138:;
3564 : }
3565 : else
3566 : {
3567 609 : if (((inter_int && inside_int) || (inter_float && inside_float))
3568 0 : && (final_int || final_float)
3569 0 : && inter_prec >= inside_prec
3570 0 : && (inter_float || inter_unsignedp == inside_unsignedp)
3571 : )
3572 : {
3573 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1139;
3574 0 : {
3575 0 : tree res_op0;
3576 0 : res_op0 = captures[1];
3577 0 : tree _r;
3578 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3579 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 849, __FILE__, __LINE__, true);
3580 0 : return _r;
3581 : }
3582 0 : next_after_fail1139:;
3583 0 : }
3584 : else
3585 : {
3586 609 : if (inside_int && inter_int && final_int
3587 0 : && ((inside_prec < inter_prec && inter_prec < final_prec
3588 0 : && inside_unsignedp && !inter_unsignedp)
3589 0 : || final_prec == inter_prec
3590 0 : || (inside_prec < inter_prec && inter_prec > final_prec
3591 0 : && !inside_unsignedp && inter_unsignedp))
3592 : )
3593 : {
3594 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1140;
3595 0 : {
3596 0 : tree res_op0;
3597 0 : res_op0 = captures[1];
3598 0 : tree _r;
3599 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3600 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 850, __FILE__, __LINE__, true);
3601 0 : return _r;
3602 : }
3603 0 : next_after_fail1140:;
3604 0 : }
3605 : else
3606 : {
3607 609 : if (! inside_float && ! inter_float && ! final_float
3608 : && ! inside_vec && ! inter_vec && ! final_vec
3609 0 : && (inter_prec >= inside_prec || inter_prec >= final_prec)
3610 0 : && ! (inside_int && inter_int
3611 0 : && inter_unsignedp != inside_unsignedp
3612 0 : && inter_prec < final_prec)
3613 0 : && ((inter_unsignedp && inter_prec > inside_prec)
3614 0 : == (final_unsignedp && final_prec > inter_prec))
3615 0 : && ! (inside_ptr && inter_prec != final_prec)
3616 0 : && ! (final_ptr && inside_prec != inter_prec)
3617 : )
3618 : {
3619 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1141;
3620 0 : {
3621 0 : tree res_op0;
3622 0 : res_op0 = captures[1];
3623 0 : tree _r;
3624 0 : _r = fold_build1_loc (loc, FIX_TRUNC_EXPR, type, res_op0);
3625 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 851, __FILE__, __LINE__, true);
3626 0 : return _r;
3627 : }
3628 0 : next_after_fail1141:;
3629 0 : }
3630 : else
3631 : {
3632 609 : if (inside_int && inter_int && final_int
3633 0 : && final_prec <= inside_prec
3634 0 : && inter_prec >= inside_prec
3635 : )
3636 : {
3637 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1142;
3638 0 : {
3639 0 : tree res_op0;
3640 0 : res_op0 = captures[1];
3641 0 : tree _r;
3642 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3643 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 852, __FILE__, __LINE__, true);
3644 0 : return _r;
3645 : }
3646 0 : next_after_fail1142:;
3647 0 : }
3648 : else
3649 : {
3650 : if (0
3651 : && final_int && inter_int && inside_int
3652 : && final_prec >= inside_prec
3653 : && inside_prec > inter_prec
3654 : && inter_unsignedp
3655 : )
3656 : {
3657 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1143;
3658 : {
3659 : tree res_op0;
3660 : {
3661 : tree _o1[2], _r1;
3662 : _o1[0] = captures[1];
3663 : _o1[1] = wide_int_to_tree
3664 : (inside_type,
3665 : wi::mask (inter_prec, false,
3666 : TYPE_PRECISION (inside_type)));
3667 : _r1 = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3668 : res_op0 = _r1;
3669 : }
3670 : tree _r;
3671 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3672 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 853, __FILE__, __LINE__, true);
3673 : return _r;
3674 : }
3675 : next_after_fail1143:;
3676 : }
3677 : else
3678 : {
3679 : if (0
3680 : && inside_int && inter_float && final_int &&
3681 : (unsigned) significand_size (TYPE_MODE (inter_type))
3682 : >= inside_prec - !inside_unsignedp
3683 : )
3684 : {
3685 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1144;
3686 : {
3687 : tree res_op0;
3688 : res_op0 = captures[1];
3689 : tree _r;
3690 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
3691 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 854, __FILE__, __LINE__, true);
3692 : return _r;
3693 : }
3694 : next_after_fail1144:;
3695 : }
3696 : }
3697 : }
3698 : }
3699 : }
3700 : }
3701 : }
3702 : }
3703 : }
3704 609 : break;
3705 : }
3706 : default:;
3707 : }
3708 : return NULL_TREE;
3709 : }
3710 :
3711 : tree
3712 33298618 : generic_simplify_MINUS_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0, tree _p1)
3713 : {
3714 33298618 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3715 33298618 : if (integer_zerop (_p1))
3716 : {
3717 1990182 : {
3718 1990182 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
3719 1990182 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1289;
3720 1990182 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1289;
3721 1990182 : {
3722 1990182 : tree res_op0;
3723 1990182 : res_op0 = captures[0];
3724 1990182 : tree _r;
3725 1990182 : _r = non_lvalue_loc (loc, res_op0);
3726 1990182 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 899, __FILE__, __LINE__, true);
3727 1990182 : return _r;
3728 : }
3729 : next_after_fail1289:;
3730 : }
3731 : }
3732 31308436 : if (real_zerop (_p1))
3733 : {
3734 1140 : {
3735 1140 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
3736 1140 : if (fold_real_zero_addition_p (type, captures[0], captures[1], 1)
3737 : )
3738 : {
3739 752 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1290;
3740 752 : {
3741 752 : tree res_op0;
3742 752 : res_op0 = captures[0];
3743 752 : tree _r;
3744 752 : _r = non_lvalue_loc (loc, res_op0);
3745 752 : if (TREE_SIDE_EFFECTS (captures[1]))
3746 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
3747 752 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
3748 752 : return _r;
3749 : }
3750 0 : next_after_fail1290:;
3751 : }
3752 : }
3753 : }
3754 31307684 : switch (TREE_CODE (_p0))
3755 : {
3756 2310684 : case PLUS_EXPR:
3757 2310684 : {
3758 2310684 : tree _q20 = TREE_OPERAND (_p0, 0);
3759 2310684 : tree _q21 = TREE_OPERAND (_p0, 1);
3760 2310684 : switch (TREE_CODE (_q21))
3761 : {
3762 153635 : case REAL_CST:
3763 153635 : {
3764 153635 : switch (TREE_CODE (_p1))
3765 : {
3766 11 : case REAL_CST:
3767 11 : {
3768 11 : {
3769 11 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
3770 11 : tree res = generic_simplify_54 (loc, type, _p0, _p1, captures, MINUS_EXPR, PLUS_EXPR);
3771 11 : if (res) return res;
3772 : }
3773 8 : break;
3774 : }
3775 : default:;
3776 : }
3777 : break;
3778 : }
3779 : default:;
3780 : }
3781 : break;
3782 : }
3783 1239834 : case MINUS_EXPR:
3784 1239834 : {
3785 1239834 : tree _q20 = TREE_OPERAND (_p0, 0);
3786 1239834 : tree _q21 = TREE_OPERAND (_p0, 1);
3787 1239834 : switch (TREE_CODE (_q21))
3788 : {
3789 96583 : case REAL_CST:
3790 96583 : {
3791 96583 : switch (TREE_CODE (_p1))
3792 : {
3793 40 : case REAL_CST:
3794 40 : {
3795 40 : {
3796 40 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
3797 40 : tree res = generic_simplify_54 (loc, type, _p0, _p1, captures, MINUS_EXPR, MINUS_EXPR);
3798 40 : if (res) return res;
3799 : }
3800 38 : break;
3801 : }
3802 : default:;
3803 : }
3804 : break;
3805 : }
3806 : default:;
3807 : }
3808 : break;
3809 : }
3810 31307679 : default:;
3811 : }
3812 31307679 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
3813 : {
3814 201333 : {
3815 201333 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
3816 200575 : if (!FLOAT_TYPE_P (type)
3817 201396 : || (!tree_expr_maybe_nan_p (captures[0])
3818 107 : && !tree_expr_maybe_infinite_p (captures[0])
3819 15 : && (!HONOR_SIGN_DEPENDENT_ROUNDING (type)
3820 1 : || !HONOR_SIGNED_ZEROS (type)))
3821 : )
3822 : {
3823 200526 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1291;
3824 200526 : {
3825 200526 : tree _r;
3826 200526 : _r = build_zero_cst (type);
3827 200526 : if (TREE_SIDE_EFFECTS (captures[0]))
3828 36 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
3829 200526 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
3830 200526 : return _r;
3831 : }
3832 0 : next_after_fail1291:;
3833 : }
3834 : }
3835 : }
3836 31107153 : switch (TREE_CODE (_p0))
3837 : {
3838 8614063 : CASE_CONVERT:
3839 8614063 : {
3840 8614063 : tree _q20 = TREE_OPERAND (_p0, 0);
3841 8614063 : switch (TREE_CODE (_p1))
3842 : {
3843 4281808 : CASE_CONVERT:
3844 4281808 : {
3845 4281808 : tree _q40 = TREE_OPERAND (_p1, 0);
3846 4281808 : switch (TREE_CODE (_q40))
3847 : {
3848 110762 : case MULT_EXPR:
3849 110762 : {
3850 110762 : tree _q50 = TREE_OPERAND (_q40, 0);
3851 110762 : tree _q51 = TREE_OPERAND (_q40, 1);
3852 110762 : switch (TREE_CODE (_q50))
3853 : {
3854 21 : case TRUNC_DIV_EXPR:
3855 21 : {
3856 21 : tree _q60 = TREE_OPERAND (_q50, 0);
3857 21 : tree _q61 = TREE_OPERAND (_q50, 1);
3858 21 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _q20, 0))
3859 : {
3860 21 : if ((_q51 == _q61 && ! TREE_SIDE_EFFECTS (_q51)) || operand_equal_p (_q51, _q61, 0))
3861 : {
3862 21 : {
3863 21 : tree captures[4] ATTRIBUTE_UNUSED = { _q60, _q61, _q20, _q61 };
3864 21 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3865 21 : if (res) return res;
3866 : }
3867 : }
3868 : }
3869 : break;
3870 : }
3871 110741 : default:;
3872 : }
3873 110741 : switch (TREE_CODE (_q51))
3874 : {
3875 0 : case TRUNC_DIV_EXPR:
3876 0 : {
3877 0 : tree _q70 = TREE_OPERAND (_q51, 0);
3878 0 : tree _q71 = TREE_OPERAND (_q51, 1);
3879 0 : if ((_q70 == _q20 && ! TREE_SIDE_EFFECTS (_q70)) || operand_equal_p (_q70, _q20, 0))
3880 : {
3881 0 : if ((_q71 == _q50 && ! TREE_SIDE_EFFECTS (_q71)) || operand_equal_p (_q71, _q50, 0))
3882 : {
3883 0 : {
3884 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q70, _q71, _q20, _q50 };
3885 0 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3886 0 : if (res) return res;
3887 : }
3888 : }
3889 : }
3890 : break;
3891 : }
3892 : default:;
3893 : }
3894 : break;
3895 : }
3896 : default:;
3897 : }
3898 : break;
3899 : }
3900 149473 : case MULT_EXPR:
3901 149473 : {
3902 149473 : tree _q40 = TREE_OPERAND (_p1, 0);
3903 149473 : tree _q41 = TREE_OPERAND (_p1, 1);
3904 149473 : switch (TREE_CODE (_q40))
3905 : {
3906 1837 : case TRUNC_DIV_EXPR:
3907 1837 : {
3908 1837 : tree _q50 = TREE_OPERAND (_q40, 0);
3909 1837 : tree _q51 = TREE_OPERAND (_q40, 1);
3910 1837 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _q20, 0))
3911 : {
3912 10 : if ((_q41 == _q51 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _q51, 0))
3913 : {
3914 10 : {
3915 10 : tree captures[4] ATTRIBUTE_UNUSED = { _q50, _q51, _q20, _q51 };
3916 10 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3917 10 : if (res) return res;
3918 : }
3919 : }
3920 : }
3921 : break;
3922 : }
3923 149463 : default:;
3924 : }
3925 149463 : switch (TREE_CODE (_q41))
3926 : {
3927 0 : case TRUNC_DIV_EXPR:
3928 0 : {
3929 0 : tree _q60 = TREE_OPERAND (_q41, 0);
3930 0 : tree _q61 = TREE_OPERAND (_q41, 1);
3931 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _q20, 0))
3932 : {
3933 0 : if ((_q61 == _q40 && ! TREE_SIDE_EFFECTS (_q61)) || operand_equal_p (_q61, _q40, 0))
3934 : {
3935 0 : {
3936 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q60, _q61, _q20, _q40 };
3937 0 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3938 0 : if (res) return res;
3939 : }
3940 : }
3941 : }
3942 : break;
3943 : }
3944 : default:;
3945 : }
3946 : break;
3947 : }
3948 : default:;
3949 : }
3950 : break;
3951 : }
3952 31107122 : default:;
3953 : }
3954 31107122 : switch (TREE_CODE (_p1))
3955 : {
3956 7650847 : CASE_CONVERT:
3957 7650847 : {
3958 7650847 : tree _q30 = TREE_OPERAND (_p1, 0);
3959 7650847 : switch (TREE_CODE (_q30))
3960 : {
3961 137624 : case MULT_EXPR:
3962 137624 : {
3963 137624 : tree _q40 = TREE_OPERAND (_q30, 0);
3964 137624 : tree _q41 = TREE_OPERAND (_q30, 1);
3965 137624 : switch (TREE_CODE (_q40))
3966 : {
3967 12 : case TRUNC_DIV_EXPR:
3968 12 : {
3969 12 : tree _q50 = TREE_OPERAND (_q40, 0);
3970 12 : tree _q51 = TREE_OPERAND (_q40, 1);
3971 12 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _p0, 0))
3972 : {
3973 2 : if ((_q41 == _q51 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _q51, 0))
3974 : {
3975 2 : {
3976 2 : tree captures[4] ATTRIBUTE_UNUSED = { _q50, _q51, _p0, _q51 };
3977 2 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3978 2 : if (res) return res;
3979 : }
3980 : }
3981 : }
3982 : break;
3983 : }
3984 137622 : default:;
3985 : }
3986 137622 : switch (TREE_CODE (_q41))
3987 : {
3988 0 : case TRUNC_DIV_EXPR:
3989 0 : {
3990 0 : tree _q60 = TREE_OPERAND (_q41, 0);
3991 0 : tree _q61 = TREE_OPERAND (_q41, 1);
3992 0 : if ((_q60 == _p0 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _p0, 0))
3993 : {
3994 0 : if ((_q61 == _q40 && ! TREE_SIDE_EFFECTS (_q61)) || operand_equal_p (_q61, _q40, 0))
3995 : {
3996 0 : {
3997 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q60, _q61, _p0, _q40 };
3998 0 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
3999 0 : if (res) return res;
4000 : }
4001 : }
4002 : }
4003 : break;
4004 : }
4005 : default:;
4006 : }
4007 : break;
4008 : }
4009 : default:;
4010 : }
4011 : break;
4012 : }
4013 2055266 : case MULT_EXPR:
4014 2055266 : {
4015 2055266 : tree _q30 = TREE_OPERAND (_p1, 0);
4016 2055266 : tree _q31 = TREE_OPERAND (_p1, 1);
4017 2055266 : switch (TREE_CODE (_q30))
4018 : {
4019 2360 : case TRUNC_DIV_EXPR:
4020 2360 : {
4021 2360 : tree _q40 = TREE_OPERAND (_q30, 0);
4022 2360 : tree _q41 = TREE_OPERAND (_q30, 1);
4023 2360 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || operand_equal_p (_q40, _p0, 0))
4024 : {
4025 52 : if ((_q31 == _q41 && ! TREE_SIDE_EFFECTS (_q31)) || operand_equal_p (_q31, _q41, 0))
4026 : {
4027 52 : {
4028 52 : tree captures[4] ATTRIBUTE_UNUSED = { _q40, _q41, _p0, _q41 };
4029 52 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
4030 52 : if (res) return res;
4031 : }
4032 : }
4033 : }
4034 : break;
4035 : }
4036 2055214 : default:;
4037 : }
4038 2055214 : switch (TREE_CODE (_q31))
4039 : {
4040 0 : case TRUNC_DIV_EXPR:
4041 0 : {
4042 0 : tree _q50 = TREE_OPERAND (_q31, 0);
4043 0 : tree _q51 = TREE_OPERAND (_q31, 1);
4044 0 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _p0, 0))
4045 : {
4046 0 : if ((_q51 == _q30 && ! TREE_SIDE_EFFECTS (_q51)) || operand_equal_p (_q51, _q30, 0))
4047 : {
4048 0 : {
4049 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q50, _q51, _p0, _q30 };
4050 0 : tree res = generic_simplify_86 (loc, type, _p0, _p1, captures);
4051 0 : if (res) return res;
4052 : }
4053 : }
4054 : }
4055 : break;
4056 : }
4057 : default:;
4058 : }
4059 : break;
4060 : }
4061 31107068 : default:;
4062 : }
4063 31107068 : switch (TREE_CODE (_p0))
4064 : {
4065 1907658 : case MULT_EXPR:
4066 1907658 : {
4067 1907658 : tree _q20 = TREE_OPERAND (_p0, 0);
4068 1907658 : tree _q21 = TREE_OPERAND (_p0, 1);
4069 1907658 : switch (TREE_CODE (_q21))
4070 : {
4071 595 : case PLUS_EXPR:
4072 595 : {
4073 595 : tree _q40 = TREE_OPERAND (_q21, 0);
4074 595 : tree _q41 = TREE_OPERAND (_q21, 1);
4075 595 : switch (TREE_CODE (_q40))
4076 : {
4077 0 : case TRUNC_DIV_EXPR:
4078 0 : {
4079 0 : tree _q50 = TREE_OPERAND (_q40, 0);
4080 0 : tree _q51 = TREE_OPERAND (_q40, 1);
4081 0 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
4082 : {
4083 0 : if (integer_onep (_q41))
4084 : {
4085 0 : if ((_p1 == _q50 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q50, 0) && types_match (_p1, _q50)))
4086 : {
4087 0 : {
4088 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q40, _q50 };
4089 0 : tree res = generic_simplify_87 (loc, type, _p0, _p1, captures);
4090 0 : if (res) return res;
4091 : }
4092 : }
4093 : }
4094 : }
4095 : break;
4096 : }
4097 : default:;
4098 : }
4099 : break;
4100 : }
4101 1907658 : default:;
4102 : }
4103 1907658 : switch (TREE_CODE (_q20))
4104 : {
4105 106910 : case PLUS_EXPR:
4106 106910 : {
4107 106910 : tree _q30 = TREE_OPERAND (_q20, 0);
4108 106910 : tree _q31 = TREE_OPERAND (_q20, 1);
4109 106910 : switch (TREE_CODE (_q30))
4110 : {
4111 1 : case TRUNC_DIV_EXPR:
4112 1 : {
4113 1 : tree _q40 = TREE_OPERAND (_q30, 0);
4114 1 : tree _q41 = TREE_OPERAND (_q30, 1);
4115 1 : if (integer_onep (_q31))
4116 : {
4117 1 : if ((_q21 == _q41 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q41, 0) && types_match (_q21, _q41)))
4118 : {
4119 1 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
4120 : {
4121 1 : {
4122 1 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q41, _q20, _q30, _q40 };
4123 1 : tree res = generic_simplify_87 (loc, type, _p0, _p1, captures);
4124 1 : if (res) return res;
4125 : }
4126 : }
4127 : }
4128 : }
4129 : break;
4130 : }
4131 : default:;
4132 : }
4133 : break;
4134 : }
4135 : default:;
4136 : }
4137 : break;
4138 : }
4139 1266 : case LSHIFT_EXPR:
4140 1266 : {
4141 1266 : tree _q20 = TREE_OPERAND (_p0, 0);
4142 1266 : tree _q21 = TREE_OPERAND (_p0, 1);
4143 1266 : switch (TREE_CODE (_p1))
4144 : {
4145 0 : case LSHIFT_EXPR:
4146 0 : {
4147 0 : tree _q50 = TREE_OPERAND (_p1, 0);
4148 0 : tree _q51 = TREE_OPERAND (_p1, 1);
4149 0 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4150 : {
4151 0 : {
4152 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1, _q50 };
4153 0 : tree res = generic_simplify_56 (loc, type, _p0, _p1, captures, MINUS_EXPR);
4154 0 : if (res) return res;
4155 : }
4156 : }
4157 : break;
4158 : }
4159 : default:;
4160 : }
4161 : break;
4162 : }
4163 1191 : case BIT_AND_EXPR:
4164 1191 : {
4165 1191 : tree _q20 = TREE_OPERAND (_p0, 0);
4166 1191 : tree _q21 = TREE_OPERAND (_p0, 1);
4167 1191 : switch (TREE_CODE (_q21))
4168 : {
4169 0 : case BIT_NOT_EXPR:
4170 0 : {
4171 0 : tree _q40 = TREE_OPERAND (_q21, 0);
4172 0 : switch (TREE_CODE (_p1))
4173 : {
4174 0 : case BIT_AND_EXPR:
4175 0 : {
4176 0 : tree _q60 = TREE_OPERAND (_p1, 0);
4177 0 : tree _q61 = TREE_OPERAND (_p1, 1);
4178 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
4179 : {
4180 0 : if ((_q61 == _q40 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q40, 0) && types_match (_q61, _q40)))
4181 : {
4182 0 : {
4183 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q40, _p1 };
4184 0 : tree res = generic_simplify_88 (loc, type, _p0, _p1, captures);
4185 0 : if (res) return res;
4186 : }
4187 : }
4188 : }
4189 0 : if ((_q60 == _q40 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q40, 0) && types_match (_q60, _q40)))
4190 : {
4191 0 : if ((_q61 == _q20 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q20, 0) && types_match (_q61, _q20)))
4192 : {
4193 0 : {
4194 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q40, _p1 };
4195 0 : tree res = generic_simplify_88 (loc, type, _p0, _p1, captures);
4196 0 : if (res) return res;
4197 : }
4198 : }
4199 : }
4200 : break;
4201 : }
4202 : default:;
4203 : }
4204 : break;
4205 : }
4206 1191 : default:;
4207 : }
4208 1191 : switch (TREE_CODE (_q20))
4209 : {
4210 27 : case BIT_NOT_EXPR:
4211 27 : {
4212 27 : tree _q30 = TREE_OPERAND (_q20, 0);
4213 27 : switch (TREE_CODE (_p1))
4214 : {
4215 21 : case BIT_AND_EXPR:
4216 21 : {
4217 21 : tree _q60 = TREE_OPERAND (_p1, 0);
4218 21 : tree _q61 = TREE_OPERAND (_p1, 1);
4219 21 : if ((_q60 == _q21 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q21, 0) && types_match (_q60, _q21)))
4220 : {
4221 0 : if ((_q61 == _q30 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q30, 0) && types_match (_q61, _q30)))
4222 : {
4223 0 : {
4224 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q21, _q30, _p1 };
4225 0 : tree res = generic_simplify_88 (loc, type, _p0, _p1, captures);
4226 0 : if (res) return res;
4227 : }
4228 : }
4229 : }
4230 21 : if ((_q60 == _q30 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q30, 0) && types_match (_q60, _q30)))
4231 : {
4232 21 : if ((_q61 == _q21 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q21, 0) && types_match (_q61, _q21)))
4233 : {
4234 21 : {
4235 21 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q21, _q30, _p1 };
4236 21 : tree res = generic_simplify_88 (loc, type, _p0, _p1, captures);
4237 21 : if (res) return res;
4238 : }
4239 : }
4240 : }
4241 : break;
4242 : }
4243 : default:;
4244 : }
4245 : break;
4246 : }
4247 1170 : default:;
4248 : }
4249 1170 : switch (TREE_CODE (_q21))
4250 : {
4251 1130 : case INTEGER_CST:
4252 1130 : {
4253 1130 : switch (TREE_CODE (_p1))
4254 : {
4255 28 : case BIT_AND_EXPR:
4256 28 : {
4257 28 : tree _q50 = TREE_OPERAND (_p1, 0);
4258 28 : tree _q51 = TREE_OPERAND (_p1, 1);
4259 28 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4260 : {
4261 6 : switch (TREE_CODE (_q51))
4262 : {
4263 6 : case INTEGER_CST:
4264 6 : {
4265 6 : {
4266 6 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1, _q51 };
4267 6 : if (~wi::to_wide (captures[2]) == wi::to_wide (captures[4])
4268 : )
4269 : {
4270 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1292;
4271 0 : {
4272 0 : if (! tree_invariant_p (captures[4])) goto next_after_fail1292;
4273 0 : tree res_op0;
4274 0 : {
4275 0 : tree _o1[2], _r1;
4276 0 : _o1[0] = captures[1];
4277 0 : _o1[1] = unshare_expr (captures[4]);
4278 0 : _r1 = fold_build2_loc (loc, BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4279 0 : res_op0 = _r1;
4280 : }
4281 0 : tree res_op1;
4282 0 : res_op1 = captures[4];
4283 0 : tree _r;
4284 0 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
4285 0 : if (TREE_SIDE_EFFECTS (captures[2]))
4286 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
4287 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 928, __FILE__, __LINE__, true);
4288 0 : return _r;
4289 : }
4290 6 : next_after_fail1292:;
4291 : }
4292 : }
4293 6 : break;
4294 : }
4295 : default:;
4296 : }
4297 : }
4298 : break;
4299 : }
4300 : default:;
4301 : }
4302 : break;
4303 : }
4304 1170 : default:;
4305 : }
4306 1170 : switch (TREE_CODE (_p1))
4307 : {
4308 31 : case BIT_AND_EXPR:
4309 31 : {
4310 31 : tree _q50 = TREE_OPERAND (_p1, 0);
4311 31 : tree _q51 = TREE_OPERAND (_p1, 1);
4312 31 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4313 : {
4314 6 : switch (TREE_CODE (_q51))
4315 : {
4316 0 : case BIT_NOT_EXPR:
4317 0 : {
4318 0 : tree _q70 = TREE_OPERAND (_q51, 0);
4319 0 : if ((_q70 == _q21 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q21, 0) && types_match (_q70, _q21)))
4320 : {
4321 0 : {
4322 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
4323 0 : tree res = generic_simplify_89 (loc, type, _p0, _p1, captures);
4324 0 : if (res) return res;
4325 : }
4326 : }
4327 : break;
4328 : }
4329 : default:;
4330 : }
4331 : }
4332 31 : switch (TREE_CODE (_q50))
4333 : {
4334 0 : case BIT_NOT_EXPR:
4335 0 : {
4336 0 : tree _q60 = TREE_OPERAND (_q50, 0);
4337 0 : if ((_q60 == _q21 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q21, 0) && types_match (_q60, _q21)))
4338 : {
4339 0 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
4340 : {
4341 0 : {
4342 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
4343 0 : tree res = generic_simplify_89 (loc, type, _p0, _p1, captures);
4344 0 : if (res) return res;
4345 : }
4346 : }
4347 : }
4348 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
4349 : {
4350 0 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4351 : {
4352 0 : {
4353 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _p1 };
4354 0 : tree res = generic_simplify_89 (loc, type, _p0, _p1, captures);
4355 0 : if (res) return res;
4356 : }
4357 : }
4358 : }
4359 : break;
4360 : }
4361 31 : default:;
4362 : }
4363 31 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
4364 : {
4365 0 : switch (TREE_CODE (_q51))
4366 : {
4367 0 : case BIT_NOT_EXPR:
4368 0 : {
4369 0 : tree _q70 = TREE_OPERAND (_q51, 0);
4370 0 : if ((_q70 == _q20 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q20, 0) && types_match (_q70, _q20)))
4371 : {
4372 0 : {
4373 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _p1 };
4374 0 : tree res = generic_simplify_89 (loc, type, _p0, _p1, captures);
4375 0 : if (res) return res;
4376 : }
4377 : }
4378 : break;
4379 : }
4380 : default:;
4381 : }
4382 : }
4383 : break;
4384 : }
4385 2 : case PLUS_EXPR:
4386 2 : {
4387 2 : tree _q50 = TREE_OPERAND (_p1, 0);
4388 2 : tree _q51 = TREE_OPERAND (_p1, 1);
4389 2 : switch (TREE_CODE (_q50))
4390 : {
4391 2 : case BIT_IOR_EXPR:
4392 2 : {
4393 2 : tree _q60 = TREE_OPERAND (_q50, 0);
4394 2 : tree _q61 = TREE_OPERAND (_q50, 1);
4395 2 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
4396 : {
4397 2 : if ((_q61 == _q21 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q21, 0) && types_match (_q61, _q21)))
4398 : {
4399 2 : if (integer_onep (_q51))
4400 : {
4401 2 : {
4402 2 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
4403 2 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4404 2 : if (res) return res;
4405 : }
4406 : }
4407 : }
4408 : }
4409 0 : if ((_q60 == _q21 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q21, 0) && types_match (_q60, _q21)))
4410 : {
4411 0 : if ((_q61 == _q20 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q20, 0) && types_match (_q61, _q20)))
4412 : {
4413 0 : if (integer_onep (_q51))
4414 : {
4415 0 : {
4416 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
4417 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4418 0 : if (res) return res;
4419 : }
4420 : }
4421 : }
4422 : }
4423 : break;
4424 : }
4425 0 : default:;
4426 : }
4427 0 : {
4428 0 : tree _q50_pops[1];
4429 0 : if (tree_nop_convert (_q50, _q50_pops))
4430 : {
4431 0 : tree _q60 = _q50_pops[0];
4432 0 : switch (TREE_CODE (_q60))
4433 : {
4434 0 : case BIT_IOR_EXPR:
4435 0 : {
4436 0 : tree _q70 = TREE_OPERAND (_q60, 0);
4437 0 : tree _q71 = TREE_OPERAND (_q60, 1);
4438 0 : if ((_q70 == _q20 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q20, 0) && types_match (_q70, _q20)))
4439 : {
4440 0 : if ((_q71 == _q21 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q21, 0) && types_match (_q71, _q21)))
4441 : {
4442 0 : if (integer_onep (_q51))
4443 : {
4444 0 : {
4445 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
4446 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4447 0 : if (res) return res;
4448 : }
4449 : }
4450 : }
4451 : }
4452 0 : if ((_q70 == _q21 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q21, 0) && types_match (_q70, _q21)))
4453 : {
4454 0 : if ((_q71 == _q20 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q20, 0) && types_match (_q71, _q20)))
4455 : {
4456 0 : if (integer_onep (_q51))
4457 : {
4458 0 : {
4459 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
4460 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4461 0 : if (res) return res;
4462 : }
4463 : }
4464 : }
4465 : }
4466 : break;
4467 : }
4468 : default:;
4469 : }
4470 : }
4471 : }
4472 0 : break;
4473 : }
4474 1168 : default:;
4475 : }
4476 1168 : {
4477 1168 : tree _p1_pops[1];
4478 1168 : if (tree_nop_convert (_p1, _p1_pops))
4479 : {
4480 7 : tree _q50 = _p1_pops[0];
4481 7 : switch (TREE_CODE (_q50))
4482 : {
4483 0 : case PLUS_EXPR:
4484 0 : {
4485 0 : tree _q60 = TREE_OPERAND (_q50, 0);
4486 0 : tree _q61 = TREE_OPERAND (_q50, 1);
4487 0 : switch (TREE_CODE (_q60))
4488 : {
4489 0 : case BIT_IOR_EXPR:
4490 0 : {
4491 0 : tree _q70 = TREE_OPERAND (_q60, 0);
4492 0 : tree _q71 = TREE_OPERAND (_q60, 1);
4493 0 : if ((_q70 == _q20 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q20, 0) && types_match (_q70, _q20)))
4494 : {
4495 0 : if ((_q71 == _q21 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q21, 0) && types_match (_q71, _q21)))
4496 : {
4497 0 : if (integer_onep (_q61))
4498 : {
4499 0 : {
4500 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
4501 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4502 0 : if (res) return res;
4503 : }
4504 : }
4505 : }
4506 : }
4507 0 : if ((_q70 == _q21 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q21, 0) && types_match (_q70, _q21)))
4508 : {
4509 0 : if ((_q71 == _q20 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q20, 0) && types_match (_q71, _q20)))
4510 : {
4511 0 : if (integer_onep (_q61))
4512 : {
4513 0 : {
4514 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
4515 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4516 0 : if (res) return res;
4517 : }
4518 : }
4519 : }
4520 : }
4521 : break;
4522 : }
4523 0 : default:;
4524 : }
4525 0 : {
4526 0 : tree _q60_pops[1];
4527 0 : if (tree_nop_convert (_q60, _q60_pops))
4528 : {
4529 0 : tree _q70 = _q60_pops[0];
4530 0 : switch (TREE_CODE (_q70))
4531 : {
4532 0 : case BIT_IOR_EXPR:
4533 0 : {
4534 0 : tree _q80 = TREE_OPERAND (_q70, 0);
4535 0 : tree _q81 = TREE_OPERAND (_q70, 1);
4536 0 : if ((_q80 == _q20 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q20, 0) && types_match (_q80, _q20)))
4537 : {
4538 0 : if ((_q81 == _q21 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q21, 0) && types_match (_q81, _q21)))
4539 : {
4540 0 : if (integer_onep (_q61))
4541 : {
4542 0 : {
4543 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
4544 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4545 0 : if (res) return res;
4546 : }
4547 : }
4548 : }
4549 : }
4550 0 : if ((_q80 == _q21 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q21, 0) && types_match (_q80, _q21)))
4551 : {
4552 0 : if ((_q81 == _q20 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q20, 0) && types_match (_q81, _q20)))
4553 : {
4554 0 : if (integer_onep (_q61))
4555 : {
4556 0 : {
4557 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
4558 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
4559 0 : if (res) return res;
4560 : }
4561 : }
4562 : }
4563 : }
4564 : break;
4565 : }
4566 : default:;
4567 : }
4568 : }
4569 : }
4570 0 : break;
4571 : }
4572 : default:;
4573 : }
4574 : }
4575 : }
4576 1168 : break;
4577 : }
4578 3278 : case BIT_NOT_EXPR:
4579 3278 : {
4580 3278 : tree _q20 = TREE_OPERAND (_p0, 0);
4581 3278 : switch (TREE_CODE (_p1))
4582 : {
4583 22 : case BIT_NOT_EXPR:
4584 22 : {
4585 22 : tree _q40 = TREE_OPERAND (_p1, 0);
4586 22 : {
4587 22 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
4588 22 : if (!TYPE_OVERFLOW_SANITIZED (type)
4589 : )
4590 : {
4591 9 : {
4592 9 : tree utype = unsigned_type_for (type);
4593 9 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1293;
4594 9 : {
4595 9 : tree res_op0;
4596 9 : {
4597 9 : tree _o1[2], _r1;
4598 9 : {
4599 9 : tree _o2[1], _r2;
4600 9 : _o2[0] = captures[1];
4601 9 : if (TREE_TYPE (_o2[0]) != utype)
4602 : {
4603 9 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
4604 : }
4605 : else
4606 : _r2 = _o2[0];
4607 9 : _o1[0] = _r2;
4608 : }
4609 9 : {
4610 9 : tree _o2[1], _r2;
4611 9 : _o2[0] = captures[0];
4612 9 : if (TREE_TYPE (_o2[0]) != utype)
4613 : {
4614 9 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
4615 : }
4616 : else
4617 : _r2 = _o2[0];
4618 9 : _o1[1] = _r2;
4619 : }
4620 9 : _r1 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4621 9 : res_op0 = _r1;
4622 : }
4623 9 : tree _r;
4624 9 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
4625 9 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 929, __FILE__, __LINE__, true);
4626 9 : return _r;
4627 : }
4628 0 : next_after_fail1293:;
4629 : }
4630 : }
4631 : }
4632 13 : break;
4633 : }
4634 : default:;
4635 : }
4636 : break;
4637 : }
4638 2309041 : case PLUS_EXPR:
4639 2309041 : {
4640 2309041 : tree _q20 = TREE_OPERAND (_p0, 0);
4641 2309041 : tree _q21 = TREE_OPERAND (_p0, 1);
4642 2309041 : switch (TREE_CODE (_p1))
4643 : {
4644 14 : case BIT_IOR_EXPR:
4645 14 : {
4646 14 : tree _q50 = TREE_OPERAND (_p1, 0);
4647 14 : tree _q51 = TREE_OPERAND (_p1, 1);
4648 14 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4649 : {
4650 13 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4651 : {
4652 13 : {
4653 13 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4654 13 : tree res = generic_simplify_91 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR);
4655 13 : if (res) return res;
4656 : }
4657 : }
4658 : }
4659 : break;
4660 : }
4661 82 : case BIT_AND_EXPR:
4662 82 : {
4663 82 : tree _q50 = TREE_OPERAND (_p1, 0);
4664 82 : tree _q51 = TREE_OPERAND (_p1, 1);
4665 82 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4666 : {
4667 25 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4668 : {
4669 13 : {
4670 13 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4671 13 : tree res = generic_simplify_91 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR);
4672 13 : if (res) return res;
4673 : }
4674 : }
4675 : }
4676 : break;
4677 : }
4678 2309041 : default:;
4679 : }
4680 2309041 : switch (TREE_CODE (_q20))
4681 : {
4682 593 : case BIT_AND_EXPR:
4683 593 : {
4684 593 : tree _q30 = TREE_OPERAND (_q20, 0);
4685 593 : tree _q31 = TREE_OPERAND (_q20, 1);
4686 593 : if (integer_all_onesp (_q21))
4687 : {
4688 1 : switch (TREE_CODE (_p1))
4689 : {
4690 1 : case BIT_IOR_EXPR:
4691 1 : {
4692 1 : tree _q70 = TREE_OPERAND (_p1, 0);
4693 1 : tree _q71 = TREE_OPERAND (_p1, 1);
4694 1 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
4695 : {
4696 1 : if ((_q71 == _q31 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q31, 0) && types_match (_q71, _q31)))
4697 : {
4698 1 : {
4699 1 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
4700 1 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4701 1 : if (res) return res;
4702 : }
4703 : }
4704 : }
4705 0 : if ((_q70 == _q31 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q31, 0) && types_match (_q70, _q31)))
4706 : {
4707 0 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
4708 : {
4709 0 : {
4710 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q31, _q30 };
4711 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4712 0 : if (res) return res;
4713 : }
4714 : }
4715 : }
4716 : break;
4717 : }
4718 0 : default:;
4719 : }
4720 0 : {
4721 0 : tree _p1_pops[1];
4722 0 : if (tree_nop_convert (_p1, _p1_pops))
4723 : {
4724 0 : tree _q70 = _p1_pops[0];
4725 0 : switch (TREE_CODE (_q70))
4726 : {
4727 0 : case BIT_IOR_EXPR:
4728 0 : {
4729 0 : tree _q80 = TREE_OPERAND (_q70, 0);
4730 0 : tree _q81 = TREE_OPERAND (_q70, 1);
4731 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
4732 : {
4733 0 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
4734 : {
4735 0 : {
4736 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
4737 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4738 0 : if (res) return res;
4739 : }
4740 : }
4741 : }
4742 0 : if ((_q80 == _q31 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q31, 0) && types_match (_q80, _q31)))
4743 : {
4744 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
4745 : {
4746 0 : {
4747 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q31, _q30 };
4748 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4749 0 : if (res) return res;
4750 : }
4751 : }
4752 : }
4753 : break;
4754 : }
4755 : default:;
4756 : }
4757 : }
4758 : }
4759 : }
4760 : break;
4761 : }
4762 2309040 : default:;
4763 : }
4764 2309040 : {
4765 2309040 : tree _q20_pops[1];
4766 2309040 : if (tree_nop_convert (_q20, _q20_pops))
4767 : {
4768 543259 : tree _q30 = _q20_pops[0];
4769 543259 : switch (TREE_CODE (_q30))
4770 : {
4771 0 : case BIT_AND_EXPR:
4772 0 : {
4773 0 : tree _q40 = TREE_OPERAND (_q30, 0);
4774 0 : tree _q41 = TREE_OPERAND (_q30, 1);
4775 0 : if (integer_all_onesp (_q21))
4776 : {
4777 0 : switch (TREE_CODE (_p1))
4778 : {
4779 0 : case BIT_IOR_EXPR:
4780 0 : {
4781 0 : tree _q80 = TREE_OPERAND (_p1, 0);
4782 0 : tree _q81 = TREE_OPERAND (_p1, 1);
4783 0 : if ((_q80 == _q40 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q40, 0) && types_match (_q80, _q40)))
4784 : {
4785 0 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
4786 : {
4787 0 : {
4788 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q40, _q41 };
4789 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4790 0 : if (res) return res;
4791 : }
4792 : }
4793 : }
4794 0 : if ((_q80 == _q41 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q41, 0) && types_match (_q80, _q41)))
4795 : {
4796 0 : if ((_q81 == _q40 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q40, 0) && types_match (_q81, _q40)))
4797 : {
4798 0 : {
4799 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q41, _q40 };
4800 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4801 0 : if (res) return res;
4802 : }
4803 : }
4804 : }
4805 : break;
4806 : }
4807 0 : default:;
4808 : }
4809 0 : {
4810 0 : tree _p1_pops[1];
4811 0 : if (tree_nop_convert (_p1, _p1_pops))
4812 : {
4813 0 : tree _q80 = _p1_pops[0];
4814 0 : switch (TREE_CODE (_q80))
4815 : {
4816 0 : case BIT_IOR_EXPR:
4817 0 : {
4818 0 : tree _q90 = TREE_OPERAND (_q80, 0);
4819 0 : tree _q91 = TREE_OPERAND (_q80, 1);
4820 0 : if ((_q90 == _q40 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q40, 0) && types_match (_q90, _q40)))
4821 : {
4822 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
4823 : {
4824 0 : {
4825 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q40, _q41 };
4826 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4827 0 : if (res) return res;
4828 : }
4829 : }
4830 : }
4831 0 : if ((_q90 == _q41 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q41, 0) && types_match (_q90, _q41)))
4832 : {
4833 0 : if ((_q91 == _q40 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q40, 0) && types_match (_q91, _q40)))
4834 : {
4835 0 : {
4836 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q41, _q40 };
4837 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4838 0 : if (res) return res;
4839 : }
4840 : }
4841 : }
4842 : break;
4843 : }
4844 : default:;
4845 : }
4846 : }
4847 : }
4848 : }
4849 : break;
4850 : }
4851 : default:;
4852 : }
4853 : }
4854 : }
4855 2309040 : break;
4856 : }
4857 81 : case BIT_IOR_EXPR:
4858 81 : {
4859 81 : tree _q20 = TREE_OPERAND (_p0, 0);
4860 81 : tree _q21 = TREE_OPERAND (_p0, 1);
4861 81 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
4862 : {
4863 5 : {
4864 5 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
4865 5 : tree res = generic_simplify_93 (loc, type, _p0, _p1, captures);
4866 5 : if (res) return res;
4867 : }
4868 : }
4869 76 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
4870 : {
4871 0 : {
4872 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q21, _q20 };
4873 0 : tree res = generic_simplify_93 (loc, type, _p0, _p1, captures);
4874 0 : if (res) return res;
4875 : }
4876 : }
4877 76 : switch (TREE_CODE (_p1))
4878 : {
4879 0 : case BIT_XOR_EXPR:
4880 0 : {
4881 0 : tree _q50 = TREE_OPERAND (_p1, 0);
4882 0 : tree _q51 = TREE_OPERAND (_p1, 1);
4883 0 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4884 : {
4885 0 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4886 : {
4887 0 : {
4888 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4889 0 : tree res = generic_simplify_94 (loc, type, _p0, _p1, captures, BIT_XOR_EXPR, BIT_AND_EXPR);
4890 0 : if (res) return res;
4891 : }
4892 : }
4893 : }
4894 : break;
4895 : }
4896 0 : case BIT_AND_EXPR:
4897 0 : {
4898 0 : tree _q50 = TREE_OPERAND (_p1, 0);
4899 0 : tree _q51 = TREE_OPERAND (_p1, 1);
4900 0 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
4901 : {
4902 0 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
4903 : {
4904 0 : {
4905 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4906 0 : tree res = generic_simplify_94 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_XOR_EXPR);
4907 0 : if (res) return res;
4908 : }
4909 : }
4910 : }
4911 : break;
4912 : }
4913 : default:;
4914 : }
4915 : break;
4916 : }
4917 31107029 : default:;
4918 : }
4919 31107029 : {
4920 31107029 : tree _p0_pops[1];
4921 31107029 : if (tree_nop_convert (_p0, _p0_pops))
4922 : {
4923 7521439 : tree _q20 = _p0_pops[0];
4924 7521439 : switch (TREE_CODE (_q20))
4925 : {
4926 1042517 : case PLUS_EXPR:
4927 1042517 : {
4928 1042517 : tree _q30 = TREE_OPERAND (_q20, 0);
4929 1042517 : tree _q31 = TREE_OPERAND (_q20, 1);
4930 1042517 : switch (TREE_CODE (_q30))
4931 : {
4932 8 : case BIT_AND_EXPR:
4933 8 : {
4934 8 : tree _q40 = TREE_OPERAND (_q30, 0);
4935 8 : tree _q41 = TREE_OPERAND (_q30, 1);
4936 8 : if (integer_all_onesp (_q31))
4937 : {
4938 0 : switch (TREE_CODE (_p1))
4939 : {
4940 0 : case BIT_IOR_EXPR:
4941 0 : {
4942 0 : tree _q80 = TREE_OPERAND (_p1, 0);
4943 0 : tree _q81 = TREE_OPERAND (_p1, 1);
4944 0 : if ((_q80 == _q40 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q40, 0) && types_match (_q80, _q40)))
4945 : {
4946 0 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
4947 : {
4948 0 : {
4949 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q40, _q41 };
4950 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4951 0 : if (res) return res;
4952 : }
4953 : }
4954 : }
4955 0 : if ((_q80 == _q41 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q41, 0) && types_match (_q80, _q41)))
4956 : {
4957 0 : if ((_q81 == _q40 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q40, 0) && types_match (_q81, _q40)))
4958 : {
4959 0 : {
4960 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q41, _q40 };
4961 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4962 0 : if (res) return res;
4963 : }
4964 : }
4965 : }
4966 : break;
4967 : }
4968 0 : default:;
4969 : }
4970 0 : {
4971 0 : tree _p1_pops[1];
4972 0 : if (tree_nop_convert (_p1, _p1_pops))
4973 : {
4974 0 : tree _q80 = _p1_pops[0];
4975 0 : switch (TREE_CODE (_q80))
4976 : {
4977 0 : case BIT_IOR_EXPR:
4978 0 : {
4979 0 : tree _q90 = TREE_OPERAND (_q80, 0);
4980 0 : tree _q91 = TREE_OPERAND (_q80, 1);
4981 0 : if ((_q90 == _q40 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q40, 0) && types_match (_q90, _q40)))
4982 : {
4983 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
4984 : {
4985 0 : {
4986 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q40, _q41 };
4987 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4988 0 : if (res) return res;
4989 : }
4990 : }
4991 : }
4992 0 : if ((_q90 == _q41 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q41, 0) && types_match (_q90, _q41)))
4993 : {
4994 0 : if ((_q91 == _q40 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q40, 0) && types_match (_q91, _q40)))
4995 : {
4996 0 : {
4997 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q41, _q40 };
4998 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
4999 0 : if (res) return res;
5000 : }
5001 : }
5002 : }
5003 : break;
5004 : }
5005 : default:;
5006 : }
5007 : }
5008 : }
5009 : }
5010 : break;
5011 : }
5012 1042517 : default:;
5013 : }
5014 1042517 : {
5015 1042517 : tree _q30_pops[1];
5016 1042517 : if (tree_nop_convert (_q30, _q30_pops))
5017 : {
5018 41485 : tree _q40 = _q30_pops[0];
5019 41485 : switch (TREE_CODE (_q40))
5020 : {
5021 0 : case BIT_AND_EXPR:
5022 0 : {
5023 0 : tree _q50 = TREE_OPERAND (_q40, 0);
5024 0 : tree _q51 = TREE_OPERAND (_q40, 1);
5025 0 : if (integer_all_onesp (_q31))
5026 : {
5027 0 : switch (TREE_CODE (_p1))
5028 : {
5029 0 : case BIT_IOR_EXPR:
5030 0 : {
5031 0 : tree _q90 = TREE_OPERAND (_p1, 0);
5032 0 : tree _q91 = TREE_OPERAND (_p1, 1);
5033 0 : if ((_q90 == _q50 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q50, 0) && types_match (_q90, _q50)))
5034 : {
5035 0 : if ((_q91 == _q51 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q51, 0) && types_match (_q91, _q51)))
5036 : {
5037 0 : {
5038 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q50, _q51 };
5039 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
5040 0 : if (res) return res;
5041 : }
5042 : }
5043 : }
5044 0 : if ((_q90 == _q51 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q51, 0) && types_match (_q90, _q51)))
5045 : {
5046 0 : if ((_q91 == _q50 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q50, 0) && types_match (_q91, _q50)))
5047 : {
5048 0 : {
5049 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q51, _q50 };
5050 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
5051 0 : if (res) return res;
5052 : }
5053 : }
5054 : }
5055 : break;
5056 : }
5057 0 : default:;
5058 : }
5059 0 : {
5060 0 : tree _p1_pops[1];
5061 0 : if (tree_nop_convert (_p1, _p1_pops))
5062 : {
5063 0 : tree _q90 = _p1_pops[0];
5064 0 : switch (TREE_CODE (_q90))
5065 : {
5066 0 : case BIT_IOR_EXPR:
5067 0 : {
5068 0 : tree _q100 = TREE_OPERAND (_q90, 0);
5069 0 : tree _q101 = TREE_OPERAND (_q90, 1);
5070 0 : if ((_q100 == _q50 && ! TREE_SIDE_EFFECTS (_q100)) || (operand_equal_p (_q100, _q50, 0) && types_match (_q100, _q50)))
5071 : {
5072 0 : if ((_q101 == _q51 && ! TREE_SIDE_EFFECTS (_q101)) || (operand_equal_p (_q101, _q51, 0) && types_match (_q101, _q51)))
5073 : {
5074 0 : {
5075 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q50, _q51 };
5076 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
5077 0 : if (res) return res;
5078 : }
5079 : }
5080 : }
5081 0 : if ((_q100 == _q51 && ! TREE_SIDE_EFFECTS (_q100)) || (operand_equal_p (_q100, _q51, 0) && types_match (_q100, _q51)))
5082 : {
5083 0 : if ((_q101 == _q50 && ! TREE_SIDE_EFFECTS (_q101)) || (operand_equal_p (_q101, _q50, 0) && types_match (_q101, _q50)))
5084 : {
5085 0 : {
5086 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q51, _q50 };
5087 0 : tree res = generic_simplify_92 (loc, type, _p0, _p1, captures);
5088 0 : if (res) return res;
5089 : }
5090 : }
5091 : }
5092 : break;
5093 : }
5094 : default:;
5095 : }
5096 : }
5097 : }
5098 : }
5099 : break;
5100 : }
5101 : default:;
5102 : }
5103 : }
5104 : }
5105 1042517 : break;
5106 : }
5107 14 : case BIT_AND_EXPR:
5108 14 : {
5109 14 : tree _q30 = TREE_OPERAND (_q20, 0);
5110 14 : tree _q31 = TREE_OPERAND (_q20, 1);
5111 14 : switch (TREE_CODE (_p1))
5112 : {
5113 0 : case PLUS_EXPR:
5114 0 : {
5115 0 : tree _q60 = TREE_OPERAND (_p1, 0);
5116 0 : tree _q61 = TREE_OPERAND (_p1, 1);
5117 0 : switch (TREE_CODE (_q60))
5118 : {
5119 0 : case BIT_IOR_EXPR:
5120 0 : {
5121 0 : tree _q70 = TREE_OPERAND (_q60, 0);
5122 0 : tree _q71 = TREE_OPERAND (_q60, 1);
5123 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
5124 : {
5125 0 : if ((_q71 == _q31 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q31, 0) && types_match (_q71, _q31)))
5126 : {
5127 0 : if (integer_onep (_q61))
5128 : {
5129 0 : {
5130 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
5131 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5132 0 : if (res) return res;
5133 : }
5134 : }
5135 : }
5136 : }
5137 0 : if ((_q70 == _q31 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q31, 0) && types_match (_q70, _q31)))
5138 : {
5139 0 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
5140 : {
5141 0 : if (integer_onep (_q61))
5142 : {
5143 0 : {
5144 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
5145 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5146 0 : if (res) return res;
5147 : }
5148 : }
5149 : }
5150 : }
5151 : break;
5152 : }
5153 0 : default:;
5154 : }
5155 0 : {
5156 0 : tree _q60_pops[1];
5157 0 : if (tree_nop_convert (_q60, _q60_pops))
5158 : {
5159 0 : tree _q70 = _q60_pops[0];
5160 0 : switch (TREE_CODE (_q70))
5161 : {
5162 0 : case BIT_IOR_EXPR:
5163 0 : {
5164 0 : tree _q80 = TREE_OPERAND (_q70, 0);
5165 0 : tree _q81 = TREE_OPERAND (_q70, 1);
5166 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
5167 : {
5168 0 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
5169 : {
5170 0 : if (integer_onep (_q61))
5171 : {
5172 0 : {
5173 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
5174 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5175 0 : if (res) return res;
5176 : }
5177 : }
5178 : }
5179 : }
5180 0 : if ((_q80 == _q31 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q31, 0) && types_match (_q80, _q31)))
5181 : {
5182 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
5183 : {
5184 0 : if (integer_onep (_q61))
5185 : {
5186 0 : {
5187 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
5188 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5189 0 : if (res) return res;
5190 : }
5191 : }
5192 : }
5193 : }
5194 : break;
5195 : }
5196 : default:;
5197 : }
5198 : }
5199 : }
5200 0 : break;
5201 : }
5202 14 : default:;
5203 : }
5204 14 : {
5205 14 : tree _p1_pops[1];
5206 14 : if (tree_nop_convert (_p1, _p1_pops))
5207 : {
5208 14 : tree _q60 = _p1_pops[0];
5209 14 : switch (TREE_CODE (_q60))
5210 : {
5211 0 : case PLUS_EXPR:
5212 0 : {
5213 0 : tree _q70 = TREE_OPERAND (_q60, 0);
5214 0 : tree _q71 = TREE_OPERAND (_q60, 1);
5215 0 : switch (TREE_CODE (_q70))
5216 : {
5217 0 : case BIT_IOR_EXPR:
5218 0 : {
5219 0 : tree _q80 = TREE_OPERAND (_q70, 0);
5220 0 : tree _q81 = TREE_OPERAND (_q70, 1);
5221 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
5222 : {
5223 0 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
5224 : {
5225 0 : if (integer_onep (_q71))
5226 : {
5227 0 : {
5228 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q60 };
5229 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5230 0 : if (res) return res;
5231 : }
5232 : }
5233 : }
5234 : }
5235 0 : if ((_q80 == _q31 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q31, 0) && types_match (_q80, _q31)))
5236 : {
5237 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
5238 : {
5239 0 : if (integer_onep (_q71))
5240 : {
5241 0 : {
5242 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q60 };
5243 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5244 0 : if (res) return res;
5245 : }
5246 : }
5247 : }
5248 : }
5249 : break;
5250 : }
5251 0 : default:;
5252 : }
5253 0 : {
5254 0 : tree _q70_pops[1];
5255 0 : if (tree_nop_convert (_q70, _q70_pops))
5256 : {
5257 0 : tree _q80 = _q70_pops[0];
5258 0 : switch (TREE_CODE (_q80))
5259 : {
5260 0 : case BIT_IOR_EXPR:
5261 0 : {
5262 0 : tree _q90 = TREE_OPERAND (_q80, 0);
5263 0 : tree _q91 = TREE_OPERAND (_q80, 1);
5264 0 : if ((_q90 == _q30 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q30, 0) && types_match (_q90, _q30)))
5265 : {
5266 0 : if ((_q91 == _q31 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q31, 0) && types_match (_q91, _q31)))
5267 : {
5268 0 : if (integer_onep (_q71))
5269 : {
5270 0 : {
5271 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q60 };
5272 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5273 0 : if (res) return res;
5274 : }
5275 : }
5276 : }
5277 : }
5278 0 : if ((_q90 == _q31 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q31, 0) && types_match (_q90, _q31)))
5279 : {
5280 0 : if ((_q91 == _q30 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q30, 0) && types_match (_q91, _q30)))
5281 : {
5282 0 : if (integer_onep (_q71))
5283 : {
5284 0 : {
5285 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q60 };
5286 0 : tree res = generic_simplify_90 (loc, type, _p0, _p1, captures);
5287 0 : if (res) return res;
5288 : }
5289 : }
5290 : }
5291 : }
5292 : break;
5293 : }
5294 : default:;
5295 : }
5296 : }
5297 : }
5298 0 : break;
5299 : }
5300 : default:;
5301 : }
5302 : }
5303 : }
5304 14 : break;
5305 : }
5306 : default:;
5307 : }
5308 : }
5309 : }
5310 31107029 : if (tree_negate_expr_p (_p1))
5311 : {
5312 7748964 : {
5313 7748964 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
5314 7748964 : if (!FIXED_POINT_TYPE_P (type)
5315 : )
5316 : {
5317 7748964 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1294;
5318 7748964 : {
5319 7748964 : tree res_op0;
5320 7748964 : res_op0 = captures[0];
5321 7748964 : tree res_op1;
5322 7748964 : {
5323 7748964 : tree _o1[1], _r1;
5324 7748964 : _o1[0] = captures[1];
5325 7748964 : _r1 = fold_build1_loc (loc, NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
5326 7748964 : res_op1 = _r1;
5327 : }
5328 7748964 : tree _r;
5329 7748964 : _r = fold_build2_loc (loc, PLUS_EXPR, type, res_op0, res_op1);
5330 7748964 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 930, __FILE__, __LINE__, true);
5331 7748964 : return _r;
5332 : }
5333 0 : next_after_fail1294:;
5334 : }
5335 : }
5336 : }
5337 23358065 : switch (TREE_CODE (_p0))
5338 : {
5339 5142049 : CASE_CONVERT:
5340 5142049 : {
5341 5142049 : tree _q20 = TREE_OPERAND (_p0, 0);
5342 5142049 : switch (TREE_CODE (_p1))
5343 : {
5344 4281787 : CASE_CONVERT:
5345 4281787 : {
5346 4281787 : tree _q40 = TREE_OPERAND (_p1, 0);
5347 4281787 : switch (TREE_CODE (_q40))
5348 : {
5349 15 : case BIT_AND_EXPR:
5350 15 : {
5351 15 : tree _q50 = TREE_OPERAND (_q40, 0);
5352 15 : tree _q51 = TREE_OPERAND (_q40, 1);
5353 15 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _q20, 0))
5354 : {
5355 0 : {
5356 0 : tree captures[5] ATTRIBUTE_UNUSED = { _q50, _p1, _q40, _q51, _q20 };
5357 0 : tree res = generic_simplify_95 (loc, type, _p0, _p1, captures);
5358 0 : if (res) return res;
5359 : }
5360 : }
5361 15 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || operand_equal_p (_q51, _q20, 0))
5362 : {
5363 1 : {
5364 1 : tree captures[5] ATTRIBUTE_UNUSED = { _q51, _p1, _q40, _q50, _q20 };
5365 1 : tree res = generic_simplify_95 (loc, type, _p0, _p1, captures);
5366 1 : if (res) return res;
5367 : }
5368 : }
5369 : break;
5370 : }
5371 : default:;
5372 : }
5373 : break;
5374 : }
5375 5349 : case BIT_AND_EXPR:
5376 5349 : {
5377 5349 : tree _q40 = TREE_OPERAND (_p1, 0);
5378 5349 : tree _q41 = TREE_OPERAND (_p1, 1);
5379 5349 : if ((_q40 == _q20 && ! TREE_SIDE_EFFECTS (_q40)) || operand_equal_p (_q40, _q20, 0))
5380 : {
5381 0 : {
5382 0 : tree captures[5] ATTRIBUTE_UNUSED = { _q40, _p1, _p1, _q41, _q20 };
5383 0 : tree res = generic_simplify_96 (loc, type, _p0, _p1, captures);
5384 0 : if (res) return res;
5385 : }
5386 : }
5387 5349 : if ((_q41 == _q20 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _q20, 0))
5388 : {
5389 21 : {
5390 21 : tree captures[5] ATTRIBUTE_UNUSED = { _q41, _p1, _p1, _q40, _q20 };
5391 21 : tree res = generic_simplify_96 (loc, type, _p0, _p1, captures);
5392 21 : if (res) return res;
5393 : }
5394 : }
5395 : break;
5396 : }
5397 5142027 : default:;
5398 : }
5399 5142027 : switch (TREE_CODE (_q20))
5400 : {
5401 118750 : case ADDR_EXPR:
5402 118750 : {
5403 118750 : switch (TREE_CODE (_p1))
5404 : {
5405 110230 : CASE_CONVERT:
5406 110230 : {
5407 110230 : tree _q40 = TREE_OPERAND (_p1, 0);
5408 110230 : switch (TREE_CODE (_q40))
5409 : {
5410 32544 : case POINTER_PLUS_EXPR:
5411 32544 : {
5412 32544 : tree _q50 = TREE_OPERAND (_q40, 0);
5413 32544 : tree _q51 = TREE_OPERAND (_q40, 1);
5414 32544 : {
5415 32544 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q50, _q51 };
5416 32544 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[0]))
5417 : )
5418 : {
5419 32544 : {
5420 32544 : poly_int64 diff;
5421 32544 : if (ptr_difference_const (captures[0], captures[1], &diff)
5422 : )
5423 : {
5424 16862 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1295;
5425 16862 : {
5426 16862 : tree res_op0;
5427 16862 : res_op0 = build_int_cst_type (type, diff);
5428 16862 : tree res_op1;
5429 16862 : {
5430 16862 : tree _o1[1], _r1;
5431 16862 : _o1[0] = captures[2];
5432 16862 : if (TREE_TYPE (_o1[0]) != type)
5433 : {
5434 16862 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
5435 : }
5436 : else
5437 : _r1 = _o1[0];
5438 16862 : res_op1 = _r1;
5439 : }
5440 16862 : tree _r;
5441 16862 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5442 16862 : if (TREE_SIDE_EFFECTS (captures[0]))
5443 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
5444 16862 : if (TREE_SIDE_EFFECTS (captures[1]))
5445 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5446 16862 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 931, __FILE__, __LINE__, true);
5447 16862 : return _r;
5448 : }
5449 0 : next_after_fail1295:;
5450 : }
5451 : }
5452 : }
5453 : }
5454 15682 : break;
5455 : }
5456 93368 : default:;
5457 : }
5458 93368 : {
5459 93368 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
5460 93368 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[0]))
5461 : )
5462 : {
5463 93368 : {
5464 93368 : poly_int64 diff;
5465 93368 : if (ptr_difference_const (captures[0], captures[1], &diff)
5466 : )
5467 : {
5468 57373 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1296;
5469 57373 : {
5470 57373 : tree _r;
5471 57373 : _r = build_int_cst_type (type, diff);
5472 57373 : if (TREE_SIDE_EFFECTS (captures[0]))
5473 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
5474 57373 : if (TREE_SIDE_EFFECTS (captures[1]))
5475 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5476 57373 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 932, __FILE__, __LINE__, true);
5477 57373 : return _r;
5478 : }
5479 0 : next_after_fail1296:;
5480 : }
5481 : }
5482 : }
5483 : }
5484 35995 : break;
5485 : }
5486 : default:;
5487 : }
5488 : break;
5489 : }
5490 107347 : case POINTER_PLUS_EXPR:
5491 107347 : {
5492 107347 : tree _q30 = TREE_OPERAND (_q20, 0);
5493 107347 : tree _q31 = TREE_OPERAND (_q20, 1);
5494 107347 : switch (TREE_CODE (_p1))
5495 : {
5496 106273 : CASE_CONVERT:
5497 106273 : {
5498 106273 : tree _q60 = TREE_OPERAND (_p1, 0);
5499 106273 : switch (TREE_CODE (_q60))
5500 : {
5501 5791 : case ADDR_EXPR:
5502 5791 : {
5503 5791 : {
5504 5791 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q60 };
5505 5791 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[0]))
5506 : )
5507 : {
5508 5791 : {
5509 5791 : poly_int64 diff;
5510 5791 : if (ptr_difference_const (captures[0], captures[2], &diff)
5511 : )
5512 : {
5513 997 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1297;
5514 997 : {
5515 997 : tree res_op0;
5516 997 : {
5517 997 : tree _o1[1], _r1;
5518 997 : _o1[0] = captures[1];
5519 997 : if (TREE_TYPE (_o1[0]) != type)
5520 : {
5521 928 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
5522 : }
5523 : else
5524 : _r1 = _o1[0];
5525 997 : res_op0 = _r1;
5526 : }
5527 997 : tree res_op1;
5528 997 : res_op1 = build_int_cst_type (type, diff);
5529 997 : tree _r;
5530 997 : _r = fold_build2_loc (loc, PLUS_EXPR, type, res_op0, res_op1);
5531 997 : if (TREE_SIDE_EFFECTS (captures[0]))
5532 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
5533 997 : if (TREE_SIDE_EFFECTS (captures[2]))
5534 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
5535 997 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 933, __FILE__, __LINE__, true);
5536 997 : return _r;
5537 : }
5538 0 : next_after_fail1297:;
5539 : }
5540 : }
5541 : }
5542 : }
5543 4794 : break;
5544 : }
5545 : default:;
5546 : }
5547 : break;
5548 : }
5549 : default:;
5550 : }
5551 : break;
5552 : }
5553 5066795 : default:;
5554 : }
5555 5066795 : switch (TREE_CODE (_p1))
5556 : {
5557 4206554 : CASE_CONVERT:
5558 4206554 : {
5559 4206554 : tree _q40 = TREE_OPERAND (_p1, 0);
5560 4206554 : switch (TREE_CODE (_q40))
5561 : {
5562 49487 : case ADDR_EXPR:
5563 49487 : {
5564 49487 : {
5565 49487 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
5566 49487 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[0]))
5567 : )
5568 : {
5569 49466 : {
5570 49466 : poly_int64 diff;
5571 49466 : if (ptr_difference_const (captures[0], captures[1], &diff)
5572 : )
5573 : {
5574 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1298;
5575 0 : {
5576 0 : tree _r;
5577 0 : _r = build_int_cst_type (type, diff);
5578 0 : if (TREE_SIDE_EFFECTS (captures[0]))
5579 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
5580 0 : if (TREE_SIDE_EFFECTS (captures[1]))
5581 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5582 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 934, __FILE__, __LINE__, true);
5583 0 : return _r;
5584 : }
5585 0 : next_after_fail1298:;
5586 : }
5587 : }
5588 : }
5589 : }
5590 49487 : break;
5591 : }
5592 : default:;
5593 : }
5594 : break;
5595 : }
5596 : default:;
5597 : }
5598 : break;
5599 : }
5600 23282811 : default:;
5601 : }
5602 23282811 : if (integer_onep (_p0))
5603 : {
5604 106000 : switch (TREE_CODE (_p1))
5605 : {
5606 27699 : case SSA_NAME:
5607 27699 : {
5608 27699 : {
5609 27699 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
5610 27699 : if (INTEGRAL_TYPE_P (type)
5611 27699 : && ssa_name_has_boolean_range (captures[1])
5612 : )
5613 : {
5614 226 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1299;
5615 226 : {
5616 226 : tree res_op0;
5617 226 : res_op0 = captures[1];
5618 226 : tree res_op1;
5619 226 : res_op1 = captures[0];
5620 226 : tree _r;
5621 226 : _r = fold_build2_loc (loc, BIT_XOR_EXPR, type, res_op0, res_op1);
5622 226 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 935, __FILE__, __LINE__, true);
5623 226 : return _r;
5624 : }
5625 0 : next_after_fail1299:;
5626 : }
5627 : }
5628 27473 : break;
5629 : }
5630 : default:;
5631 : }
5632 : }
5633 23282585 : switch (TREE_CODE (_p1))
5634 : {
5635 7575612 : CASE_CONVERT:
5636 7575612 : {
5637 7575612 : tree _q30 = TREE_OPERAND (_p1, 0);
5638 7575612 : switch (TREE_CODE (_q30))
5639 : {
5640 14 : case BIT_AND_EXPR:
5641 14 : {
5642 14 : tree _q40 = TREE_OPERAND (_q30, 0);
5643 14 : tree _q41 = TREE_OPERAND (_q30, 1);
5644 14 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || operand_equal_p (_q40, _p0, 0))
5645 : {
5646 0 : {
5647 0 : tree captures[5] ATTRIBUTE_UNUSED = { _q40, _p1, _q30, _q41, _p0 };
5648 0 : tree res = generic_simplify_95 (loc, type, _p0, _p1, captures);
5649 0 : if (res) return res;
5650 : }
5651 : }
5652 14 : if ((_q41 == _p0 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _p0, 0))
5653 : {
5654 0 : {
5655 0 : tree captures[5] ATTRIBUTE_UNUSED = { _q41, _p1, _q30, _q40, _p0 };
5656 0 : tree res = generic_simplify_95 (loc, type, _p0, _p1, captures);
5657 0 : if (res) return res;
5658 : }
5659 : }
5660 : break;
5661 : }
5662 : default:;
5663 : }
5664 : break;
5665 : }
5666 7495 : case BIT_AND_EXPR:
5667 7495 : {
5668 7495 : tree _q30 = TREE_OPERAND (_p1, 0);
5669 7495 : tree _q31 = TREE_OPERAND (_p1, 1);
5670 7495 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || operand_equal_p (_q30, _p0, 0))
5671 : {
5672 217 : {
5673 217 : tree captures[5] ATTRIBUTE_UNUSED = { _q30, _p1, _p1, _q31, _p0 };
5674 217 : tree res = generic_simplify_96 (loc, type, _p0, _p1, captures);
5675 217 : if (res) return res;
5676 : }
5677 : }
5678 7278 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || operand_equal_p (_q31, _p0, 0))
5679 : {
5680 38 : {
5681 38 : tree captures[5] ATTRIBUTE_UNUSED = { _q31, _p1, _p1, _q30, _p0 };
5682 38 : tree res = generic_simplify_96 (loc, type, _p0, _p1, captures);
5683 38 : if (res) return res;
5684 : }
5685 : }
5686 : break;
5687 : }
5688 23282330 : default:;
5689 : }
5690 23282330 : switch (TREE_CODE (_p0))
5691 : {
5692 1764382 : case PLUS_EXPR:
5693 1764382 : {
5694 1764382 : tree _q20 = TREE_OPERAND (_p0, 0);
5695 1764382 : tree _q21 = TREE_OPERAND (_p0, 1);
5696 1764382 : switch (TREE_CODE (_p1))
5697 : {
5698 483120 : case PLUS_EXPR:
5699 483120 : {
5700 483120 : tree _q50 = TREE_OPERAND (_p1, 0);
5701 483120 : tree _q51 = TREE_OPERAND (_p1, 1);
5702 483120 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
5703 : {
5704 178040 : {
5705 178040 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
5706 356080 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
5707 356080 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5708 40084 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0])))
5709 : )
5710 : {
5711 178034 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1300;
5712 178034 : {
5713 178034 : tree res_op0;
5714 178034 : res_op0 = captures[0];
5715 178034 : tree res_op1;
5716 178034 : res_op1 = captures[2];
5717 178034 : tree _r;
5718 178034 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5719 178034 : if (TREE_SIDE_EFFECTS (captures[1]))
5720 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5721 178034 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 936, __FILE__, __LINE__, true);
5722 178034 : return _r;
5723 : }
5724 0 : next_after_fail1300:;
5725 : }
5726 : }
5727 : }
5728 305086 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
5729 : {
5730 602 : {
5731 602 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
5732 1204 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
5733 1204 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5734 492 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0])))
5735 : )
5736 : {
5737 602 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1301;
5738 602 : {
5739 602 : tree res_op0;
5740 602 : res_op0 = captures[0];
5741 602 : tree res_op1;
5742 602 : res_op1 = captures[2];
5743 602 : tree _r;
5744 602 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5745 602 : if (TREE_SIDE_EFFECTS (captures[1]))
5746 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5747 602 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 936, __FILE__, __LINE__, true);
5748 602 : return _r;
5749 : }
5750 0 : next_after_fail1301:;
5751 : }
5752 : }
5753 : }
5754 304484 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
5755 : {
5756 475 : {
5757 475 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q50 };
5758 950 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
5759 950 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5760 386 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0])))
5761 : )
5762 : {
5763 475 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1302;
5764 475 : {
5765 475 : tree res_op0;
5766 475 : res_op0 = captures[0];
5767 475 : tree res_op1;
5768 475 : res_op1 = captures[2];
5769 475 : tree _r;
5770 475 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5771 475 : if (TREE_SIDE_EFFECTS (captures[1]))
5772 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5773 475 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 936, __FILE__, __LINE__, true);
5774 475 : return _r;
5775 : }
5776 0 : next_after_fail1302:;
5777 : }
5778 : }
5779 : }
5780 304009 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
5781 : {
5782 174904 : {
5783 174904 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q51 };
5784 349808 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
5785 349808 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5786 141793 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0])))
5787 : )
5788 : {
5789 174904 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1303;
5790 174904 : {
5791 174904 : tree res_op0;
5792 174904 : res_op0 = captures[0];
5793 174904 : tree res_op1;
5794 174904 : res_op1 = captures[2];
5795 174904 : tree _r;
5796 174904 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5797 174904 : if (TREE_SIDE_EFFECTS (captures[1]))
5798 2 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5799 174904 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 936, __FILE__, __LINE__, true);
5800 174904 : return _r;
5801 : }
5802 0 : next_after_fail1303:;
5803 : }
5804 : }
5805 : }
5806 : break;
5807 : }
5808 : default:;
5809 : }
5810 : break;
5811 : }
5812 977898 : case MINUS_EXPR:
5813 977898 : {
5814 977898 : tree _q20 = TREE_OPERAND (_p0, 0);
5815 977898 : tree _q21 = TREE_OPERAND (_p0, 1);
5816 977898 : switch (TREE_CODE (_p1))
5817 : {
5818 97 : case MINUS_EXPR:
5819 97 : {
5820 97 : tree _q50 = TREE_OPERAND (_p1, 0);
5821 97 : tree _q51 = TREE_OPERAND (_p1, 1);
5822 97 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
5823 : {
5824 55 : {
5825 55 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
5826 110 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
5827 110 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5828 0 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0])))
5829 : )
5830 : {
5831 55 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1304;
5832 55 : {
5833 55 : tree res_op0;
5834 55 : res_op0 = captures[0];
5835 55 : tree res_op1;
5836 55 : res_op1 = captures[2];
5837 55 : tree _r;
5838 55 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5839 55 : if (TREE_SIDE_EFFECTS (captures[1]))
5840 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5841 55 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 937, __FILE__, __LINE__, true);
5842 55 : return _r;
5843 : }
5844 0 : next_after_fail1304:;
5845 : }
5846 : }
5847 : }
5848 42 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
5849 : {
5850 0 : {
5851 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
5852 0 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
5853 0 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[1]))
5854 0 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[1])))
5855 : )
5856 : {
5857 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1305;
5858 0 : {
5859 0 : tree res_op0;
5860 0 : res_op0 = captures[2];
5861 0 : tree res_op1;
5862 0 : res_op1 = captures[1];
5863 0 : tree _r;
5864 0 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
5865 0 : if (TREE_SIDE_EFFECTS (captures[0]))
5866 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
5867 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 938, __FILE__, __LINE__, true);
5868 0 : return _r;
5869 : }
5870 0 : next_after_fail1305:;
5871 : }
5872 : }
5873 : }
5874 : break;
5875 : }
5876 : default:;
5877 : }
5878 : break;
5879 : }
5880 59 : case POINTER_DIFF_EXPR:
5881 59 : {
5882 59 : tree _q20 = TREE_OPERAND (_p0, 0);
5883 59 : tree _q21 = TREE_OPERAND (_p0, 1);
5884 59 : switch (TREE_CODE (_p1))
5885 : {
5886 0 : case POINTER_DIFF_EXPR:
5887 0 : {
5888 0 : tree _q50 = TREE_OPERAND (_p1, 0);
5889 0 : tree _q51 = TREE_OPERAND (_p1, 1);
5890 0 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
5891 : {
5892 0 : {
5893 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q50 };
5894 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5895 0 : && !TYPE_OVERFLOW_SANITIZED (TREE_TYPE (captures[2]))
5896 : )
5897 : {
5898 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1306;
5899 0 : {
5900 0 : tree res_op0;
5901 0 : res_op0 = captures[1];
5902 0 : tree res_op1;
5903 0 : res_op1 = captures[3];
5904 0 : tree _r;
5905 0 : _r = fold_build2_loc (loc, POINTER_DIFF_EXPR, type, res_op0, res_op1);
5906 0 : if (TREE_SIDE_EFFECTS (captures[2]))
5907 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
5908 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 939, __FILE__, __LINE__, true);
5909 0 : return _r;
5910 : }
5911 0 : next_after_fail1306:;
5912 : }
5913 : }
5914 : }
5915 0 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
5916 : {
5917 0 : {
5918 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q51 };
5919 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
5920 0 : && !TYPE_OVERFLOW_SANITIZED (TREE_TYPE (captures[1]))
5921 : )
5922 : {
5923 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1307;
5924 0 : {
5925 0 : tree res_op0;
5926 0 : res_op0 = captures[3];
5927 0 : tree res_op1;
5928 0 : res_op1 = captures[2];
5929 0 : tree _r;
5930 0 : _r = fold_build2_loc (loc, POINTER_DIFF_EXPR, type, res_op0, res_op1);
5931 0 : if (TREE_SIDE_EFFECTS (captures[1]))
5932 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
5933 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 940, __FILE__, __LINE__, true);
5934 0 : return _r;
5935 : }
5936 0 : next_after_fail1307:;
5937 : }
5938 : }
5939 : }
5940 : break;
5941 : }
5942 : default:;
5943 : }
5944 : break;
5945 : }
5946 22928260 : default:;
5947 : }
5948 22928260 : switch (TREE_CODE (_p1))
5949 : {
5950 7575612 : CASE_CONVERT:
5951 7575612 : {
5952 7575612 : tree _q30 = TREE_OPERAND (_p1, 0);
5953 7575612 : switch (TREE_CODE (_q30))
5954 : {
5955 2998 : case NEGATE_EXPR:
5956 2998 : {
5957 2998 : tree _q40 = TREE_OPERAND (_q30, 0);
5958 2998 : {
5959 2998 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q40 };
5960 2998 : tree res = generic_simplify_97 (loc, type, _p0, _p1, captures);
5961 2998 : if (res) return res;
5962 : }
5963 2990 : break;
5964 : }
5965 : default:;
5966 : }
5967 : break;
5968 : }
5969 45 : case NEGATE_EXPR:
5970 45 : {
5971 45 : tree _q30 = TREE_OPERAND (_p1, 0);
5972 45 : {
5973 45 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
5974 45 : tree res = generic_simplify_97 (loc, type, _p0, _p1, captures);
5975 45 : if (res) return res;
5976 : }
5977 40 : break;
5978 : }
5979 22928247 : default:;
5980 : }
5981 22928247 : switch (TREE_CODE (_p0))
5982 : {
5983 1410367 : case PLUS_EXPR:
5984 1410367 : {
5985 1410367 : tree _q20 = TREE_OPERAND (_p0, 0);
5986 1410367 : tree _q21 = TREE_OPERAND (_p0, 1);
5987 1410367 : {
5988 1410367 : tree _q20_pops[1];
5989 1410367 : if (tree_nop_convert (_q20, _q20_pops))
5990 : {
5991 332709 : tree _q30 = _q20_pops[0];
5992 332709 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
5993 : {
5994 393 : {
5995 393 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q21 };
5996 393 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
5997 393 : if (res) return res;
5998 : }
5999 : }
6000 : }
6001 : }
6002 1409974 : {
6003 1409974 : tree _q21_pops[1];
6004 1409974 : if (tree_nop_convert (_q21, _q21_pops))
6005 : {
6006 474814 : tree _q40 = _q21_pops[0];
6007 474814 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
6008 : {
6009 79 : {
6010 79 : tree captures[2] ATTRIBUTE_UNUSED = { _q40, _q20 };
6011 79 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6012 79 : if (res) return res;
6013 : }
6014 : }
6015 : }
6016 : }
6017 1409895 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
6018 : {
6019 54850 : {
6020 54850 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
6021 54850 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6022 54850 : if (res) return res;
6023 : }
6024 : }
6025 1355045 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
6026 : {
6027 1886 : {
6028 1886 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
6029 1886 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6030 1886 : if (res) return res;
6031 : }
6032 : }
6033 : break;
6034 : }
6035 977843 : case MINUS_EXPR:
6036 977843 : {
6037 977843 : tree _q20 = TREE_OPERAND (_p0, 0);
6038 977843 : tree _q21 = TREE_OPERAND (_p0, 1);
6039 977843 : {
6040 977843 : tree _q20_pops[1];
6041 977843 : if (tree_nop_convert (_q20, _q20_pops))
6042 : {
6043 85259 : tree _q30 = _q20_pops[0];
6044 85259 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
6045 : {
6046 0 : {
6047 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q21 };
6048 0 : tree res = generic_simplify_99 (loc, type, _p0, _p1, captures);
6049 0 : if (res) return res;
6050 : }
6051 : }
6052 : }
6053 : }
6054 977843 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
6055 : {
6056 170 : {
6057 170 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
6058 170 : tree res = generic_simplify_99 (loc, type, _p0, _p1, captures);
6059 170 : if (res) return res;
6060 : }
6061 : }
6062 : break;
6063 : }
6064 22870880 : default:;
6065 : }
6066 22870880 : {
6067 22870880 : tree _p0_pops[1];
6068 22870880 : if (tree_nop_convert (_p0, _p0_pops))
6069 : {
6070 4512751 : tree _q20 = _p0_pops[0];
6071 4512751 : switch (TREE_CODE (_q20))
6072 : {
6073 360822 : case PLUS_EXPR:
6074 360822 : {
6075 360822 : tree _q30 = TREE_OPERAND (_q20, 0);
6076 360822 : tree _q31 = TREE_OPERAND (_q20, 1);
6077 360822 : {
6078 360822 : tree _q30_pops[1];
6079 360822 : if (tree_nop_convert (_q30, _q30_pops))
6080 : {
6081 28554 : tree _q40 = _q30_pops[0];
6082 28554 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
6083 : {
6084 574 : {
6085 574 : tree captures[2] ATTRIBUTE_UNUSED = { _q40, _q31 };
6086 574 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6087 574 : if (res) return res;
6088 : }
6089 : }
6090 : }
6091 : }
6092 360248 : {
6093 360248 : tree _q31_pops[1];
6094 360248 : if (tree_nop_convert (_q31, _q31_pops))
6095 : {
6096 2683 : tree _q50 = _q31_pops[0];
6097 2683 : if ((_p1 == _q50 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q50, 0) && types_match (_p1, _q50)))
6098 : {
6099 52 : {
6100 52 : tree captures[2] ATTRIBUTE_UNUSED = { _q50, _q30 };
6101 52 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6102 52 : if (res) return res;
6103 : }
6104 : }
6105 : }
6106 : }
6107 360196 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
6108 : {
6109 12 : {
6110 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q31 };
6111 12 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6112 12 : if (res) return res;
6113 : }
6114 : }
6115 360184 : if ((_p1 == _q31 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q31, 0) && types_match (_p1, _q31)))
6116 : {
6117 0 : {
6118 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q31, _q30 };
6119 0 : tree res = generic_simplify_98 (loc, type, _p0, _p1, captures);
6120 0 : if (res) return res;
6121 : }
6122 : }
6123 : break;
6124 : }
6125 706 : case MINUS_EXPR:
6126 706 : {
6127 706 : tree _q30 = TREE_OPERAND (_q20, 0);
6128 706 : tree _q31 = TREE_OPERAND (_q20, 1);
6129 706 : {
6130 706 : tree _q30_pops[1];
6131 706 : if (tree_nop_convert (_q30, _q30_pops))
6132 : {
6133 0 : tree _q40 = _q30_pops[0];
6134 0 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
6135 : {
6136 0 : {
6137 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q40, _q31 };
6138 0 : tree res = generic_simplify_99 (loc, type, _p0, _p1, captures);
6139 0 : if (res) return res;
6140 : }
6141 : }
6142 : }
6143 : }
6144 706 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
6145 : {
6146 0 : {
6147 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q31 };
6148 0 : tree res = generic_simplify_99 (loc, type, _p0, _p1, captures);
6149 0 : if (res) return res;
6150 : }
6151 : }
6152 : break;
6153 : }
6154 : default:;
6155 : }
6156 : }
6157 : }
6158 22870242 : switch (TREE_CODE (_p1))
6159 : {
6160 1292246 : case PLUS_EXPR:
6161 1292246 : {
6162 1292246 : tree _q30 = TREE_OPERAND (_p1, 0);
6163 1292246 : tree _q31 = TREE_OPERAND (_p1, 1);
6164 1292246 : {
6165 1292246 : tree _q30_pops[1];
6166 1292246 : if (tree_nop_convert (_q30, _q30_pops))
6167 : {
6168 341269 : tree _q40 = _q30_pops[0];
6169 341269 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
6170 : {
6171 71 : {
6172 71 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
6173 71 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6174 71 : if (res) return res;
6175 : }
6176 : }
6177 : }
6178 : }
6179 1292175 : {
6180 1292175 : tree _q31_pops[1];
6181 1292175 : if (tree_nop_convert (_q31, _q31_pops))
6182 : {
6183 74460 : tree _q50 = _q31_pops[0];
6184 74460 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
6185 : {
6186 0 : {
6187 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
6188 0 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6189 0 : if (res) return res;
6190 : }
6191 : }
6192 : }
6193 : }
6194 1292175 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
6195 : {
6196 41726 : {
6197 41726 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
6198 41726 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6199 41726 : if (res) return res;
6200 : }
6201 : }
6202 1250449 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
6203 : {
6204 1587 : {
6205 1587 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
6206 1587 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6207 1587 : if (res) return res;
6208 : }
6209 : }
6210 : break;
6211 : }
6212 82712 : case MINUS_EXPR:
6213 82712 : {
6214 82712 : tree _q30 = TREE_OPERAND (_p1, 0);
6215 82712 : tree _q31 = TREE_OPERAND (_p1, 1);
6216 82712 : {
6217 82712 : tree _q30_pops[1];
6218 82712 : if (tree_nop_convert (_q30, _q30_pops))
6219 : {
6220 61 : tree _q40 = _q30_pops[0];
6221 61 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
6222 : {
6223 0 : {
6224 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
6225 0 : tree res = generic_simplify_101 (loc, type, _p0, _p1, captures);
6226 0 : if (res) return res;
6227 : }
6228 : }
6229 : }
6230 : }
6231 82712 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
6232 : {
6233 315 : {
6234 315 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
6235 315 : tree res = generic_simplify_101 (loc, type, _p0, _p1, captures);
6236 315 : if (res) return res;
6237 : }
6238 : }
6239 : break;
6240 : }
6241 22826543 : default:;
6242 : }
6243 22826543 : {
6244 22826543 : tree _p1_pops[1];
6245 22826543 : if (tree_nop_convert (_p1, _p1_pops))
6246 : {
6247 6923601 : tree _q30 = _p1_pops[0];
6248 6923601 : switch (TREE_CODE (_q30))
6249 : {
6250 679955 : case PLUS_EXPR:
6251 679955 : {
6252 679955 : tree _q40 = TREE_OPERAND (_q30, 0);
6253 679955 : tree _q41 = TREE_OPERAND (_q30, 1);
6254 679955 : {
6255 679955 : tree _q40_pops[1];
6256 679955 : if (tree_nop_convert (_q40, _q40_pops))
6257 : {
6258 60548 : tree _q50 = _q40_pops[0];
6259 60548 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
6260 : {
6261 163 : {
6262 163 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
6263 163 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6264 163 : if (res) return res;
6265 : }
6266 : }
6267 : }
6268 : }
6269 679792 : {
6270 679792 : tree _q41_pops[1];
6271 679792 : if (tree_nop_convert (_q41, _q41_pops))
6272 : {
6273 20291 : tree _q60 = _q41_pops[0];
6274 20291 : if ((_q60 == _p0 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _p0, 0) && types_match (_q60, _p0)))
6275 : {
6276 0 : {
6277 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q40 };
6278 0 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6279 0 : if (res) return res;
6280 : }
6281 : }
6282 : }
6283 : }
6284 679792 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
6285 : {
6286 7 : {
6287 7 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
6288 7 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6289 7 : if (res) return res;
6290 : }
6291 : }
6292 679785 : if ((_q41 == _p0 && ! TREE_SIDE_EFFECTS (_q41)) || (operand_equal_p (_q41, _p0, 0) && types_match (_q41, _p0)))
6293 : {
6294 0 : {
6295 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q40 };
6296 0 : tree res = generic_simplify_100 (loc, type, _p0, _p1, captures);
6297 0 : if (res) return res;
6298 : }
6299 : }
6300 : break;
6301 : }
6302 7626 : case MINUS_EXPR:
6303 7626 : {
6304 7626 : tree _q40 = TREE_OPERAND (_q30, 0);
6305 7626 : tree _q41 = TREE_OPERAND (_q30, 1);
6306 7626 : {
6307 7626 : tree _q40_pops[1];
6308 7626 : if (tree_nop_convert (_q40, _q40_pops))
6309 : {
6310 6814 : tree _q50 = _q40_pops[0];
6311 6814 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
6312 : {
6313 0 : {
6314 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
6315 0 : tree res = generic_simplify_101 (loc, type, _p0, _p1, captures);
6316 0 : if (res) return res;
6317 : }
6318 : }
6319 : }
6320 : }
6321 7626 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
6322 : {
6323 2 : {
6324 2 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
6325 2 : tree res = generic_simplify_101 (loc, type, _p0, _p1, captures);
6326 2 : if (res) return res;
6327 : }
6328 : }
6329 : break;
6330 : }
6331 : default:;
6332 : }
6333 : }
6334 : }
6335 22826371 : switch (TREE_CODE (_p0))
6336 : {
6337 1353170 : case PLUS_EXPR:
6338 1353170 : {
6339 1353170 : tree _q20 = TREE_OPERAND (_p0, 0);
6340 1353170 : tree _q21 = TREE_OPERAND (_p0, 1);
6341 1353170 : switch (TREE_CODE (_p1))
6342 : {
6343 112 : case MINUS_EXPR:
6344 112 : {
6345 112 : tree _q50 = TREE_OPERAND (_p1, 0);
6346 112 : tree _q51 = TREE_OPERAND (_p1, 1);
6347 112 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
6348 : {
6349 0 : {
6350 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
6351 0 : tree res = generic_simplify_102 (loc, type, _p0, _p1, captures);
6352 0 : if (res) return res;
6353 : }
6354 : }
6355 112 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
6356 : {
6357 0 : {
6358 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q51 };
6359 0 : tree res = generic_simplify_102 (loc, type, _p0, _p1, captures);
6360 0 : if (res) return res;
6361 : }
6362 : }
6363 : break;
6364 : }
6365 1353170 : default:;
6366 : }
6367 1353170 : if (CONSTANT_CLASS_P (_q21))
6368 : {
6369 570862 : if (CONSTANT_CLASS_P (_p1))
6370 : {
6371 13 : {
6372 13 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
6373 13 : tree res = generic_simplify_62 (loc, type, _p0, _p1, captures, PLUS_EXPR, MINUS_EXPR, MINUS_EXPR);
6374 13 : if (res) return res;
6375 : }
6376 : }
6377 : }
6378 : break;
6379 : }
6380 977670 : case MINUS_EXPR:
6381 977670 : {
6382 977670 : tree _q20 = TREE_OPERAND (_p0, 0);
6383 977670 : tree _q21 = TREE_OPERAND (_p0, 1);
6384 977670 : if (CONSTANT_CLASS_P (_q21))
6385 : {
6386 96557 : if (CONSTANT_CLASS_P (_p1))
6387 : {
6388 12 : {
6389 12 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
6390 12 : tree res = generic_simplify_62 (loc, type, _p0, _p1, captures, MINUS_EXPR, PLUS_EXPR, MINUS_EXPR);
6391 12 : if (res) return res;
6392 : }
6393 : }
6394 : }
6395 977670 : if (CONSTANT_CLASS_P (_q20))
6396 : {
6397 2952 : if (CONSTANT_CLASS_P (_p1))
6398 : {
6399 1 : {
6400 1 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
6401 1 : tree res = generic_simplify_63 (loc, type, _p0, _p1, captures, MINUS_EXPR);
6402 1 : if (res) return res;
6403 : }
6404 : }
6405 : }
6406 : break;
6407 : }
6408 5048591 : CASE_CONVERT:
6409 5048591 : {
6410 5048591 : tree _q20 = TREE_OPERAND (_p0, 0);
6411 5048591 : switch (TREE_CODE (_p1))
6412 : {
6413 4206542 : CASE_CONVERT:
6414 4206542 : {
6415 4206542 : tree _q40 = TREE_OPERAND (_p1, 0);
6416 4206542 : {
6417 4206542 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
6418 4206542 : tree res = generic_simplify_67 (loc, type, _p0, _p1, captures, MINUS_EXPR);
6419 4206542 : if (res) return res;
6420 : }
6421 4196108 : break;
6422 : }
6423 5038157 : default:;
6424 : }
6425 5038157 : switch (TREE_CODE (_q20))
6426 : {
6427 272 : case NEGATE_EXPR:
6428 272 : {
6429 272 : tree _q30 = TREE_OPERAND (_q20, 0);
6430 272 : if (integer_each_onep (_p1))
6431 : {
6432 0 : {
6433 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q30 };
6434 0 : tree res = generic_simplify_104 (loc, type, _p0, _p1, captures);
6435 0 : if (res) return res;
6436 : }
6437 : }
6438 : break;
6439 : }
6440 413342 : case PLUS_EXPR:
6441 413342 : {
6442 413342 : tree _q30 = TREE_OPERAND (_q20, 0);
6443 413342 : tree _q31 = TREE_OPERAND (_q20, 1);
6444 413342 : switch (TREE_CODE (_p1))
6445 : {
6446 396093 : CASE_CONVERT:
6447 396093 : {
6448 396093 : tree _q60 = TREE_OPERAND (_p1, 0);
6449 396093 : if ((_q60 == _q30 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _q30, 0))
6450 : {
6451 6635 : {
6452 6635 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q30 };
6453 6635 : tree res = generic_simplify_105 (loc, type, _p0, _p1, captures);
6454 6635 : if (res) return res;
6455 : }
6456 : }
6457 389578 : if ((_q60 == _q31 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _q31, 0))
6458 : {
6459 22 : {
6460 22 : tree captures[3] ATTRIBUTE_UNUSED = { _q31, _q30, _q31 };
6461 22 : tree res = generic_simplify_105 (loc, type, _p0, _p1, captures);
6462 22 : if (res) return res;
6463 : }
6464 : }
6465 : break;
6466 : }
6467 406805 : default:;
6468 : }
6469 406805 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || operand_equal_p (_p1, _q30, 0))
6470 : {
6471 4247 : {
6472 4247 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q30 };
6473 4247 : tree res = generic_simplify_105 (loc, type, _p0, _p1, captures);
6474 4247 : if (res) return res;
6475 : }
6476 : }
6477 402558 : if ((_p1 == _q31 && ! TREE_SIDE_EFFECTS (_p1)) || operand_equal_p (_p1, _q31, 0))
6478 : {
6479 1344 : {
6480 1344 : tree captures[3] ATTRIBUTE_UNUSED = { _q31, _q30, _q31 };
6481 1344 : tree res = generic_simplify_105 (loc, type, _p0, _p1, captures);
6482 1344 : if (res) return res;
6483 : }
6484 : }
6485 : break;
6486 : }
6487 106350 : case POINTER_PLUS_EXPR:
6488 106350 : {
6489 106350 : tree _q30 = TREE_OPERAND (_q20, 0);
6490 106350 : tree _q31 = TREE_OPERAND (_q20, 1);
6491 106350 : switch (TREE_CODE (_p1))
6492 : {
6493 105276 : CASE_CONVERT:
6494 105276 : {
6495 105276 : tree _q60 = TREE_OPERAND (_p1, 0);
6496 105276 : if ((_q60 == _q30 && ! TREE_SIDE_EFFECTS (_q60)) || operand_equal_p (_q60, _q30, 0))
6497 : {
6498 12191 : {
6499 12191 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _q30 };
6500 12191 : if (!TYPE_SATURATING (type)
6501 : )
6502 : {
6503 12191 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
6504 24382 : && !FIXED_POINT_TYPE_P (type)
6505 : )
6506 : {
6507 12191 : if (element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
6508 12191 : || (POINTER_TYPE_P (TREE_TYPE (captures[0]))
6509 0 : && TREE_CODE (captures[1]) == INTEGER_CST
6510 0 : && tree_int_cst_sign_bit (captures[1]) == 0)
6511 : )
6512 : {
6513 12191 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1308;
6514 12191 : {
6515 12191 : tree res_op0;
6516 12191 : res_op0 = captures[1];
6517 12191 : tree _r;
6518 12191 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
6519 12191 : if (TREE_SIDE_EFFECTS (captures[2]))
6520 11 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
6521 12191 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 941, __FILE__, __LINE__, true);
6522 12191 : return _r;
6523 : }
6524 0 : next_after_fail1308:;
6525 : }
6526 : }
6527 : }
6528 : }
6529 : }
6530 : break;
6531 : }
6532 : default:;
6533 : }
6534 : break;
6535 : }
6536 5013838 : default:;
6537 : }
6538 5013838 : switch (TREE_CODE (_p1))
6539 : {
6540 4171917 : CASE_CONVERT:
6541 4171917 : {
6542 4171917 : tree _q40 = TREE_OPERAND (_p1, 0);
6543 4171917 : switch (TREE_CODE (_q40))
6544 : {
6545 500917 : case PLUS_EXPR:
6546 500917 : {
6547 500917 : tree _q50 = TREE_OPERAND (_q40, 0);
6548 500917 : tree _q51 = TREE_OPERAND (_q40, 1);
6549 500917 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _q20, 0))
6550 : {
6551 2145 : {
6552 2145 : tree captures[3] ATTRIBUTE_UNUSED = { _q50, _q51, _q20 };
6553 2145 : tree res = generic_simplify_106 (loc, type, _p0, _p1, captures);
6554 2145 : if (res) return res;
6555 : }
6556 : }
6557 498845 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || operand_equal_p (_q51, _q20, 0))
6558 : {
6559 18 : {
6560 18 : tree captures[3] ATTRIBUTE_UNUSED = { _q51, _q50, _q20 };
6561 18 : tree res = generic_simplify_106 (loc, type, _p0, _p1, captures);
6562 18 : if (res) return res;
6563 : }
6564 : }
6565 : break;
6566 : }
6567 : default:;
6568 : }
6569 : break;
6570 : }
6571 : default:;
6572 : }
6573 : break;
6574 : }
6575 144448 : case NEGATE_EXPR:
6576 144448 : {
6577 144448 : tree _q20 = TREE_OPERAND (_p0, 0);
6578 144448 : if (integer_each_onep (_p1))
6579 : {
6580 41 : {
6581 41 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6582 41 : tree res = generic_simplify_104 (loc, type, _p0, _p1, captures);
6583 41 : if (res) return res;
6584 : }
6585 : }
6586 : break;
6587 : }
6588 22789487 : default:;
6589 : }
6590 22789487 : {
6591 22789487 : tree _p0_pops[1];
6592 22789487 : if (tree_nop_convert (_p0, _p0_pops))
6593 : {
6594 4463747 : tree _q20 = _p0_pops[0];
6595 4463747 : switch (TREE_CODE (_q20))
6596 : {
6597 344473 : case PLUS_EXPR:
6598 344473 : {
6599 344473 : tree _q30 = TREE_OPERAND (_q20, 0);
6600 344473 : tree _q31 = TREE_OPERAND (_q20, 1);
6601 344473 : if (CONSTANT_CLASS_P (_q31))
6602 : {
6603 337559 : if (CONSTANT_CLASS_P (_p1))
6604 : {
6605 27 : {
6606 27 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
6607 27 : tree res = generic_simplify_62 (loc, type, _p0, _p1, captures, PLUS_EXPR, MINUS_EXPR, MINUS_EXPR);
6608 27 : if (res) return res;
6609 : }
6610 : }
6611 : }
6612 : break;
6613 : }
6614 706 : case MINUS_EXPR:
6615 706 : {
6616 706 : tree _q30 = TREE_OPERAND (_q20, 0);
6617 706 : tree _q31 = TREE_OPERAND (_q20, 1);
6618 706 : if (CONSTANT_CLASS_P (_q31))
6619 : {
6620 0 : if (CONSTANT_CLASS_P (_p1))
6621 : {
6622 0 : {
6623 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
6624 0 : tree res = generic_simplify_62 (loc, type, _p0, _p1, captures, MINUS_EXPR, PLUS_EXPR, MINUS_EXPR);
6625 0 : if (res) return res;
6626 : }
6627 : }
6628 : }
6629 706 : if (CONSTANT_CLASS_P (_q30))
6630 : {
6631 34 : if (CONSTANT_CLASS_P (_p1))
6632 : {
6633 0 : {
6634 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
6635 0 : tree res = generic_simplify_63 (loc, type, _p0, _p1, captures, MINUS_EXPR);
6636 0 : if (res) return res;
6637 : }
6638 : }
6639 : }
6640 : break;
6641 : }
6642 : default:;
6643 : }
6644 : }
6645 : }
6646 22789460 : if (CONSTANT_CLASS_P (_p0))
6647 : {
6648 5559753 : switch (TREE_CODE (_p1))
6649 : {
6650 823 : case MINUS_EXPR:
6651 823 : {
6652 823 : tree _q30 = TREE_OPERAND (_p1, 0);
6653 823 : tree _q31 = TREE_OPERAND (_p1, 1);
6654 823 : if (CONSTANT_CLASS_P (_q30))
6655 : {
6656 639 : {
6657 639 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
6658 639 : tree res = generic_simplify_103 (loc, type, _p0, _p1, captures);
6659 639 : if (res) return res;
6660 : }
6661 : }
6662 : break;
6663 : }
6664 5559123 : default:;
6665 : }
6666 5559123 : {
6667 5559123 : tree _p1_pops[1];
6668 5559123 : if (tree_nop_convert (_p1, _p1_pops))
6669 : {
6670 1887165 : tree _q30 = _p1_pops[0];
6671 1887165 : switch (TREE_CODE (_q30))
6672 : {
6673 7305 : case MINUS_EXPR:
6674 7305 : {
6675 7305 : tree _q40 = TREE_OPERAND (_q30, 0);
6676 7305 : tree _q41 = TREE_OPERAND (_q30, 1);
6677 7305 : if (CONSTANT_CLASS_P (_q40))
6678 : {
6679 25 : {
6680 25 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q40, _q41 };
6681 25 : tree res = generic_simplify_103 (loc, type, _p0, _p1, captures);
6682 25 : if (res) return res;
6683 : }
6684 : }
6685 : break;
6686 : }
6687 : default:;
6688 : }
6689 : }
6690 : }
6691 : }
6692 22788805 : if (integer_all_onesp (_p0))
6693 : {
6694 1185290 : {
6695 1185290 : tree captures[1] ATTRIBUTE_UNUSED = { _p1 };
6696 1185290 : if (!TYPE_SATURATING (type)
6697 : )
6698 : {
6699 1185290 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
6700 2370580 : && !FIXED_POINT_TYPE_P (type)
6701 : )
6702 : {
6703 1185290 : if (TREE_CODE (type) != COMPLEX_TYPE
6704 : )
6705 : {
6706 1185288 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1309;
6707 1185288 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1309;
6708 1185288 : {
6709 1185288 : tree res_op0;
6710 1185288 : res_op0 = captures[0];
6711 1185288 : tree _r;
6712 1185288 : _r = fold_build1_loc (loc, BIT_NOT_EXPR, type, res_op0);
6713 1185288 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 942, __FILE__, __LINE__, true);
6714 1185288 : return _r;
6715 : }
6716 : next_after_fail1309:;
6717 : }
6718 : }
6719 : }
6720 : }
6721 : }
6722 21603517 : switch (TREE_CODE (_p1))
6723 : {
6724 7174664 : CASE_CONVERT:
6725 7174664 : {
6726 7174664 : tree _q30 = TREE_OPERAND (_p1, 0);
6727 7174664 : switch (TREE_CODE (_q30))
6728 : {
6729 686444 : case PLUS_EXPR:
6730 686444 : {
6731 686444 : tree _q40 = TREE_OPERAND (_q30, 0);
6732 686444 : tree _q41 = TREE_OPERAND (_q30, 1);
6733 686444 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || operand_equal_p (_q40, _p0, 0))
6734 : {
6735 24 : {
6736 24 : tree captures[3] ATTRIBUTE_UNUSED = { _q40, _q41, _p0 };
6737 24 : tree res = generic_simplify_106 (loc, type, _p0, _p1, captures);
6738 24 : if (res) return res;
6739 : }
6740 : }
6741 686420 : if ((_q41 == _p0 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _p0, 0))
6742 : {
6743 8390 : {
6744 8390 : tree captures[3] ATTRIBUTE_UNUSED = { _q41, _q40, _p0 };
6745 8390 : tree res = generic_simplify_106 (loc, type, _p0, _p1, captures);
6746 8390 : if (res) return res;
6747 : }
6748 : }
6749 : break;
6750 : }
6751 : default:;
6752 : }
6753 : break;
6754 : }
6755 21595290 : default:;
6756 : }
6757 21595290 : switch (TREE_CODE (_p0))
6758 : {
6759 5011697 : CASE_CONVERT:
6760 5011697 : {
6761 5011697 : tree _q20 = TREE_OPERAND (_p0, 0);
6762 5011697 : switch (TREE_CODE (_p1))
6763 : {
6764 4169803 : CASE_CONVERT:
6765 4169803 : {
6766 4169803 : tree _q40 = TREE_OPERAND (_p1, 0);
6767 4169803 : switch (TREE_CODE (_q40))
6768 : {
6769 385895 : case POINTER_PLUS_EXPR:
6770 385895 : {
6771 385895 : tree _q50 = TREE_OPERAND (_q40, 0);
6772 385895 : tree _q51 = TREE_OPERAND (_q40, 1);
6773 385895 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || operand_equal_p (_q50, _q20, 0))
6774 : {
6775 2102 : {
6776 2102 : tree captures[3] ATTRIBUTE_UNUSED = { _q50, _q51, _q20 };
6777 2102 : if (!TYPE_SATURATING (type)
6778 : )
6779 : {
6780 2102 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
6781 4204 : && !FIXED_POINT_TYPE_P (type)
6782 : )
6783 : {
6784 2102 : if (INTEGRAL_TYPE_P (type)
6785 2102 : && TYPE_OVERFLOW_UNDEFINED (type)
6786 0 : && TREE_CODE (captures[1]) != INTEGER_CST
6787 2102 : && element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
6788 : )
6789 : {
6790 0 : {
6791 0 : tree utype = unsigned_type_for (type);
6792 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1310;
6793 0 : {
6794 0 : tree res_op0;
6795 0 : {
6796 0 : tree _o1[1], _r1;
6797 0 : {
6798 0 : tree _o2[1], _r2;
6799 0 : _o2[0] = captures[1];
6800 0 : if (TREE_TYPE (_o2[0]) != utype)
6801 : {
6802 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
6803 : }
6804 : else
6805 : _r2 = _o2[0];
6806 0 : _o1[0] = _r2;
6807 : }
6808 0 : _r1 = fold_build1_loc (loc, NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
6809 0 : res_op0 = _r1;
6810 : }
6811 0 : tree _r;
6812 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
6813 0 : if (TREE_SIDE_EFFECTS (captures[2]))
6814 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
6815 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 943, __FILE__, __LINE__, true);
6816 0 : return _r;
6817 : }
6818 0 : next_after_fail1310:;
6819 : }
6820 : }
6821 : else
6822 : {
6823 2102 : if (element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
6824 2102 : || (POINTER_TYPE_P (TREE_TYPE (captures[0]))
6825 0 : && TREE_CODE (captures[1]) == INTEGER_CST
6826 0 : && tree_int_cst_sign_bit (captures[1]) == 0)
6827 : )
6828 : {
6829 2102 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1311;
6830 2102 : {
6831 2102 : tree res_op0;
6832 2102 : {
6833 2102 : tree _o1[1], _r1;
6834 2102 : _o1[0] = captures[1];
6835 2102 : if (TREE_TYPE (_o1[0]) != type)
6836 : {
6837 2098 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
6838 : }
6839 : else
6840 : _r1 = _o1[0];
6841 2102 : res_op0 = _r1;
6842 : }
6843 2102 : tree _r;
6844 2102 : _r = fold_build1_loc (loc, NEGATE_EXPR, type, res_op0);
6845 2102 : if (TREE_SIDE_EFFECTS (captures[2]))
6846 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[2]), _r);
6847 2102 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 944, __FILE__, __LINE__, true);
6848 2102 : return _r;
6849 : }
6850 0 : next_after_fail1311:;
6851 : }
6852 : }
6853 : }
6854 : }
6855 : }
6856 : }
6857 : break;
6858 : }
6859 : default:;
6860 : }
6861 : break;
6862 : }
6863 5009595 : default:;
6864 : }
6865 5009595 : switch (TREE_CODE (_q20))
6866 : {
6867 401187 : case PLUS_EXPR:
6868 401187 : {
6869 401187 : tree _q30 = TREE_OPERAND (_q20, 0);
6870 401187 : tree _q31 = TREE_OPERAND (_q20, 1);
6871 401187 : switch (TREE_CODE (_p1))
6872 : {
6873 384093 : CASE_CONVERT:
6874 384093 : {
6875 384093 : tree _q60 = TREE_OPERAND (_p1, 0);
6876 384093 : switch (TREE_CODE (_q60))
6877 : {
6878 210067 : case PLUS_EXPR:
6879 210067 : {
6880 210067 : tree _q70 = TREE_OPERAND (_q60, 0);
6881 210067 : tree _q71 = TREE_OPERAND (_q60, 1);
6882 210067 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || operand_equal_p (_q70, _q30, 0))
6883 : {
6884 5420 : {
6885 5420 : tree captures[4] ATTRIBUTE_UNUSED = { _q30, _q31, _q71, _q30 };
6886 5420 : tree res = generic_simplify_107 (loc, type, _p0, _p1, captures);
6887 5420 : if (res) return res;
6888 : }
6889 : }
6890 204647 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || operand_equal_p (_q71, _q30, 0))
6891 : {
6892 70 : {
6893 70 : tree captures[4] ATTRIBUTE_UNUSED = { _q30, _q31, _q70, _q30 };
6894 70 : tree res = generic_simplify_107 (loc, type, _p0, _p1, captures);
6895 70 : if (res) return res;
6896 : }
6897 : }
6898 204577 : if ((_q70 == _q31 && ! TREE_SIDE_EFFECTS (_q70)) || operand_equal_p (_q70, _q31, 0))
6899 : {
6900 90 : {
6901 90 : tree captures[4] ATTRIBUTE_UNUSED = { _q31, _q30, _q71, _q31 };
6902 90 : tree res = generic_simplify_107 (loc, type, _p0, _p1, captures);
6903 90 : if (res) return res;
6904 : }
6905 : }
6906 204487 : if ((_q71 == _q31 && ! TREE_SIDE_EFFECTS (_q71)) || operand_equal_p (_q71, _q31, 0))
6907 : {
6908 153488 : {
6909 153488 : tree captures[4] ATTRIBUTE_UNUSED = { _q31, _q30, _q70, _q31 };
6910 153488 : tree res = generic_simplify_107 (loc, type, _p0, _p1, captures);
6911 153488 : if (res) return res;
6912 : }
6913 : }
6914 : break;
6915 : }
6916 : default:;
6917 : }
6918 : break;
6919 : }
6920 : default:;
6921 : }
6922 : break;
6923 : }
6924 94159 : case POINTER_PLUS_EXPR:
6925 94159 : {
6926 94159 : tree _q30 = TREE_OPERAND (_q20, 0);
6927 94159 : tree _q31 = TREE_OPERAND (_q20, 1);
6928 94159 : switch (TREE_CODE (_p1))
6929 : {
6930 93085 : CASE_CONVERT:
6931 93085 : {
6932 93085 : tree _q60 = TREE_OPERAND (_p1, 0);
6933 93085 : switch (TREE_CODE (_q60))
6934 : {
6935 55564 : case POINTER_PLUS_EXPR:
6936 55564 : {
6937 55564 : tree _q70 = TREE_OPERAND (_q60, 0);
6938 55564 : tree _q71 = TREE_OPERAND (_q60, 1);
6939 55564 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || operand_equal_p (_q70, _q30, 0))
6940 : {
6941 11881 : {
6942 11881 : tree captures[4] ATTRIBUTE_UNUSED = { _q30, _q31, _q71, _q30 };
6943 11881 : if (!TYPE_SATURATING (type)
6944 : )
6945 : {
6946 11881 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
6947 23762 : && !FIXED_POINT_TYPE_P (type)
6948 : )
6949 : {
6950 11881 : if (INTEGRAL_TYPE_P (type)
6951 11881 : && TYPE_OVERFLOW_UNDEFINED (type)
6952 11881 : && element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
6953 : )
6954 : {
6955 0 : {
6956 0 : tree utype = unsigned_type_for (type);
6957 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1312;
6958 0 : {
6959 0 : tree res_op0;
6960 0 : {
6961 0 : tree _o1[2], _r1;
6962 0 : {
6963 0 : tree _o2[1], _r2;
6964 0 : _o2[0] = captures[1];
6965 0 : if (TREE_TYPE (_o2[0]) != utype)
6966 : {
6967 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
6968 : }
6969 : else
6970 : _r2 = _o2[0];
6971 0 : _o1[0] = _r2;
6972 : }
6973 0 : {
6974 0 : tree _o2[1], _r2;
6975 0 : _o2[0] = captures[2];
6976 0 : if (TREE_TYPE (_o2[0]) != utype)
6977 : {
6978 0 : _r2 = fold_build1_loc (loc, NOP_EXPR, utype, _o2[0]);
6979 : }
6980 : else
6981 : _r2 = _o2[0];
6982 0 : _o1[1] = _r2;
6983 : }
6984 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
6985 0 : res_op0 = _r1;
6986 : }
6987 0 : tree _r;
6988 0 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
6989 0 : if (TREE_SIDE_EFFECTS (captures[3]))
6990 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[3]), _r);
6991 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 945, __FILE__, __LINE__, true);
6992 0 : return _r;
6993 : }
6994 0 : next_after_fail1312:;
6995 : }
6996 : }
6997 : else
6998 : {
6999 11881 : if (element_precision (type) <= element_precision (TREE_TYPE (captures[1]))
7000 11881 : || (POINTER_TYPE_P (TREE_TYPE (captures[0]))
7001 0 : && TREE_CODE (captures[1]) == INTEGER_CST
7002 0 : && tree_int_cst_sign_bit (captures[1]) == 0
7003 0 : && TREE_CODE (captures[2]) == INTEGER_CST
7004 0 : && tree_int_cst_sign_bit (captures[2]) == 0)
7005 : )
7006 : {
7007 11881 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1313;
7008 11881 : {
7009 11881 : tree res_op0;
7010 11881 : {
7011 11881 : tree _o1[1], _r1;
7012 11881 : _o1[0] = captures[1];
7013 11881 : if (TREE_TYPE (_o1[0]) != type)
7014 : {
7015 11828 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
7016 : }
7017 : else
7018 : _r1 = _o1[0];
7019 11881 : res_op0 = _r1;
7020 : }
7021 11881 : tree res_op1;
7022 11881 : {
7023 11881 : tree _o1[1], _r1;
7024 11881 : _o1[0] = captures[2];
7025 11881 : if (TREE_TYPE (_o1[0]) != type)
7026 : {
7027 11828 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
7028 : }
7029 : else
7030 : _r1 = _o1[0];
7031 11881 : res_op1 = _r1;
7032 : }
7033 11881 : tree _r;
7034 11881 : _r = fold_build2_loc (loc, MINUS_EXPR, type, res_op0, res_op1);
7035 11881 : if (TREE_SIDE_EFFECTS (captures[3]))
7036 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[3]), _r);
7037 11881 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 946, __FILE__, __LINE__, true);
7038 11881 : return _r;
7039 : }
7040 0 : next_after_fail1313:;
7041 : }
7042 : }
7043 : }
7044 : }
7045 : }
7046 : }
7047 : break;
7048 : }
7049 : default:;
7050 : }
7051 : break;
7052 : }
7053 : default:;
7054 : }
7055 : break;
7056 : }
7057 : default:;
7058 : }
7059 : break;
7060 : }
7061 1523217 : case MULT_EXPR:
7062 1523217 : {
7063 1523217 : tree _q20 = TREE_OPERAND (_p0, 0);
7064 1523217 : tree _q21 = TREE_OPERAND (_p0, 1);
7065 1523217 : switch (TREE_CODE (_p1))
7066 : {
7067 717241 : case MULT_EXPR:
7068 717241 : {
7069 717241 : tree _q50 = TREE_OPERAND (_p1, 0);
7070 717241 : tree _q51 = TREE_OPERAND (_p1, 1);
7071 717241 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
7072 : {
7073 3910 : {
7074 3910 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1, _q51 };
7075 3910 : tree res = generic_simplify_70 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7076 3910 : if (res) return res;
7077 : }
7078 : }
7079 716003 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
7080 : {
7081 17317 : {
7082 17317 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1, _q50 };
7083 17317 : tree res = generic_simplify_70 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7084 17317 : if (res) return res;
7085 : }
7086 : }
7087 698686 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
7088 : {
7089 35422 : {
7090 35422 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _p1, _q51 };
7091 35422 : tree res = generic_simplify_70 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7092 35422 : if (res) return res;
7093 : }
7094 : }
7095 663339 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
7096 : {
7097 220371 : {
7098 220371 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _p1, _q50 };
7099 220371 : tree res = generic_simplify_70 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7100 220371 : if (res) return res;
7101 : }
7102 : }
7103 : break;
7104 : }
7105 : default:;
7106 : }
7107 : break;
7108 : }
7109 21169997 : default:;
7110 : }
7111 21169997 : switch (TREE_CODE (_p1))
7112 : {
7113 1765786 : case MULT_EXPR:
7114 1765786 : {
7115 1765786 : tree _q30 = TREE_OPERAND (_p1, 0);
7116 1765786 : tree _q31 = TREE_OPERAND (_p1, 1);
7117 1765786 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7118 : {
7119 3882 : {
7120 3882 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q31 };
7121 3882 : tree res = generic_simplify_71 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7122 3882 : if (res) return res;
7123 : }
7124 : }
7125 1761948 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
7126 : {
7127 2010 : {
7128 2010 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q30 };
7129 2010 : tree res = generic_simplify_71 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7130 2010 : if (res) return res;
7131 : }
7132 : }
7133 : break;
7134 : }
7135 21164248 : default:;
7136 : }
7137 21164248 : switch (TREE_CODE (_p0))
7138 : {
7139 1254311 : case MULT_EXPR:
7140 1254311 : {
7141 1254311 : tree _q20 = TREE_OPERAND (_p0, 0);
7142 1254311 : tree _q21 = TREE_OPERAND (_p0, 1);
7143 1254311 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
7144 : {
7145 64258 : {
7146 64258 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
7147 64258 : tree res = generic_simplify_72 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7148 64258 : if (res) return res;
7149 : }
7150 : }
7151 1190345 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
7152 : {
7153 632 : {
7154 632 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q21, _q20 };
7155 632 : tree res = generic_simplify_72 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7156 632 : if (res) return res;
7157 : }
7158 : }
7159 : break;
7160 : }
7161 21100183 : default:;
7162 : }
7163 21100183 : switch (TREE_CODE (_p1))
7164 : {
7165 1760037 : case MULT_EXPR:
7166 1760037 : {
7167 1760037 : tree _q30 = TREE_OPERAND (_p1, 0);
7168 1760037 : tree _q31 = TREE_OPERAND (_p1, 1);
7169 1760037 : switch (TREE_CODE (_q30))
7170 : {
7171 78198 : case MINUS_EXPR:
7172 78198 : {
7173 78198 : tree _q40 = TREE_OPERAND (_q30, 0);
7174 78198 : tree _q41 = TREE_OPERAND (_q30, 1);
7175 78198 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
7176 : {
7177 19 : if (tree_zero_one_valued_p (_q31))
7178 : {
7179 0 : {
7180 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q41, _q31 };
7181 0 : tree res = generic_simplify_108 (loc, type, _p0, _p1, captures);
7182 0 : if (res) return res;
7183 : }
7184 : }
7185 : }
7186 : break;
7187 : }
7188 1760037 : default:;
7189 : }
7190 1760037 : if (tree_zero_one_valued_p (_q30))
7191 : {
7192 1228 : switch (TREE_CODE (_q31))
7193 : {
7194 9 : case MINUS_EXPR:
7195 9 : {
7196 9 : tree _q50 = TREE_OPERAND (_q31, 0);
7197 9 : tree _q51 = TREE_OPERAND (_q31, 1);
7198 9 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
7199 : {
7200 9 : {
7201 9 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q51, _q30 };
7202 9 : tree res = generic_simplify_108 (loc, type, _p0, _p1, captures);
7203 9 : if (res) return res;
7204 : }
7205 : }
7206 : break;
7207 : }
7208 : default:;
7209 : }
7210 : }
7211 : break;
7212 : }
7213 21100181 : default:;
7214 : }
7215 21100181 : switch (TREE_CODE (_p0))
7216 : {
7217 92 : case BIT_AND_EXPR:
7218 92 : {
7219 92 : tree _q20 = TREE_OPERAND (_p0, 0);
7220 92 : tree _q21 = TREE_OPERAND (_p0, 1);
7221 92 : switch (TREE_CODE (_q21))
7222 : {
7223 67 : case INTEGER_CST:
7224 67 : {
7225 67 : switch (TREE_CODE (_p1))
7226 : {
7227 28 : case BIT_AND_EXPR:
7228 28 : {
7229 28 : tree _q50 = TREE_OPERAND (_p1, 0);
7230 28 : tree _q51 = TREE_OPERAND (_p1, 1);
7231 28 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
7232 : {
7233 6 : if (integer_pow2p (_q51))
7234 : {
7235 6 : {
7236 6 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
7237 12 : if (INTEGRAL_TYPE_P (type)
7238 12 : && TYPE_PRECISION (type) <= MAX_FIXED_MODE_SIZE
7239 12 : && wi::to_wide (captures[1]) + 1 == wi::to_wide (captures[2])
7240 : )
7241 : {
7242 4 : {
7243 4 : int width = wi::exact_log2 (wi::to_wide (captures[2])) + 1;
7244 4 : tree ntype = NULL_TREE;
7245 4 : if (width > 0 && width < TYPE_PRECISION (type))
7246 4 : ntype = build_nonstandard_integer_type (width, SIGNED);
7247 4 : if (ntype && type_has_mode_precision_p (ntype)
7248 : )
7249 : {
7250 4 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1314;
7251 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1314;
7252 4 : {
7253 4 : tree res_op0;
7254 4 : {
7255 4 : tree _o1[1], _r1;
7256 4 : _o1[0] = captures[0];
7257 4 : if (TREE_TYPE (_o1[0]) != ntype)
7258 : {
7259 4 : _r1 = fold_build1_loc (loc, NOP_EXPR, ntype, _o1[0]);
7260 : }
7261 : else
7262 : _r1 = _o1[0];
7263 4 : res_op0 = _r1;
7264 : }
7265 4 : tree _r;
7266 4 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
7267 4 : if (TREE_SIDE_EFFECTS (captures[1]))
7268 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
7269 4 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 947, __FILE__, __LINE__, true);
7270 4 : return _r;
7271 : }
7272 2 : next_after_fail1314:;
7273 : }
7274 : }
7275 : }
7276 : }
7277 : }
7278 : }
7279 : break;
7280 : }
7281 : default:;
7282 : }
7283 : break;
7284 : }
7285 : default:;
7286 : }
7287 : break;
7288 : }
7289 0 : case VEC_COND_EXPR:
7290 0 : {
7291 0 : tree _q20 = TREE_OPERAND (_p0, 0);
7292 0 : tree _q21 = TREE_OPERAND (_p0, 1);
7293 0 : tree _q22 = TREE_OPERAND (_p0, 2);
7294 0 : switch (TREE_CODE (_p1))
7295 : {
7296 0 : case VEC_COND_EXPR:
7297 0 : {
7298 0 : tree _q60 = TREE_OPERAND (_p1, 0);
7299 0 : tree _q61 = TREE_OPERAND (_p1, 1);
7300 0 : tree _q62 = TREE_OPERAND (_p1, 2);
7301 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
7302 : {
7303 0 : {
7304 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
7305 0 : if (VECTOR_TYPE_P (type)
7306 0 : && (TREE_CODE_CLASS (MINUS_EXPR) != tcc_comparison
7307 : || types_match (type, TREE_TYPE (captures[2]))
7308 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]))
7309 : || (optimize_vectors_before_lowering_p ()
7310 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]), TREE_TYPE (captures[1]))))
7311 : )
7312 : {
7313 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1315;
7314 0 : {
7315 0 : tree res_op0;
7316 0 : res_op0 = captures[1];
7317 0 : tree res_op1;
7318 0 : {
7319 0 : tree _o1[2], _r1;
7320 0 : _o1[0] = captures[2];
7321 0 : _o1[1] = captures[5];
7322 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7323 0 : if (EXPR_P (_r1))
7324 0 : goto next_after_fail1315;
7325 0 : res_op1 = _r1;
7326 : }
7327 0 : tree res_op2;
7328 0 : {
7329 0 : tree _o1[2], _r1;
7330 0 : _o1[0] = captures[3];
7331 0 : _o1[1] = captures[6];
7332 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7333 0 : if (EXPR_P (_r1))
7334 0 : goto next_after_fail1315;
7335 0 : res_op2 = _r1;
7336 : }
7337 0 : tree _r;
7338 0 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
7339 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 908, __FILE__, __LINE__, true);
7340 0 : return _r;
7341 : }
7342 0 : next_after_fail1315:;
7343 : }
7344 : }
7345 : }
7346 : break;
7347 : }
7348 0 : default:;
7349 : }
7350 0 : {
7351 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
7352 0 : if (VECTOR_TYPE_P (type)
7353 0 : && (TREE_CODE_CLASS (MINUS_EXPR) != tcc_comparison
7354 : || types_match (type, TREE_TYPE (captures[2]))
7355 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]))
7356 : || (optimize_vectors_before_lowering_p ()
7357 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]), TREE_TYPE (captures[1]))))
7358 : )
7359 : {
7360 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1316;
7361 0 : {
7362 0 : if (! tree_invariant_p (captures[4])) goto next_after_fail1316;
7363 0 : tree res_op0;
7364 0 : res_op0 = captures[1];
7365 0 : tree res_op1;
7366 0 : {
7367 0 : tree _o1[2], _r1;
7368 0 : _o1[0] = captures[2];
7369 0 : _o1[1] = unshare_expr (captures[4]);
7370 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7371 0 : if (EXPR_P (_r1))
7372 0 : goto next_after_fail1316;
7373 0 : res_op1 = _r1;
7374 : }
7375 0 : tree res_op2;
7376 0 : {
7377 0 : tree _o1[2], _r1;
7378 0 : _o1[0] = captures[3];
7379 0 : _o1[1] = captures[4];
7380 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7381 0 : if (EXPR_P (_r1))
7382 0 : goto next_after_fail1316;
7383 0 : res_op2 = _r1;
7384 : }
7385 0 : tree _r;
7386 0 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
7387 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 910, __FILE__, __LINE__, true);
7388 0 : return _r;
7389 : }
7390 0 : next_after_fail1316:;
7391 : }
7392 : }
7393 0 : break;
7394 : }
7395 21100177 : default:;
7396 : }
7397 21100177 : if (integer_zerop (_p0))
7398 : {
7399 304520 : {
7400 304520 : tree captures[1] ATTRIBUTE_UNUSED = { _p1 };
7401 304520 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1317;
7402 304520 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1317;
7403 304520 : {
7404 304520 : tree res_op0;
7405 304520 : res_op0 = captures[0];
7406 304520 : tree _r;
7407 304520 : _r = fold_build1_loc (loc, NEGATE_EXPR, type, res_op0);
7408 304520 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 948, __FILE__, __LINE__, true);
7409 304520 : return _r;
7410 : }
7411 : next_after_fail1317:;
7412 : }
7413 : }
7414 20795657 : if (real_zerop (_p0))
7415 : {
7416 182 : {
7417 182 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7418 182 : if (fold_real_zero_addition_p (type, captures[1], captures[0], 0)
7419 : )
7420 : {
7421 55 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1318;
7422 55 : {
7423 55 : tree res_op0;
7424 55 : res_op0 = captures[1];
7425 55 : tree _r;
7426 55 : _r = fold_build1_loc (loc, NEGATE_EXPR, type, res_op0);
7427 55 : if (TREE_SIDE_EFFECTS (captures[0]))
7428 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[0]), _r);
7429 55 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 949, __FILE__, __LINE__, true);
7430 55 : return _r;
7431 : }
7432 0 : next_after_fail1318:;
7433 : }
7434 : }
7435 : }
7436 20795602 : switch (TREE_CODE (_p1))
7437 : {
7438 4 : case VEC_COND_EXPR:
7439 4 : {
7440 4 : tree _q30 = TREE_OPERAND (_p1, 0);
7441 4 : tree _q31 = TREE_OPERAND (_p1, 1);
7442 4 : tree _q32 = TREE_OPERAND (_p1, 2);
7443 4 : {
7444 4 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
7445 4 : if (VECTOR_TYPE_P (type)
7446 4 : && (TREE_CODE_CLASS (MINUS_EXPR) != tcc_comparison
7447 : || types_match (type, TREE_TYPE (captures[3]))
7448 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]))
7449 : || (optimize_vectors_before_lowering_p ()
7450 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]), TREE_TYPE (captures[2]))))
7451 : )
7452 : {
7453 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1319;
7454 4 : {
7455 4 : if (! tree_invariant_p (captures[0])) goto next_after_fail1319;
7456 0 : tree res_op0;
7457 0 : res_op0 = captures[2];
7458 0 : tree res_op1;
7459 0 : {
7460 0 : tree _o1[2], _r1;
7461 0 : _o1[0] = unshare_expr (captures[0]);
7462 0 : _o1[1] = captures[3];
7463 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7464 0 : if (EXPR_P (_r1))
7465 0 : goto next_after_fail1319;
7466 0 : res_op1 = _r1;
7467 : }
7468 0 : tree res_op2;
7469 0 : {
7470 0 : tree _o1[2], _r1;
7471 0 : _o1[0] = captures[0];
7472 0 : _o1[1] = captures[4];
7473 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, type, _o1[0], _o1[1]);
7474 0 : if (EXPR_P (_r1))
7475 0 : goto next_after_fail1319;
7476 0 : res_op2 = _r1;
7477 : }
7478 0 : tree _r;
7479 0 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
7480 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 911, __FILE__, __LINE__, true);
7481 0 : return _r;
7482 : }
7483 4 : next_after_fail1319:;
7484 : }
7485 : }
7486 4 : if (integer_each_onep (_q31))
7487 : {
7488 0 : if (integer_zerop (_q32))
7489 : {
7490 0 : {
7491 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
7492 0 : tree res = generic_simplify_109 (loc, type, _p0, _p1, captures);
7493 0 : if (res) return res;
7494 : }
7495 : }
7496 : }
7497 : break;
7498 : }
7499 121318 : case VIEW_CONVERT_EXPR:
7500 121318 : {
7501 121318 : tree _q30 = TREE_OPERAND (_p1, 0);
7502 121318 : switch (TREE_CODE (_q30))
7503 : {
7504 0 : case VEC_COND_EXPR:
7505 0 : {
7506 0 : tree _q40 = TREE_OPERAND (_q30, 0);
7507 0 : tree _q41 = TREE_OPERAND (_q30, 1);
7508 0 : tree _q42 = TREE_OPERAND (_q30, 2);
7509 0 : if (integer_each_onep (_q41))
7510 : {
7511 0 : if (integer_zerop (_q42))
7512 : {
7513 0 : {
7514 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q30, _q40, _q41, _q42 };
7515 0 : tree res = generic_simplify_109 (loc, type, _p0, _p1, captures);
7516 0 : if (res) return res;
7517 : }
7518 : }
7519 : }
7520 : break;
7521 : }
7522 : default:;
7523 : }
7524 : break;
7525 : }
7526 20795602 : default:;
7527 : }
7528 20795602 : switch (TREE_CODE (_p0))
7529 : {
7530 115964 : case RDIV_EXPR:
7531 115964 : {
7532 115964 : tree _q20 = TREE_OPERAND (_p0, 0);
7533 115964 : tree _q21 = TREE_OPERAND (_p0, 1);
7534 115964 : switch (TREE_CODE (_p1))
7535 : {
7536 19403 : case RDIV_EXPR:
7537 19403 : {
7538 19403 : tree _q50 = TREE_OPERAND (_p1, 0);
7539 19403 : tree _q51 = TREE_OPERAND (_p1, 1);
7540 19403 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
7541 : {
7542 19383 : {
7543 19383 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
7544 19383 : tree res = generic_simplify_79 (loc, type, _p0, _p1, captures, MINUS_EXPR);
7545 19383 : if (res) return res;
7546 : }
7547 : }
7548 : break;
7549 : }
7550 : default:;
7551 : }
7552 : break;
7553 : }
7554 1353170 : case PLUS_EXPR:
7555 1353170 : {
7556 1353170 : tree _q20 = TREE_OPERAND (_p0, 0);
7557 1353170 : tree _q21 = TREE_OPERAND (_p0, 1);
7558 1353170 : switch (TREE_CODE (_q20))
7559 : {
7560 59082 : case CALL_EXPR:
7561 59082 : switch (get_call_combined_fn (_q20))
7562 : {
7563 4 : case CFN_BUILT_IN_POPCOUNT:
7564 4 : if (call_expr_nargs (_q20) == 1)
7565 : {
7566 4 : tree _q30 = CALL_EXPR_ARG (_q20, 0);
7567 4 : switch (TREE_CODE (_q21))
7568 : {
7569 4 : case CALL_EXPR:
7570 4 : switch (get_call_combined_fn (_q21))
7571 : {
7572 4 : case CFN_BUILT_IN_POPCOUNT:
7573 4 : if (call_expr_nargs (_q21) == 1)
7574 : {
7575 4 : tree _q50 = CALL_EXPR_ARG (_q21, 0);
7576 4 : switch (TREE_CODE (_p1))
7577 : {
7578 4 : case CALL_EXPR:
7579 4 : switch (get_call_combined_fn (_p1))
7580 : {
7581 4 : case CFN_BUILT_IN_POPCOUNT:
7582 4 : if (call_expr_nargs (_p1) == 1)
7583 : {
7584 4 : tree _q70 = CALL_EXPR_ARG (_p1, 0);
7585 4 : switch (TREE_CODE (_q70))
7586 : {
7587 2 : case BIT_AND_EXPR:
7588 2 : {
7589 2 : tree _q80 = TREE_OPERAND (_q70, 0);
7590 2 : tree _q81 = TREE_OPERAND (_q70, 1);
7591 2 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7592 : {
7593 1 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7594 : {
7595 1 : {
7596 1 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7597 1 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNT);
7598 1 : if (res) return res;
7599 : }
7600 : }
7601 : }
7602 1 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7603 : {
7604 1 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7605 : {
7606 1 : {
7607 1 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7608 1 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNT);
7609 1 : if (res) return res;
7610 : }
7611 : }
7612 : }
7613 : break;
7614 : }
7615 2 : case BIT_IOR_EXPR:
7616 2 : {
7617 2 : tree _q80 = TREE_OPERAND (_q70, 0);
7618 2 : tree _q81 = TREE_OPERAND (_q70, 1);
7619 2 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7620 : {
7621 1 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7622 : {
7623 1 : {
7624 1 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7625 1 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNT);
7626 1 : if (res) return res;
7627 : }
7628 : }
7629 : }
7630 1 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7631 : {
7632 1 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7633 : {
7634 1 : {
7635 1 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7636 1 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNT);
7637 1 : if (res) return res;
7638 : }
7639 : }
7640 : }
7641 : break;
7642 : }
7643 : default:;
7644 : }
7645 : }
7646 : break;
7647 : default:;
7648 : }
7649 : break;
7650 : default:;
7651 : }
7652 : }
7653 : break;
7654 : default:;
7655 : }
7656 : break;
7657 : default:;
7658 : }
7659 : }
7660 : break;
7661 0 : case CFN_BUILT_IN_POPCOUNTLL:
7662 0 : if (call_expr_nargs (_q20) == 1)
7663 : {
7664 0 : tree _q30 = CALL_EXPR_ARG (_q20, 0);
7665 0 : switch (TREE_CODE (_q21))
7666 : {
7667 0 : case CALL_EXPR:
7668 0 : switch (get_call_combined_fn (_q21))
7669 : {
7670 0 : case CFN_BUILT_IN_POPCOUNTLL:
7671 0 : if (call_expr_nargs (_q21) == 1)
7672 : {
7673 0 : tree _q50 = CALL_EXPR_ARG (_q21, 0);
7674 0 : switch (TREE_CODE (_p1))
7675 : {
7676 0 : case CALL_EXPR:
7677 0 : switch (get_call_combined_fn (_p1))
7678 : {
7679 0 : case CFN_BUILT_IN_POPCOUNTLL:
7680 0 : if (call_expr_nargs (_p1) == 1)
7681 : {
7682 0 : tree _q70 = CALL_EXPR_ARG (_p1, 0);
7683 0 : switch (TREE_CODE (_q70))
7684 : {
7685 0 : case BIT_AND_EXPR:
7686 0 : {
7687 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7688 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7689 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7690 : {
7691 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7692 : {
7693 0 : {
7694 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7695 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTLL);
7696 0 : if (res) return res;
7697 : }
7698 : }
7699 : }
7700 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7701 : {
7702 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7703 : {
7704 0 : {
7705 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7706 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTLL);
7707 0 : if (res) return res;
7708 : }
7709 : }
7710 : }
7711 : break;
7712 : }
7713 0 : case BIT_IOR_EXPR:
7714 0 : {
7715 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7716 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7717 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7718 : {
7719 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7720 : {
7721 0 : {
7722 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7723 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTLL);
7724 0 : if (res) return res;
7725 : }
7726 : }
7727 : }
7728 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7729 : {
7730 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7731 : {
7732 0 : {
7733 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7734 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTLL);
7735 0 : if (res) return res;
7736 : }
7737 : }
7738 : }
7739 : break;
7740 : }
7741 : default:;
7742 : }
7743 : }
7744 : break;
7745 : default:;
7746 : }
7747 : break;
7748 : default:;
7749 : }
7750 : }
7751 : break;
7752 : default:;
7753 : }
7754 : break;
7755 : default:;
7756 : }
7757 : }
7758 : break;
7759 0 : case CFN_POPCOUNT:
7760 0 : if (call_expr_nargs (_q20) == 1)
7761 : {
7762 0 : tree _q30 = CALL_EXPR_ARG (_q20, 0);
7763 0 : switch (TREE_CODE (_q21))
7764 : {
7765 0 : case CALL_EXPR:
7766 0 : switch (get_call_combined_fn (_q21))
7767 : {
7768 0 : case CFN_POPCOUNT:
7769 0 : if (call_expr_nargs (_q21) == 1)
7770 : {
7771 0 : tree _q50 = CALL_EXPR_ARG (_q21, 0);
7772 0 : switch (TREE_CODE (_p1))
7773 : {
7774 0 : case CALL_EXPR:
7775 0 : switch (get_call_combined_fn (_p1))
7776 : {
7777 0 : case CFN_POPCOUNT:
7778 0 : if (call_expr_nargs (_p1) == 1)
7779 : {
7780 0 : tree _q70 = CALL_EXPR_ARG (_p1, 0);
7781 0 : switch (TREE_CODE (_q70))
7782 : {
7783 0 : case BIT_AND_EXPR:
7784 0 : {
7785 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7786 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7787 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7788 : {
7789 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7790 : {
7791 0 : {
7792 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7793 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_POPCOUNT);
7794 0 : if (res) return res;
7795 : }
7796 : }
7797 : }
7798 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7799 : {
7800 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7801 : {
7802 0 : {
7803 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7804 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_POPCOUNT);
7805 0 : if (res) return res;
7806 : }
7807 : }
7808 : }
7809 : break;
7810 : }
7811 0 : case BIT_IOR_EXPR:
7812 0 : {
7813 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7814 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7815 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7816 : {
7817 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7818 : {
7819 0 : {
7820 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7821 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_POPCOUNT);
7822 0 : if (res) return res;
7823 : }
7824 : }
7825 : }
7826 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7827 : {
7828 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7829 : {
7830 0 : {
7831 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7832 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_POPCOUNT);
7833 0 : if (res) return res;
7834 : }
7835 : }
7836 : }
7837 : break;
7838 : }
7839 : default:;
7840 : }
7841 : }
7842 : break;
7843 : default:;
7844 : }
7845 : break;
7846 : default:;
7847 : }
7848 : }
7849 : break;
7850 : default:;
7851 : }
7852 : break;
7853 : default:;
7854 : }
7855 : }
7856 : break;
7857 0 : case CFN_BUILT_IN_POPCOUNTIMAX:
7858 0 : if (call_expr_nargs (_q20) == 1)
7859 : {
7860 0 : tree _q30 = CALL_EXPR_ARG (_q20, 0);
7861 0 : switch (TREE_CODE (_q21))
7862 : {
7863 0 : case CALL_EXPR:
7864 0 : switch (get_call_combined_fn (_q21))
7865 : {
7866 0 : case CFN_BUILT_IN_POPCOUNTIMAX:
7867 0 : if (call_expr_nargs (_q21) == 1)
7868 : {
7869 0 : tree _q50 = CALL_EXPR_ARG (_q21, 0);
7870 0 : switch (TREE_CODE (_p1))
7871 : {
7872 0 : case CALL_EXPR:
7873 0 : switch (get_call_combined_fn (_p1))
7874 : {
7875 0 : case CFN_BUILT_IN_POPCOUNTIMAX:
7876 0 : if (call_expr_nargs (_p1) == 1)
7877 : {
7878 0 : tree _q70 = CALL_EXPR_ARG (_p1, 0);
7879 0 : switch (TREE_CODE (_q70))
7880 : {
7881 0 : case BIT_AND_EXPR:
7882 0 : {
7883 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7884 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7885 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7886 : {
7887 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7888 : {
7889 0 : {
7890 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7891 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTIMAX);
7892 0 : if (res) return res;
7893 : }
7894 : }
7895 : }
7896 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7897 : {
7898 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7899 : {
7900 0 : {
7901 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7902 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTIMAX);
7903 0 : if (res) return res;
7904 : }
7905 : }
7906 : }
7907 : break;
7908 : }
7909 0 : case BIT_IOR_EXPR:
7910 0 : {
7911 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7912 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7913 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7914 : {
7915 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7916 : {
7917 0 : {
7918 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7919 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTIMAX);
7920 0 : if (res) return res;
7921 : }
7922 : }
7923 : }
7924 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7925 : {
7926 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7927 : {
7928 0 : {
7929 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7930 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTIMAX);
7931 0 : if (res) return res;
7932 : }
7933 : }
7934 : }
7935 : break;
7936 : }
7937 : default:;
7938 : }
7939 : }
7940 : break;
7941 : default:;
7942 : }
7943 : break;
7944 : default:;
7945 : }
7946 : }
7947 : break;
7948 : default:;
7949 : }
7950 : break;
7951 : default:;
7952 : }
7953 : }
7954 : break;
7955 0 : case CFN_BUILT_IN_POPCOUNTL:
7956 0 : if (call_expr_nargs (_q20) == 1)
7957 : {
7958 0 : tree _q30 = CALL_EXPR_ARG (_q20, 0);
7959 0 : switch (TREE_CODE (_q21))
7960 : {
7961 0 : case CALL_EXPR:
7962 0 : switch (get_call_combined_fn (_q21))
7963 : {
7964 0 : case CFN_BUILT_IN_POPCOUNTL:
7965 0 : if (call_expr_nargs (_q21) == 1)
7966 : {
7967 0 : tree _q50 = CALL_EXPR_ARG (_q21, 0);
7968 0 : switch (TREE_CODE (_p1))
7969 : {
7970 0 : case CALL_EXPR:
7971 0 : switch (get_call_combined_fn (_p1))
7972 : {
7973 0 : case CFN_BUILT_IN_POPCOUNTL:
7974 0 : if (call_expr_nargs (_p1) == 1)
7975 : {
7976 0 : tree _q70 = CALL_EXPR_ARG (_p1, 0);
7977 0 : switch (TREE_CODE (_q70))
7978 : {
7979 0 : case BIT_AND_EXPR:
7980 0 : {
7981 0 : tree _q80 = TREE_OPERAND (_q70, 0);
7982 0 : tree _q81 = TREE_OPERAND (_q70, 1);
7983 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
7984 : {
7985 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
7986 : {
7987 0 : {
7988 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
7989 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTL);
7990 0 : if (res) return res;
7991 : }
7992 : }
7993 : }
7994 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
7995 : {
7996 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
7997 : {
7998 0 : {
7999 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
8000 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_POPCOUNTL);
8001 0 : if (res) return res;
8002 : }
8003 : }
8004 : }
8005 : break;
8006 : }
8007 0 : case BIT_IOR_EXPR:
8008 0 : {
8009 0 : tree _q80 = TREE_OPERAND (_q70, 0);
8010 0 : tree _q81 = TREE_OPERAND (_q70, 1);
8011 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
8012 : {
8013 0 : if ((_q81 == _q50 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q50, 0) && types_match (_q81, _q50)))
8014 : {
8015 0 : {
8016 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
8017 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTL);
8018 0 : if (res) return res;
8019 : }
8020 : }
8021 : }
8022 0 : if ((_q80 == _q50 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q50, 0) && types_match (_q80, _q50)))
8023 : {
8024 0 : if ((_q81 == _q30 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q30, 0) && types_match (_q81, _q30)))
8025 : {
8026 0 : {
8027 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q21, _q50, _p1, _q70 };
8028 0 : tree res = generic_simplify_111 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, BIT_AND_EXPR, CFN_BUILT_IN_POPCOUNTL);
8029 0 : if (res) return res;
8030 : }
8031 : }
8032 : }
8033 : break;
8034 : }
8035 : default:;
8036 : }
8037 : }
8038 : break;
8039 : default:;
8040 : }
8041 : break;
8042 : default:;
8043 : }
8044 : }
8045 : break;
8046 : default:;
8047 : }
8048 : break;
8049 : default:;
8050 : }
8051 : }
8052 : break;
8053 : default:;
8054 : }
8055 : break;
8056 : default:;
8057 : }
8058 : break;
8059 : }
8060 0 : case VEC_PERM_EXPR:
8061 0 : {
8062 0 : tree _q20 = TREE_OPERAND (_p0, 0);
8063 0 : tree _q21 = TREE_OPERAND (_p0, 1);
8064 0 : tree _q22 = TREE_OPERAND (_p0, 2);
8065 0 : switch (TREE_CODE (_q20))
8066 : {
8067 0 : case MULT_EXPR:
8068 0 : {
8069 0 : tree _q30 = TREE_OPERAND (_q20, 0);
8070 0 : tree _q31 = TREE_OPERAND (_q20, 1);
8071 0 : if (tree_vec_same_elem_p (_q31))
8072 : {
8073 0 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
8074 : {
8075 0 : {
8076 0 : tree captures[6] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q22, _p1 };
8077 0 : tree res = generic_simplify_112 (loc, type, _p0, _p1, captures);
8078 0 : if (res) return res;
8079 : }
8080 : }
8081 : }
8082 0 : if (tree_vec_same_elem_p (_q30))
8083 : {
8084 0 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
8085 : {
8086 0 : {
8087 0 : tree captures[6] ATTRIBUTE_UNUSED = { _p0, _q20, _q31, _q30, _q22, _p1 };
8088 0 : tree res = generic_simplify_112 (loc, type, _p0, _p1, captures);
8089 0 : if (res) return res;
8090 : }
8091 : }
8092 : }
8093 : break;
8094 : }
8095 : default:;
8096 : }
8097 : break;
8098 : }
8099 709026 : case CALL_EXPR:
8100 709026 : switch (get_call_combined_fn (_p0))
8101 : {
8102 18 : case CFN_BUILT_IN_LOG:
8103 18 : if (call_expr_nargs (_p0) == 1)
8104 : {
8105 18 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8106 18 : switch (TREE_CODE (_p1))
8107 : {
8108 0 : case CALL_EXPR:
8109 0 : switch (get_call_combined_fn (_p1))
8110 : {
8111 0 : case CFN_BUILT_IN_LOG:
8112 0 : if (call_expr_nargs (_p1) == 1)
8113 : {
8114 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8115 0 : {
8116 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8117 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG);
8118 0 : if (res) return res;
8119 : }
8120 : }
8121 : break;
8122 : default:;
8123 : }
8124 : break;
8125 : default:;
8126 : }
8127 : }
8128 : break;
8129 2 : case CFN_BUILT_IN_LOG2:
8130 2 : if (call_expr_nargs (_p0) == 1)
8131 : {
8132 2 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8133 2 : switch (TREE_CODE (_p1))
8134 : {
8135 0 : case CALL_EXPR:
8136 0 : switch (get_call_combined_fn (_p1))
8137 : {
8138 0 : case CFN_BUILT_IN_LOG2:
8139 0 : if (call_expr_nargs (_p1) == 1)
8140 : {
8141 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8142 0 : {
8143 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8144 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG2);
8145 0 : if (res) return res;
8146 : }
8147 : }
8148 : break;
8149 : default:;
8150 : }
8151 : break;
8152 : default:;
8153 : }
8154 : }
8155 : break;
8156 0 : case CFN_BUILT_IN_LOGF:
8157 0 : if (call_expr_nargs (_p0) == 1)
8158 : {
8159 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8160 0 : switch (TREE_CODE (_p1))
8161 : {
8162 0 : case CALL_EXPR:
8163 0 : switch (get_call_combined_fn (_p1))
8164 : {
8165 0 : case CFN_BUILT_IN_LOGF:
8166 0 : if (call_expr_nargs (_p1) == 1)
8167 : {
8168 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8169 0 : {
8170 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8171 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOGF);
8172 0 : if (res) return res;
8173 : }
8174 : }
8175 : break;
8176 : default:;
8177 : }
8178 : break;
8179 : default:;
8180 : }
8181 : }
8182 : break;
8183 0 : case CFN_BUILT_IN_LOGL:
8184 0 : if (call_expr_nargs (_p0) == 1)
8185 : {
8186 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8187 0 : switch (TREE_CODE (_p1))
8188 : {
8189 0 : case CALL_EXPR:
8190 0 : switch (get_call_combined_fn (_p1))
8191 : {
8192 0 : case CFN_BUILT_IN_LOGL:
8193 0 : if (call_expr_nargs (_p1) == 1)
8194 : {
8195 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8196 0 : {
8197 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8198 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOGL);
8199 0 : if (res) return res;
8200 : }
8201 : }
8202 : break;
8203 : default:;
8204 : }
8205 : break;
8206 : default:;
8207 : }
8208 : }
8209 : break;
8210 0 : case CFN_BUILT_IN_LOG10F:
8211 0 : if (call_expr_nargs (_p0) == 1)
8212 : {
8213 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8214 0 : switch (TREE_CODE (_p1))
8215 : {
8216 0 : case CALL_EXPR:
8217 0 : switch (get_call_combined_fn (_p1))
8218 : {
8219 0 : case CFN_BUILT_IN_LOG10F:
8220 0 : if (call_expr_nargs (_p1) == 1)
8221 : {
8222 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8223 0 : {
8224 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8225 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG10F);
8226 0 : if (res) return res;
8227 : }
8228 : }
8229 : break;
8230 : default:;
8231 : }
8232 : break;
8233 : default:;
8234 : }
8235 : }
8236 : break;
8237 0 : case CFN_BUILT_IN_LOG10L:
8238 0 : if (call_expr_nargs (_p0) == 1)
8239 : {
8240 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8241 0 : switch (TREE_CODE (_p1))
8242 : {
8243 0 : case CALL_EXPR:
8244 0 : switch (get_call_combined_fn (_p1))
8245 : {
8246 0 : case CFN_BUILT_IN_LOG10L:
8247 0 : if (call_expr_nargs (_p1) == 1)
8248 : {
8249 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8250 0 : {
8251 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8252 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG10L);
8253 0 : if (res) return res;
8254 : }
8255 : }
8256 : break;
8257 : default:;
8258 : }
8259 : break;
8260 : default:;
8261 : }
8262 : }
8263 : break;
8264 0 : case CFN_LOG:
8265 0 : if (call_expr_nargs (_p0) == 1)
8266 : {
8267 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8268 0 : switch (TREE_CODE (_p1))
8269 : {
8270 0 : case CALL_EXPR:
8271 0 : switch (get_call_combined_fn (_p1))
8272 : {
8273 0 : case CFN_LOG:
8274 0 : if (call_expr_nargs (_p1) == 1)
8275 : {
8276 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8277 0 : {
8278 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8279 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_LOG);
8280 0 : if (res) return res;
8281 : }
8282 : }
8283 : break;
8284 : default:;
8285 : }
8286 : break;
8287 : default:;
8288 : }
8289 : }
8290 : break;
8291 0 : case CFN_LOG2:
8292 0 : if (call_expr_nargs (_p0) == 1)
8293 : {
8294 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8295 0 : switch (TREE_CODE (_p1))
8296 : {
8297 0 : case CALL_EXPR:
8298 0 : switch (get_call_combined_fn (_p1))
8299 : {
8300 0 : case CFN_LOG2:
8301 0 : if (call_expr_nargs (_p1) == 1)
8302 : {
8303 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8304 0 : {
8305 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8306 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_LOG2);
8307 0 : if (res) return res;
8308 : }
8309 : }
8310 : break;
8311 : default:;
8312 : }
8313 : break;
8314 : default:;
8315 : }
8316 : }
8317 : break;
8318 0 : case CFN_LOG10:
8319 0 : if (call_expr_nargs (_p0) == 1)
8320 : {
8321 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8322 0 : switch (TREE_CODE (_p1))
8323 : {
8324 0 : case CALL_EXPR:
8325 0 : switch (get_call_combined_fn (_p1))
8326 : {
8327 0 : case CFN_LOG10:
8328 0 : if (call_expr_nargs (_p1) == 1)
8329 : {
8330 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8331 0 : {
8332 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8333 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_LOG10);
8334 0 : if (res) return res;
8335 : }
8336 : }
8337 : break;
8338 : default:;
8339 : }
8340 : break;
8341 : default:;
8342 : }
8343 : }
8344 : break;
8345 6 : case CFN_BUILT_IN_LOG10:
8346 6 : if (call_expr_nargs (_p0) == 1)
8347 : {
8348 6 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8349 6 : switch (TREE_CODE (_p1))
8350 : {
8351 2 : case CALL_EXPR:
8352 2 : switch (get_call_combined_fn (_p1))
8353 : {
8354 2 : case CFN_BUILT_IN_LOG10:
8355 2 : if (call_expr_nargs (_p1) == 1)
8356 : {
8357 2 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8358 2 : {
8359 2 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8360 2 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG10);
8361 2 : if (res) return res;
8362 : }
8363 : }
8364 : break;
8365 : default:;
8366 : }
8367 : break;
8368 : default:;
8369 : }
8370 : }
8371 : break;
8372 0 : case CFN_BUILT_IN_LOG2F:
8373 0 : if (call_expr_nargs (_p0) == 1)
8374 : {
8375 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8376 0 : switch (TREE_CODE (_p1))
8377 : {
8378 0 : case CALL_EXPR:
8379 0 : switch (get_call_combined_fn (_p1))
8380 : {
8381 0 : case CFN_BUILT_IN_LOG2F:
8382 0 : if (call_expr_nargs (_p1) == 1)
8383 : {
8384 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8385 0 : {
8386 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8387 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG2F);
8388 0 : if (res) return res;
8389 : }
8390 : }
8391 : break;
8392 : default:;
8393 : }
8394 : break;
8395 : default:;
8396 : }
8397 : }
8398 : break;
8399 0 : case CFN_BUILT_IN_LOG2L:
8400 0 : if (call_expr_nargs (_p0) == 1)
8401 : {
8402 0 : tree _q20 = CALL_EXPR_ARG (_p0, 0);
8403 0 : switch (TREE_CODE (_p1))
8404 : {
8405 0 : case CALL_EXPR:
8406 0 : switch (get_call_combined_fn (_p1))
8407 : {
8408 0 : case CFN_BUILT_IN_LOG2L:
8409 0 : if (call_expr_nargs (_p1) == 1)
8410 : {
8411 0 : tree _q40 = CALL_EXPR_ARG (_p1, 0);
8412 0 : {
8413 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
8414 0 : tree res = generic_simplify_110 (loc, type, _p0, _p1, captures, CFN_BUILT_IN_LOG2L);
8415 0 : if (res) return res;
8416 : }
8417 : }
8418 : break;
8419 : default:;
8420 : }
8421 : break;
8422 : default:;
8423 : }
8424 : }
8425 : break;
8426 : default:;
8427 : }
8428 : break;
8429 20795585 : default:;
8430 : }
8431 20795585 : switch (TREE_CODE (_p1))
8432 : {
8433 7218 : case BIT_AND_EXPR:
8434 7218 : {
8435 7218 : tree _q30 = TREE_OPERAND (_p1, 0);
8436 7218 : tree _q31 = TREE_OPERAND (_p1, 1);
8437 7218 : switch (TREE_CODE (_q30))
8438 : {
8439 80 : case MAX_EXPR:
8440 80 : {
8441 80 : tree _q40 = TREE_OPERAND (_q30, 0);
8442 80 : tree _q41 = TREE_OPERAND (_q30, 1);
8443 80 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
8444 : {
8445 80 : switch (TREE_CODE (_q41))
8446 : {
8447 80 : case INTEGER_CST:
8448 80 : {
8449 80 : switch (TREE_CODE (_q31))
8450 : {
8451 72 : case INTEGER_CST:
8452 72 : {
8453 72 : {
8454 72 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q41, _q31 };
8455 72 : {
8456 72 : auto i = wi::neg (wi::to_wide (captures[2]));
8457 72 : if (wi::popcount (i) == 1
8458 200 : && (wi::to_wide (captures[1])) == (i - 1)
8459 : )
8460 : {
8461 40 : if (TYPE_UNSIGNED (TREE_TYPE (captures[0]))
8462 : )
8463 : {
8464 8 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1320;
8465 8 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1320;
8466 8 : {
8467 8 : tree res_op0;
8468 8 : res_op0 = captures[0];
8469 8 : tree res_op1;
8470 8 : res_op1 = captures[1];
8471 8 : tree _r;
8472 8 : _r = fold_build2_loc (loc, BIT_AND_EXPR, type, res_op0, res_op1);
8473 8 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 950, __FILE__, __LINE__, true);
8474 8 : return _r;
8475 : }
8476 64 : next_after_fail1320:;
8477 : }
8478 : else
8479 : {
8480 32 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1321;
8481 32 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1321;
8482 32 : {
8483 32 : if (! tree_invariant_p (captures[0])) goto next_after_fail1321;
8484 0 : if (! tree_invariant_p (captures[1])) goto next_after_fail1321;
8485 0 : tree res_op0;
8486 0 : {
8487 0 : tree _o1[2], _r1;
8488 0 : _o1[0] = unshare_expr (captures[0]);
8489 0 : _o1[1] = unshare_expr (captures[1]);
8490 0 : _r1 = fold_build2_loc (loc, LE_EXPR, boolean_type_node, _o1[0], _o1[1]);
8491 0 : res_op0 = _r1;
8492 : }
8493 0 : tree res_op1;
8494 0 : res_op1 = unshare_expr (captures[0]);
8495 0 : tree res_op2;
8496 0 : {
8497 0 : tree _o1[2], _r1;
8498 0 : _o1[0] = captures[0];
8499 0 : _o1[1] = captures[1];
8500 0 : _r1 = fold_build2_loc (loc, BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8501 0 : res_op2 = _r1;
8502 : }
8503 0 : tree _r;
8504 0 : _r = fold_build3_loc (loc, COND_EXPR, type, res_op0, res_op1, res_op2);
8505 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 951, __FILE__, __LINE__, true);
8506 0 : return _r;
8507 : }
8508 64 : next_after_fail1321:;
8509 : }
8510 : }
8511 8 : }
8512 : }
8513 64 : break;
8514 : }
8515 : default:;
8516 : }
8517 : break;
8518 : }
8519 : default:;
8520 : }
8521 : }
8522 : break;
8523 : }
8524 : default:;
8525 : }
8526 : break;
8527 : }
8528 20795577 : default:;
8529 : }
8530 20795577 : switch (TREE_CODE (_p0))
8531 : {
8532 0 : case VEC_PERM_EXPR:
8533 0 : {
8534 0 : tree _q20 = TREE_OPERAND (_p0, 0);
8535 0 : tree _q21 = TREE_OPERAND (_p0, 1);
8536 0 : tree _q22 = TREE_OPERAND (_p0, 2);
8537 0 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
8538 : {
8539 0 : switch (TREE_CODE (_p1))
8540 : {
8541 0 : case VEC_PERM_EXPR:
8542 0 : {
8543 0 : tree _q60 = TREE_OPERAND (_p1, 0);
8544 0 : tree _q61 = TREE_OPERAND (_p1, 1);
8545 0 : tree _q62 = TREE_OPERAND (_p1, 2);
8546 0 : if ((_q61 == _q60 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q60, 0) && types_match (_q61, _q60)))
8547 : {
8548 0 : if ((_q62 == _q22 && ! TREE_SIDE_EFFECTS (_q62)) || (operand_equal_p (_q62, _q22, 0) && types_match (_q62, _q22)))
8549 : {
8550 0 : {
8551 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q20, _q22, _q60 };
8552 0 : if (VECTOR_INTEGER_TYPE_P (type)
8553 : )
8554 : {
8555 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1322;
8556 0 : {
8557 0 : tree res_op0;
8558 0 : {
8559 0 : tree _o1[2], _r1;
8560 0 : _o1[0] = captures[0];
8561 0 : _o1[1] = captures[2];
8562 0 : _r1 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8563 0 : captures[3] = _r1;
8564 : }
8565 0 : res_op0 = unshare_expr (captures[3]);
8566 0 : tree res_op1;
8567 0 : res_op1 = captures[3];
8568 0 : tree res_op2;
8569 0 : res_op2 = captures[1];
8570 0 : tree _r;
8571 0 : _r = fold_build3_loc (loc, VEC_PERM_EXPR, type, res_op0, res_op1, res_op2);
8572 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
8573 0 : return _r;
8574 : }
8575 0 : next_after_fail1322:;
8576 : }
8577 : }
8578 : }
8579 : }
8580 : break;
8581 : }
8582 0 : default:;
8583 : }
8584 0 : switch (TREE_CODE (_q22))
8585 : {
8586 0 : case VECTOR_CST:
8587 0 : {
8588 0 : switch (TREE_CODE (_p1))
8589 : {
8590 0 : case VEC_PERM_EXPR:
8591 0 : {
8592 0 : tree _q60 = TREE_OPERAND (_p1, 0);
8593 0 : tree _q61 = TREE_OPERAND (_p1, 1);
8594 0 : tree _q62 = TREE_OPERAND (_p1, 2);
8595 0 : if ((_q61 == _q60 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q60, 0) && types_match (_q61, _q60)))
8596 : {
8597 0 : if ((_q62 == _q22 && ! TREE_SIDE_EFFECTS (_q62)) || (operand_equal_p (_q62, _q22, 0) && types_match (_q62, _q22)))
8598 : {
8599 0 : switch (TREE_CODE (_q62))
8600 : {
8601 0 : case VECTOR_CST:
8602 0 : {
8603 0 : {
8604 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q20, _q22, _q60 };
8605 0 : tree res = generic_simplify_85 (loc, type, _p0, _p1, captures, MINUS_EXPR);
8606 0 : if (res) return res;
8607 : }
8608 0 : break;
8609 : }
8610 : default:;
8611 : }
8612 : }
8613 : }
8614 : break;
8615 : }
8616 : default:;
8617 : }
8618 : break;
8619 : }
8620 : default:;
8621 : }
8622 : }
8623 : break;
8624 : }
8625 : default:;
8626 : }
8627 : return NULL_TREE;
8628 : }
8629 :
8630 : tree
8631 1279568 : generic_simplify_LSHIFT_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0, tree _p1)
8632 : {
8633 1279568 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
8634 1279568 : switch (TREE_CODE (_p1))
8635 : {
8636 269 : case TRUNC_MOD_EXPR:
8637 269 : {
8638 269 : tree _q30 = TREE_OPERAND (_p1, 0);
8639 269 : tree _q31 = TREE_OPERAND (_p1, 1);
8640 269 : {
8641 269 : tree _q31_pops[1];
8642 269 : if (tree_power_of_two_cand (_q31, _q31_pops))
8643 : {
8644 263 : tree _q50 = _q31_pops[0];
8645 263 : {
8646 263 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q30, _q31, _q50 };
8647 263 : tree res = generic_simplify_423 (loc, type, _p0, _p1, captures, LSHIFT_EXPR, TRUNC_MOD_EXPR);
8648 263 : if (res) return res;
8649 : }
8650 : }
8651 : }
8652 78 : break;
8653 : }
8654 0 : case FLOOR_MOD_EXPR:
8655 0 : {
8656 0 : tree _q30 = TREE_OPERAND (_p1, 0);
8657 0 : tree _q31 = TREE_OPERAND (_p1, 1);
8658 0 : {
8659 0 : tree _q31_pops[1];
8660 0 : if (tree_power_of_two_cand (_q31, _q31_pops))
8661 : {
8662 0 : tree _q50 = _q31_pops[0];
8663 0 : {
8664 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q30, _q31, _q50 };
8665 0 : tree res = generic_simplify_423 (loc, type, _p0, _p1, captures, LSHIFT_EXPR, FLOOR_MOD_EXPR);
8666 0 : if (res) return res;
8667 : }
8668 : }
8669 : }
8670 0 : break;
8671 : }
8672 1279377 : default:;
8673 : }
8674 1279377 : if (uniform_integer_cst_p (_p1))
8675 : {
8676 870603 : {
8677 870603 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8678 870603 : tree res = generic_simplify_424 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
8679 870603 : if (res) return res;
8680 : }
8681 : }
8682 1278912 : switch (TREE_CODE (_p0))
8683 : {
8684 715754 : CASE_CONVERT:
8685 715754 : {
8686 715754 : tree _q20 = TREE_OPERAND (_p0, 0);
8687 715754 : switch (TREE_CODE (_q20))
8688 : {
8689 4 : case LT_EXPR:
8690 4 : {
8691 4 : tree _q30 = TREE_OPERAND (_q20, 0);
8692 4 : tree _q31 = TREE_OPERAND (_q20, 1);
8693 4 : if (integer_zerop (_q31))
8694 : {
8695 4 : switch (TREE_CODE (_p1))
8696 : {
8697 4 : case INTEGER_CST:
8698 4 : {
8699 4 : {
8700 4 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
8701 4 : if (TYPE_SIGN (TREE_TYPE (captures[0])) == SIGNED
8702 4 : && wi::eq_p (wi::to_wide (captures[2]), TYPE_PRECISION (TREE_TYPE (captures[0])) - 1)
8703 : )
8704 : {
8705 0 : {
8706 0 : wide_int wone = wi::one (TYPE_PRECISION (type));
8707 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1685;
8708 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1685;
8709 0 : {
8710 0 : tree res_op0;
8711 0 : {
8712 0 : tree _o1[1], _r1;
8713 0 : _o1[0] = captures[0];
8714 0 : if (TREE_TYPE (_o1[0]) != type)
8715 : {
8716 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
8717 : }
8718 : else
8719 : _r1 = _o1[0];
8720 0 : res_op0 = _r1;
8721 : }
8722 0 : tree res_op1;
8723 0 : res_op1 = wide_int_to_tree (type,
8724 0 : wi::lshift (wone, wi::to_wide (captures[2])));
8725 0 : tree _r;
8726 0 : _r = fold_build2_loc (loc, BIT_AND_EXPR, type, res_op0, res_op1);
8727 0 : if (TREE_SIDE_EFFECTS (captures[1]))
8728 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[1]), _r);
8729 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
8730 0 : return _r;
8731 : }
8732 0 : next_after_fail1685:;
8733 0 : }
8734 : }
8735 : }
8736 4 : break;
8737 : }
8738 : default:;
8739 : }
8740 : }
8741 : break;
8742 : }
8743 869 : CASE_CONVERT:
8744 869 : {
8745 869 : tree _q30 = TREE_OPERAND (_q20, 0);
8746 869 : switch (TREE_CODE (_q30))
8747 : {
8748 0 : case RSHIFT_EXPR:
8749 0 : {
8750 0 : tree _q40 = TREE_OPERAND (_q30, 0);
8751 0 : tree _q41 = TREE_OPERAND (_q30, 1);
8752 0 : switch (TREE_CODE (_q41))
8753 : {
8754 0 : case INTEGER_CST:
8755 0 : {
8756 0 : if ((_p1 == _q41 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q41, 0) && types_match (_p1, _q41)))
8757 : {
8758 0 : {
8759 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q40, _q41 };
8760 0 : if (wi::ltu_p (wi::to_wide (captures[2]), element_precision (type))
8761 0 : && INTEGRAL_TYPE_P (type)
8762 0 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
8763 0 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
8764 0 : && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (captures[1]))
8765 0 : && (TYPE_PRECISION (TREE_TYPE (captures[0])) >= TYPE_PRECISION (type)
8766 0 : || wi::geu_p (wi::to_wide (captures[2]),
8767 0 : TYPE_PRECISION (type)
8768 0 : - TYPE_PRECISION (TREE_TYPE (captures[0]))))
8769 : )
8770 : {
8771 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1686;
8772 0 : {
8773 0 : tree res_op0;
8774 0 : {
8775 0 : tree _o1[1], _r1;
8776 0 : _o1[0] = captures[1];
8777 0 : if (TREE_TYPE (_o1[0]) != type)
8778 : {
8779 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, type, _o1[0]);
8780 : }
8781 : else
8782 : _r1 = _o1[0];
8783 0 : res_op0 = _r1;
8784 : }
8785 0 : tree res_op1;
8786 0 : {
8787 0 : tree _o1[2], _r1;
8788 0 : _o1[0] = build_minus_one_cst (type);
8789 0 : _o1[1] = captures[2];
8790 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8791 0 : res_op1 = _r1;
8792 : }
8793 0 : tree _r;
8794 0 : _r = fold_build2_loc (loc, BIT_AND_EXPR, type, res_op0, res_op1);
8795 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1016, __FILE__, __LINE__, true);
8796 0 : return _r;
8797 : }
8798 0 : next_after_fail1686:;
8799 : }
8800 : }
8801 : }
8802 : break;
8803 : }
8804 : default:;
8805 : }
8806 : break;
8807 : }
8808 : default:;
8809 : }
8810 : break;
8811 : }
8812 : default:;
8813 : }
8814 : break;
8815 : }
8816 19652 : case RSHIFT_EXPR:
8817 19652 : {
8818 19652 : tree _q20 = TREE_OPERAND (_p0, 0);
8819 19652 : tree _q21 = TREE_OPERAND (_p0, 1);
8820 19652 : switch (TREE_CODE (_q21))
8821 : {
8822 48 : case INTEGER_CST:
8823 48 : {
8824 48 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
8825 : {
8826 3 : {
8827 3 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
8828 3 : tree res = generic_simplify_425 (loc, type, _p0, _p1, captures);
8829 3 : if (res) return res;
8830 : }
8831 : }
8832 : break;
8833 : }
8834 : default:;
8835 : }
8836 : break;
8837 : }
8838 1278909 : default:;
8839 : }
8840 1278909 : {
8841 1278909 : tree _p0_pops[1];
8842 1278909 : if (tree_nop_convert (_p0, _p0_pops))
8843 : {
8844 680881 : tree _q20 = _p0_pops[0];
8845 680881 : switch (TREE_CODE (_q20))
8846 : {
8847 73 : case RSHIFT_EXPR:
8848 73 : {
8849 73 : tree _q30 = TREE_OPERAND (_q20, 0);
8850 73 : tree _q31 = TREE_OPERAND (_q20, 1);
8851 73 : switch (TREE_CODE (_q31))
8852 : {
8853 67 : case INTEGER_CST:
8854 67 : {
8855 67 : if ((_p1 == _q31 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q31, 0) && types_match (_p1, _q31)))
8856 : {
8857 8 : {
8858 8 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q31 };
8859 8 : tree res = generic_simplify_425 (loc, type, _p0, _p1, captures);
8860 8 : if (res) return res;
8861 : }
8862 : }
8863 : break;
8864 : }
8865 : default:;
8866 : }
8867 : break;
8868 : }
8869 : default:;
8870 : }
8871 : }
8872 : }
8873 1278901 : if (integer_onep (_p0))
8874 : {
8875 331470 : switch (TREE_CODE (_p1))
8876 : {
8877 51725 : case MINUS_EXPR:
8878 51725 : {
8879 51725 : tree _q30 = TREE_OPERAND (_p1, 0);
8880 51725 : tree _q31 = TREE_OPERAND (_p1, 1);
8881 51725 : switch (TREE_CODE (_q30))
8882 : {
8883 51722 : case INTEGER_CST:
8884 51722 : {
8885 51722 : {
8886 51722 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31 };
8887 51722 : if (INTEGRAL_TYPE_P (type)
8888 51722 : && wi::eq_p (wi::to_wide (captures[2]), TYPE_PRECISION (type) - 1)
8889 51722 : && single_use (captures[1])
8890 : )
8891 : {
8892 29115 : if (TYPE_UNSIGNED (type)
8893 : )
8894 : {
8895 29109 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1687;
8896 29109 : {
8897 29109 : tree res_op0;
8898 29109 : {
8899 29109 : tree _o1[2], _r1;
8900 29109 : _o1[0] = captures[0];
8901 29109 : _o1[1] = captures[2];
8902 29109 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8903 29109 : res_op0 = _r1;
8904 : }
8905 29109 : tree res_op1;
8906 29109 : res_op1 = captures[3];
8907 29109 : tree _r;
8908 29109 : _r = fold_build2_loc (loc, RSHIFT_EXPR, type, res_op0, res_op1);
8909 29109 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1017, __FILE__, __LINE__, true);
8910 29109 : return _r;
8911 : }
8912 0 : next_after_fail1687:;
8913 : }
8914 : else
8915 : {
8916 6 : {
8917 6 : tree utype = unsigned_type_for (type);
8918 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1688;
8919 6 : {
8920 6 : tree res_op0;
8921 6 : {
8922 6 : tree _o1[2], _r1;
8923 6 : {
8924 6 : tree _o2[2], _r2;
8925 6 : {
8926 6 : tree _o3[1], _r3;
8927 6 : _o3[0] = captures[0];
8928 6 : if (TREE_TYPE (_o3[0]) != utype)
8929 : {
8930 6 : _r3 = fold_build1_loc (loc, NOP_EXPR, utype, _o3[0]);
8931 : }
8932 : else
8933 : _r3 = _o3[0];
8934 6 : _o2[0] = _r3;
8935 : }
8936 6 : _o2[1] = captures[2];
8937 6 : _r2 = fold_build2_loc (loc, LSHIFT_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
8938 6 : _o1[0] = _r2;
8939 : }
8940 6 : _o1[1] = captures[3];
8941 6 : _r1 = fold_build2_loc (loc, RSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8942 6 : res_op0 = _r1;
8943 : }
8944 6 : tree _r;
8945 6 : _r = fold_build1_loc (loc, NOP_EXPR, type, res_op0);
8946 6 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1018, __FILE__, __LINE__, true);
8947 6 : return _r;
8948 : }
8949 0 : next_after_fail1688:;
8950 : }
8951 : }
8952 : }
8953 : }
8954 22607 : break;
8955 : }
8956 : default:;
8957 : }
8958 : break;
8959 : }
8960 : default:;
8961 : }
8962 : }
8963 1249786 : if (integer_zerop (_p1))
8964 : {
8965 1514 : {
8966 1514 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8967 1514 : tree res = generic_simplify_426 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
8968 1514 : if (res) return res;
8969 : }
8970 : }
8971 1248272 : if (integer_zerop (_p0))
8972 : {
8973 178 : {
8974 178 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8975 178 : tree res = generic_simplify_427 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
8976 178 : if (res) return res;
8977 : }
8978 : }
8979 1248094 : switch (TREE_CODE (_p1))
8980 : {
8981 0 : case VECTOR_CST:
8982 0 : {
8983 0 : {
8984 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8985 0 : tree res = generic_simplify_428 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
8986 0 : if (res) return res;
8987 : }
8988 0 : break;
8989 : }
8990 0 : case CONSTRUCTOR:
8991 0 : {
8992 0 : {
8993 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8994 0 : tree res = generic_simplify_429 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
8995 0 : if (res) return res;
8996 : }
8997 0 : break;
8998 : }
8999 1248094 : default:;
9000 : }
9001 1248094 : switch (TREE_CODE (_p0))
9002 : {
9003 280 : case LSHIFT_EXPR:
9004 280 : {
9005 280 : tree _q20 = TREE_OPERAND (_p0, 0);
9006 280 : tree _q21 = TREE_OPERAND (_p0, 1);
9007 280 : switch (TREE_CODE (_q21))
9008 : {
9009 39 : case INTEGER_CST:
9010 39 : {
9011 39 : switch (TREE_CODE (_p1))
9012 : {
9013 39 : case INTEGER_CST:
9014 39 : {
9015 39 : {
9016 39 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
9017 39 : tree res = generic_simplify_430 (loc, type, _p0, _p1, captures, LSHIFT_EXPR);
9018 39 : if (res) return res;
9019 : }
9020 0 : break;
9021 : }
9022 : default:;
9023 : }
9024 : break;
9025 : }
9026 : default:;
9027 : }
9028 : break;
9029 : }
9030 715131 : CASE_CONVERT:
9031 715131 : {
9032 715131 : tree _q20 = TREE_OPERAND (_p0, 0);
9033 715131 : switch (TREE_CODE (_q20))
9034 : {
9035 0 : case BIT_AND_EXPR:
9036 0 : {
9037 0 : tree _q30 = TREE_OPERAND (_q20, 0);
9038 0 : tree _q31 = TREE_OPERAND (_q20, 1);
9039 0 : switch (TREE_CODE (_q31))
9040 : {
9041 0 : case INTEGER_CST:
9042 0 : {
9043 0 : switch (TREE_CODE (_p1))
9044 : {
9045 0 : case INTEGER_CST:
9046 0 : {
9047 0 : {
9048 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
9049 0 : tree res = generic_simplify_431 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, LSHIFT_EXPR);
9050 0 : if (res) return res;
9051 : }
9052 0 : break;
9053 : }
9054 : default:;
9055 : }
9056 : break;
9057 : }
9058 : default:;
9059 : }
9060 : break;
9061 : }
9062 11 : case BIT_XOR_EXPR:
9063 11 : {
9064 11 : tree _q30 = TREE_OPERAND (_q20, 0);
9065 11 : tree _q31 = TREE_OPERAND (_q20, 1);
9066 11 : switch (TREE_CODE (_q31))
9067 : {
9068 0 : case INTEGER_CST:
9069 0 : {
9070 0 : switch (TREE_CODE (_p1))
9071 : {
9072 0 : case INTEGER_CST:
9073 0 : {
9074 0 : {
9075 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
9076 0 : tree res = generic_simplify_431 (loc, type, _p0, _p1, captures, BIT_XOR_EXPR, LSHIFT_EXPR);
9077 0 : if (res) return res;
9078 : }
9079 0 : break;
9080 : }
9081 : default:;
9082 : }
9083 : break;
9084 : }
9085 : default:;
9086 : }
9087 : break;
9088 : }
9089 18 : case BIT_IOR_EXPR:
9090 18 : {
9091 18 : tree _q30 = TREE_OPERAND (_q20, 0);
9092 18 : tree _q31 = TREE_OPERAND (_q20, 1);
9093 18 : switch (TREE_CODE (_q31))
9094 : {
9095 11 : case INTEGER_CST:
9096 11 : {
9097 11 : switch (TREE_CODE (_p1))
9098 : {
9099 11 : case INTEGER_CST:
9100 11 : {
9101 11 : {
9102 11 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
9103 11 : tree res = generic_simplify_431 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, LSHIFT_EXPR);
9104 11 : if (res) return res;
9105 : }
9106 2 : break;
9107 : }
9108 : default:;
9109 : }
9110 : break;
9111 : }
9112 : default:;
9113 : }
9114 : break;
9115 : }
9116 : default:;
9117 : }
9118 : break;
9119 : }
9120 14350 : case BIT_AND_EXPR:
9121 14350 : {
9122 14350 : tree _q20 = TREE_OPERAND (_p0, 0);
9123 14350 : tree _q21 = TREE_OPERAND (_p0, 1);
9124 14350 : switch (TREE_CODE (_q21))
9125 : {
9126 14255 : case INTEGER_CST:
9127 14255 : {
9128 14255 : switch (TREE_CODE (_p1))
9129 : {
9130 14116 : case INTEGER_CST:
9131 14116 : {
9132 14116 : {
9133 14116 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
9134 14116 : tree res = generic_simplify_432 (loc, type, _p0, _p1, captures, BIT_AND_EXPR, LSHIFT_EXPR);
9135 14116 : if (res) return res;
9136 : }
9137 7 : break;
9138 : }
9139 : default:;
9140 : }
9141 : break;
9142 : }
9143 : default:;
9144 : }
9145 : break;
9146 : }
9147 76 : case BIT_XOR_EXPR:
9148 76 : {
9149 76 : tree _q20 = TREE_OPERAND (_p0, 0);
9150 76 : tree _q21 = TREE_OPERAND (_p0, 1);
9151 76 : switch (TREE_CODE (_q21))
9152 : {
9153 7 : case INTEGER_CST:
9154 7 : {
9155 7 : switch (TREE_CODE (_p1))
9156 : {
9157 7 : case INTEGER_CST:
9158 7 : {
9159 7 : {
9160 7 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
9161 7 : tree res = generic_simplify_432 (loc, type, _p0, _p1, captures, BIT_XOR_EXPR, LSHIFT_EXPR);
9162 7 : if (res) return res;
9163 : }
9164 0 : break;
9165 : }
9166 : default:;
9167 : }
9168 : break;
9169 : }
9170 : default:;
9171 : }
9172 : break;
9173 : }
9174 80 : case BIT_IOR_EXPR:
9175 80 : {
9176 80 : tree _q20 = TREE_OPERAND (_p0, 0);
9177 80 : tree _q21 = TREE_OPERAND (_p0, 1);
9178 80 : switch (TREE_CODE (_q21))
9179 : {
9180 4 : case INTEGER_CST:
9181 4 : {
9182 4 : switch (TREE_CODE (_p1))
9183 : {
9184 2 : case INTEGER_CST:
9185 2 : {
9186 2 : {
9187 2 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
9188 2 : tree res = generic_simplify_432 (loc, type, _p0, _p1, captures, BIT_IOR_EXPR, LSHIFT_EXPR);
9189 2 : if (res) return res;
9190 : }
9191 0 : break;
9192 : }
9193 : default:;
9194 : }
9195 : break;
9196 : }
9197 : default:;
9198 : }
9199 : break;
9200 : }
9201 1 : case VEC_COND_EXPR:
9202 1 : {
9203 1 : tree _q20 = TREE_OPERAND (_p0, 0);
9204 1 : tree _q21 = TREE_OPERAND (_p0, 1);
9205 1 : tree _q22 = TREE_OPERAND (_p0, 2);
9206 1 : switch (TREE_CODE (_p1))
9207 : {
9208 0 : case VEC_COND_EXPR:
9209 0 : {
9210 0 : tree _q60 = TREE_OPERAND (_p1, 0);
9211 0 : tree _q61 = TREE_OPERAND (_p1, 1);
9212 0 : tree _q62 = TREE_OPERAND (_p1, 2);
9213 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
9214 : {
9215 0 : {
9216 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
9217 0 : if (VECTOR_TYPE_P (type)
9218 0 : && (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
9219 : || types_match (type, TREE_TYPE (captures[2]))
9220 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]))
9221 : || (optimize_vectors_before_lowering_p ()
9222 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]), TREE_TYPE (captures[1]))))
9223 : )
9224 : {
9225 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1689;
9226 0 : {
9227 0 : tree res_op0;
9228 0 : res_op0 = captures[1];
9229 0 : tree res_op1;
9230 0 : {
9231 0 : tree _o1[2], _r1;
9232 0 : _o1[0] = captures[2];
9233 0 : _o1[1] = captures[5];
9234 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9235 0 : if (EXPR_P (_r1))
9236 0 : goto next_after_fail1689;
9237 0 : res_op1 = _r1;
9238 : }
9239 0 : tree res_op2;
9240 0 : {
9241 0 : tree _o1[2], _r1;
9242 0 : _o1[0] = captures[3];
9243 0 : _o1[1] = captures[6];
9244 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9245 0 : if (EXPR_P (_r1))
9246 0 : goto next_after_fail1689;
9247 0 : res_op2 = _r1;
9248 : }
9249 0 : tree _r;
9250 0 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
9251 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 908, __FILE__, __LINE__, true);
9252 0 : return _r;
9253 : }
9254 0 : next_after_fail1689:;
9255 : }
9256 : }
9257 : }
9258 : break;
9259 : }
9260 1 : default:;
9261 : }
9262 1 : {
9263 1 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
9264 1 : if (VECTOR_TYPE_P (type)
9265 1 : && (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
9266 : || types_match (type, TREE_TYPE (captures[2]))
9267 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]))
9268 : || (optimize_vectors_before_lowering_p ()
9269 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]), TREE_TYPE (captures[1]))))
9270 : )
9271 : {
9272 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1690;
9273 1 : {
9274 1 : if (! tree_invariant_p (captures[4])) goto next_after_fail1690;
9275 0 : tree res_op0;
9276 0 : res_op0 = captures[1];
9277 0 : tree res_op1;
9278 0 : {
9279 0 : tree _o1[2], _r1;
9280 0 : _o1[0] = captures[2];
9281 0 : _o1[1] = unshare_expr (captures[4]);
9282 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9283 0 : if (EXPR_P (_r1))
9284 0 : goto next_after_fail1690;
9285 0 : res_op1 = _r1;
9286 : }
9287 0 : tree res_op2;
9288 0 : {
9289 0 : tree _o1[2], _r1;
9290 0 : _o1[0] = captures[3];
9291 0 : _o1[1] = captures[4];
9292 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9293 0 : if (EXPR_P (_r1))
9294 0 : goto next_after_fail1690;
9295 0 : res_op2 = _r1;
9296 : }
9297 0 : tree _r;
9298 0 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
9299 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 910, __FILE__, __LINE__, true);
9300 0 : return _r;
9301 : }
9302 1 : next_after_fail1690:;
9303 : }
9304 : }
9305 1 : break;
9306 : }
9307 1233928 : default:;
9308 : }
9309 1233928 : switch (TREE_CODE (_p1))
9310 : {
9311 3 : case VEC_COND_EXPR:
9312 3 : {
9313 3 : tree _q30 = TREE_OPERAND (_p1, 0);
9314 3 : tree _q31 = TREE_OPERAND (_p1, 1);
9315 3 : tree _q32 = TREE_OPERAND (_p1, 2);
9316 3 : {
9317 3 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
9318 3 : if (VECTOR_TYPE_P (type)
9319 3 : && (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
9320 : || types_match (type, TREE_TYPE (captures[3]))
9321 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]))
9322 : || (optimize_vectors_before_lowering_p ()
9323 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]), TREE_TYPE (captures[2]))))
9324 : )
9325 : {
9326 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1691;
9327 3 : {
9328 3 : if (! tree_invariant_p (captures[0])) goto next_after_fail1691;
9329 1 : tree res_op0;
9330 1 : res_op0 = captures[2];
9331 1 : tree res_op1;
9332 1 : {
9333 1 : tree _o1[2], _r1;
9334 1 : _o1[0] = unshare_expr (captures[0]);
9335 1 : _o1[1] = captures[3];
9336 1 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9337 1 : if (EXPR_P (_r1))
9338 0 : goto next_after_fail1691;
9339 1 : res_op1 = _r1;
9340 : }
9341 1 : tree res_op2;
9342 1 : {
9343 1 : tree _o1[2], _r1;
9344 1 : _o1[0] = captures[0];
9345 1 : _o1[1] = captures[4];
9346 1 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, type, _o1[0], _o1[1]);
9347 1 : if (EXPR_P (_r1))
9348 0 : goto next_after_fail1691;
9349 1 : res_op2 = _r1;
9350 : }
9351 1 : tree _r;
9352 1 : _r = fold_build3_loc (loc, VEC_COND_EXPR, type, res_op0, res_op1, res_op2);
9353 1 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 911, __FILE__, __LINE__, true);
9354 1 : return _r;
9355 : }
9356 2 : next_after_fail1691:;
9357 : }
9358 : }
9359 2 : break;
9360 : }
9361 1233927 : default:;
9362 : }
9363 1233927 : switch (TREE_CODE (_p0))
9364 : {
9365 0 : case VEC_PERM_EXPR:
9366 0 : {
9367 0 : tree _q20 = TREE_OPERAND (_p0, 0);
9368 0 : tree _q21 = TREE_OPERAND (_p0, 1);
9369 0 : tree _q22 = TREE_OPERAND (_p0, 2);
9370 0 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
9371 : {
9372 0 : switch (TREE_CODE (_p1))
9373 : {
9374 0 : case VEC_PERM_EXPR:
9375 0 : {
9376 0 : tree _q60 = TREE_OPERAND (_p1, 0);
9377 0 : tree _q61 = TREE_OPERAND (_p1, 1);
9378 0 : tree _q62 = TREE_OPERAND (_p1, 2);
9379 0 : if ((_q61 == _q60 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q60, 0) && types_match (_q61, _q60)))
9380 : {
9381 0 : if ((_q62 == _q22 && ! TREE_SIDE_EFFECTS (_q62)) || (operand_equal_p (_q62, _q22, 0) && types_match (_q62, _q22)))
9382 : {
9383 0 : {
9384 0 : tree captures[4] ATTRIBUTE_UNUSED = { _q20, _q22, _q60 };
9385 0 : if (VECTOR_INTEGER_TYPE_P (type)
9386 : )
9387 : {
9388 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1692;
9389 0 : {
9390 0 : tree res_op0;
9391 0 : {
9392 0 : tree _o1[2], _r1;
9393 0 : _o1[0] = captures[0];
9394 0 : _o1[1] = captures[2];
9395 0 : _r1 = fold_build2_loc (loc, LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9396 0 : captures[3] = _r1;
9397 : }
9398 0 : res_op0 = unshare_expr (captures[3]);
9399 0 : tree res_op1;
9400 0 : res_op1 = captures[3];
9401 0 : tree res_op2;
9402 0 : res_op2 = captures[1];
9403 0 : tree _r;
9404 0 : _r = fold_build3_loc (loc, VEC_PERM_EXPR, type, res_op0, res_op1, res_op2);
9405 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
9406 0 : return _r;
9407 : }
9408 0 : next_after_fail1692:;
9409 : }
9410 : }
9411 : }
9412 : }
9413 : break;
9414 : }
9415 : default:;
9416 : }
9417 : }
9418 : break;
9419 : }
9420 : default:;
9421 : }
9422 : return NULL_TREE;
9423 : }
9424 :
9425 : tree
9426 10736008 : generic_simplify_TRUTH_AND_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0, tree _p1)
9427 : {
9428 10736008 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
9429 10736008 : switch (TREE_CODE (_p0))
9430 : {
9431 961259 : case GE_EXPR:
9432 961259 : {
9433 961259 : tree _q20 = TREE_OPERAND (_p0, 0);
9434 961259 : tree _q21 = TREE_OPERAND (_p0, 1);
9435 961259 : {
9436 961259 : tree _q20_pops[1];
9437 961259 : if (tree_nop_convert (_q20, _q20_pops))
9438 : {
9439 12960 : tree _q30 = _q20_pops[0];
9440 12960 : if (integer_zerop (_q21))
9441 : {
9442 5830 : switch (TREE_CODE (_p1))
9443 : {
9444 548 : case NE_EXPR:
9445 548 : {
9446 548 : tree _q60 = TREE_OPERAND (_p1, 0);
9447 548 : tree _q61 = TREE_OPERAND (_p1, 1);
9448 548 : switch (TREE_CODE (_q60))
9449 : {
9450 0 : case BIT_AND_EXPR:
9451 0 : {
9452 0 : tree _q70 = TREE_OPERAND (_q60, 0);
9453 0 : tree _q71 = TREE_OPERAND (_q60, 1);
9454 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
9455 : {
9456 0 : switch (TREE_CODE (_q71))
9457 : {
9458 0 : case INTEGER_CST:
9459 0 : {
9460 0 : if (integer_zerop (_q61))
9461 : {
9462 0 : {
9463 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q30, _q71 };
9464 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9465 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9466 0 : && wi::eq_p (wi::to_wide (captures[2]),
9467 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9468 : )
9469 : {
9470 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1760;
9471 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1760;
9472 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1760;
9473 0 : {
9474 0 : tree res_op0;
9475 0 : res_op0 = captures[0];
9476 0 : tree res_op1;
9477 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9478 0 : tree _r;
9479 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9480 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9481 0 : return _r;
9482 : }
9483 0 : next_after_fail1760:;
9484 : }
9485 : }
9486 : }
9487 : break;
9488 : }
9489 : default:;
9490 : }
9491 : }
9492 : break;
9493 : }
9494 : default:;
9495 : }
9496 : break;
9497 : }
9498 : default:;
9499 : }
9500 : }
9501 : }
9502 : }
9503 961259 : if (integer_zerop (_q21))
9504 : {
9505 336807 : switch (TREE_CODE (_p1))
9506 : {
9507 34710 : case NE_EXPR:
9508 34710 : {
9509 34710 : tree _q50 = TREE_OPERAND (_p1, 0);
9510 34710 : tree _q51 = TREE_OPERAND (_p1, 1);
9511 34710 : switch (TREE_CODE (_q50))
9512 : {
9513 1 : case BIT_AND_EXPR:
9514 1 : {
9515 1 : tree _q60 = TREE_OPERAND (_q50, 0);
9516 1 : tree _q61 = TREE_OPERAND (_q50, 1);
9517 1 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
9518 : {
9519 0 : switch (TREE_CODE (_q61))
9520 : {
9521 0 : case INTEGER_CST:
9522 0 : {
9523 0 : if (integer_zerop (_q51))
9524 : {
9525 0 : {
9526 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q20, _q61 };
9527 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9528 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9529 0 : && wi::eq_p (wi::to_wide (captures[2]),
9530 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9531 : )
9532 : {
9533 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1761;
9534 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1761;
9535 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1761;
9536 0 : {
9537 0 : tree res_op0;
9538 0 : res_op0 = captures[0];
9539 0 : tree res_op1;
9540 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9541 0 : tree _r;
9542 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9543 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9544 0 : return _r;
9545 : }
9546 0 : next_after_fail1761:;
9547 : }
9548 : }
9549 : }
9550 : break;
9551 : }
9552 : default:;
9553 : }
9554 : }
9555 : break;
9556 : }
9557 : default:;
9558 : }
9559 : break;
9560 : }
9561 : default:;
9562 : }
9563 : }
9564 : break;
9565 : }
9566 2429945 : case NE_EXPR:
9567 2429945 : {
9568 2429945 : tree _q20 = TREE_OPERAND (_p0, 0);
9569 2429945 : tree _q21 = TREE_OPERAND (_p0, 1);
9570 2429945 : switch (TREE_CODE (_q20))
9571 : {
9572 13 : case BIT_AND_EXPR:
9573 13 : {
9574 13 : tree _q30 = TREE_OPERAND (_q20, 0);
9575 13 : tree _q31 = TREE_OPERAND (_q20, 1);
9576 13 : switch (TREE_CODE (_q31))
9577 : {
9578 13 : case INTEGER_CST:
9579 13 : {
9580 13 : if (integer_zerop (_q21))
9581 : {
9582 13 : switch (TREE_CODE (_p1))
9583 : {
9584 0 : case GE_EXPR:
9585 0 : {
9586 0 : tree _q70 = TREE_OPERAND (_p1, 0);
9587 0 : tree _q71 = TREE_OPERAND (_p1, 1);
9588 0 : {
9589 0 : tree _q70_pops[1];
9590 0 : if (tree_nop_convert (_q70, _q70_pops))
9591 : {
9592 0 : tree _q80 = _q70_pops[0];
9593 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
9594 : {
9595 0 : if (integer_zerop (_q71))
9596 : {
9597 0 : {
9598 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q70, _q30, _q31 };
9599 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9600 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9601 0 : && wi::eq_p (wi::to_wide (captures[2]),
9602 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9603 : )
9604 : {
9605 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1762;
9606 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1762;
9607 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1762;
9608 0 : {
9609 0 : tree res_op0;
9610 0 : res_op0 = captures[0];
9611 0 : tree res_op1;
9612 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9613 0 : tree _r;
9614 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9615 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9616 0 : return _r;
9617 : }
9618 0 : next_after_fail1762:;
9619 : }
9620 : }
9621 : }
9622 : }
9623 : }
9624 : }
9625 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
9626 : {
9627 0 : if (integer_zerop (_q71))
9628 : {
9629 0 : {
9630 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q70, _q30, _q31 };
9631 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9632 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9633 0 : && wi::eq_p (wi::to_wide (captures[2]),
9634 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9635 : )
9636 : {
9637 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1763;
9638 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1763;
9639 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1763;
9640 0 : {
9641 0 : tree res_op0;
9642 0 : res_op0 = captures[0];
9643 0 : tree res_op1;
9644 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9645 0 : tree _r;
9646 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9647 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9648 0 : return _r;
9649 : }
9650 0 : next_after_fail1763:;
9651 : }
9652 : }
9653 : }
9654 : }
9655 : break;
9656 : }
9657 : default:;
9658 : }
9659 : }
9660 : break;
9661 : }
9662 : default:;
9663 : }
9664 : break;
9665 : }
9666 : default:;
9667 : }
9668 : break;
9669 : }
9670 : default:;
9671 : }
9672 : return NULL_TREE;
9673 : }
9674 :
9675 : tree
9676 9419877 : generic_simplify_TRUTH_OR_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0, tree _p1)
9677 : {
9678 9419877 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
9679 9419877 : switch (TREE_CODE (_p0))
9680 : {
9681 1051596 : case LT_EXPR:
9682 1051596 : {
9683 1051596 : tree _q20 = TREE_OPERAND (_p0, 0);
9684 1051596 : tree _q21 = TREE_OPERAND (_p0, 1);
9685 1051596 : {
9686 1051596 : tree _q20_pops[1];
9687 1051596 : if (tree_nop_convert (_q20, _q20_pops))
9688 : {
9689 14975 : tree _q30 = _q20_pops[0];
9690 14975 : if (integer_zerop (_q21))
9691 : {
9692 4772 : switch (TREE_CODE (_p1))
9693 : {
9694 1036 : case EQ_EXPR:
9695 1036 : {
9696 1036 : tree _q60 = TREE_OPERAND (_p1, 0);
9697 1036 : tree _q61 = TREE_OPERAND (_p1, 1);
9698 1036 : switch (TREE_CODE (_q60))
9699 : {
9700 765 : case BIT_AND_EXPR:
9701 765 : {
9702 765 : tree _q70 = TREE_OPERAND (_q60, 0);
9703 765 : tree _q71 = TREE_OPERAND (_q60, 1);
9704 765 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
9705 : {
9706 0 : switch (TREE_CODE (_q71))
9707 : {
9708 0 : case INTEGER_CST:
9709 0 : {
9710 0 : if (integer_zerop (_q61))
9711 : {
9712 0 : {
9713 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q30, _q71 };
9714 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9715 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9716 0 : && wi::eq_p (wi::to_wide (captures[2]),
9717 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9718 : )
9719 : {
9720 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1764;
9721 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1764;
9722 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1764;
9723 0 : {
9724 0 : tree res_op0;
9725 0 : res_op0 = captures[0];
9726 0 : tree res_op1;
9727 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9728 0 : tree _r;
9729 0 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
9730 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9731 0 : return _r;
9732 : }
9733 0 : next_after_fail1764:;
9734 : }
9735 : }
9736 : }
9737 : break;
9738 : }
9739 : default:;
9740 : }
9741 : }
9742 : break;
9743 : }
9744 : default:;
9745 : }
9746 : break;
9747 : }
9748 : default:;
9749 : }
9750 : }
9751 : }
9752 : }
9753 1051596 : if (integer_zerop (_q21))
9754 : {
9755 310738 : switch (TREE_CODE (_p1))
9756 : {
9757 112726 : case EQ_EXPR:
9758 112726 : {
9759 112726 : tree _q50 = TREE_OPERAND (_p1, 0);
9760 112726 : tree _q51 = TREE_OPERAND (_p1, 1);
9761 112726 : switch (TREE_CODE (_q50))
9762 : {
9763 94839 : case BIT_AND_EXPR:
9764 94839 : {
9765 94839 : tree _q60 = TREE_OPERAND (_q50, 0);
9766 94839 : tree _q61 = TREE_OPERAND (_q50, 1);
9767 94839 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
9768 : {
9769 0 : switch (TREE_CODE (_q61))
9770 : {
9771 0 : case INTEGER_CST:
9772 0 : {
9773 0 : if (integer_zerop (_q51))
9774 : {
9775 0 : {
9776 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q20, _q61 };
9777 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
9778 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
9779 0 : && wi::eq_p (wi::to_wide (captures[2]),
9780 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
9781 : )
9782 : {
9783 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1765;
9784 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1765;
9785 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1765;
9786 0 : {
9787 0 : tree res_op0;
9788 0 : res_op0 = captures[0];
9789 0 : tree res_op1;
9790 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
9791 0 : tree _r;
9792 0 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
9793 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
9794 0 : return _r;
9795 : }
9796 0 : next_after_fail1765:;
9797 : }
9798 : }
9799 : }
9800 : break;
9801 : }
9802 : default:;
9803 : }
9804 : }
9805 : break;
9806 : }
9807 : default:;
9808 : }
9809 : break;
9810 : }
9811 : default:;
9812 : }
9813 : }
9814 1051596 : switch (TREE_CODE (_q20))
9815 : {
9816 2278 : case POINTER_PLUS_EXPR:
9817 2278 : {
9818 2278 : tree _q30 = TREE_OPERAND (_q20, 0);
9819 2278 : tree _q31 = TREE_OPERAND (_q20, 1);
9820 2278 : switch (TREE_CODE (_q31))
9821 : {
9822 2094 : case INTEGER_CST:
9823 2094 : {
9824 2094 : switch (TREE_CODE (_p1))
9825 : {
9826 143 : case LT_EXPR:
9827 143 : {
9828 143 : tree _q70 = TREE_OPERAND (_p1, 0);
9829 143 : tree _q71 = TREE_OPERAND (_p1, 1);
9830 143 : switch (TREE_CODE (_q70))
9831 : {
9832 10 : case POINTER_PLUS_EXPR:
9833 10 : {
9834 10 : tree _q80 = TREE_OPERAND (_q70, 0);
9835 10 : tree _q81 = TREE_OPERAND (_q70, 1);
9836 10 : if ((_q80 == _q21 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q21, 0) && types_match (_q80, _q21)))
9837 : {
9838 1 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
9839 : {
9840 1 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
9841 : {
9842 1 : {
9843 1 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q70 };
9844 1 : const enum tree_code cmp = LT_EXPR;
9845 1 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
9846 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
9847 1 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
9848 : )
9849 : {
9850 0 : {
9851 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
9852 0 : offset_int rhs = off * 2;
9853 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
9854 : )
9855 : {
9856 0 : {
9857 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
9858 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
9859 0 : if (cmp == LT_EXPR
9860 : )
9861 : {
9862 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1766;
9863 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1766;
9864 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1766;
9865 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1766;
9866 0 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1766;
9867 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1766;
9868 0 : {
9869 0 : tree res_op0;
9870 0 : {
9871 0 : tree _o1[1], _r1;
9872 0 : {
9873 0 : tree _o2[2], _r2;
9874 0 : _o2[0] = swap_p ? captures[6] : captures[1];
9875 0 : _o2[1] = swap_p ? captures[2] : captures[4];
9876 0 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
9877 0 : _o1[0] = _r2;
9878 : }
9879 0 : if (TREE_TYPE (_o1[0]) != sizetype)
9880 : {
9881 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
9882 : }
9883 : else
9884 : _r1 = _o1[0];
9885 0 : res_op0 = _r1;
9886 : }
9887 0 : tree res_op1;
9888 0 : res_op1 = rhs_tree;
9889 0 : tree _r;
9890 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9891 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
9892 0 : return _r;
9893 : }
9894 0 : next_after_fail1766:;
9895 : }
9896 : else
9897 : {
9898 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1767;
9899 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1767;
9900 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1767;
9901 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1767;
9902 : {
9903 : tree res_op0;
9904 : {
9905 : tree _o1[1], _r1;
9906 : {
9907 : tree _o2[2], _r2;
9908 : {
9909 : tree _o3[2], _r3;
9910 : _o3[0] = swap_p ? captures[4] : captures[2];
9911 : _o3[1] = wide_int_to_tree (sizetype, off);
9912 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
9913 : _o2[0] = _r3;
9914 : }
9915 : _o2[1] = swap_p ? captures[2] : captures[4];
9916 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
9917 : _o1[0] = _r2;
9918 : }
9919 : if (TREE_TYPE (_o1[0]) != sizetype)
9920 : {
9921 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
9922 : }
9923 : else
9924 : _r1 = _o1[0];
9925 : res_op0 = _r1;
9926 : }
9927 : tree res_op1;
9928 : res_op1 = rhs_tree;
9929 : tree _r;
9930 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
9931 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
9932 : return _r;
9933 : }
9934 : next_after_fail1767:;
9935 : }
9936 : }
9937 : }
9938 : }
9939 : }
9940 : }
9941 : }
9942 : }
9943 : }
9944 : break;
9945 : }
9946 : default:;
9947 : }
9948 : break;
9949 : }
9950 757 : case GT_EXPR:
9951 757 : {
9952 757 : tree _q70 = TREE_OPERAND (_p1, 0);
9953 757 : tree _q71 = TREE_OPERAND (_p1, 1);
9954 757 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
9955 : {
9956 0 : switch (TREE_CODE (_q71))
9957 : {
9958 0 : case POINTER_PLUS_EXPR:
9959 0 : {
9960 0 : tree _q90 = TREE_OPERAND (_q71, 0);
9961 0 : tree _q91 = TREE_OPERAND (_q71, 1);
9962 0 : if ((_q90 == _q21 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q21, 0) && types_match (_q90, _q21)))
9963 : {
9964 0 : if ((_q91 == _q31 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q31, 0) && types_match (_q91, _q31)))
9965 : {
9966 0 : {
9967 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q71 };
9968 0 : const enum tree_code cmp = LT_EXPR;
9969 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
9970 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
9971 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
9972 : )
9973 : {
9974 0 : {
9975 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
9976 0 : offset_int rhs = off * 2;
9977 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
9978 : )
9979 : {
9980 0 : {
9981 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
9982 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
9983 0 : if (cmp == LT_EXPR
9984 : )
9985 : {
9986 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1768;
9987 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1768;
9988 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1768;
9989 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1768;
9990 0 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1768;
9991 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1768;
9992 0 : {
9993 0 : tree res_op0;
9994 0 : {
9995 0 : tree _o1[1], _r1;
9996 0 : {
9997 0 : tree _o2[2], _r2;
9998 0 : _o2[0] = swap_p ? captures[6] : captures[1];
9999 0 : _o2[1] = swap_p ? captures[2] : captures[4];
10000 0 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10001 0 : _o1[0] = _r2;
10002 : }
10003 0 : if (TREE_TYPE (_o1[0]) != sizetype)
10004 : {
10005 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10006 : }
10007 : else
10008 : _r1 = _o1[0];
10009 0 : res_op0 = _r1;
10010 : }
10011 0 : tree res_op1;
10012 0 : res_op1 = rhs_tree;
10013 0 : tree _r;
10014 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10015 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10016 0 : return _r;
10017 : }
10018 0 : next_after_fail1768:;
10019 : }
10020 : else
10021 : {
10022 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1769;
10023 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1769;
10024 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1769;
10025 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1769;
10026 : {
10027 : tree res_op0;
10028 : {
10029 : tree _o1[1], _r1;
10030 : {
10031 : tree _o2[2], _r2;
10032 : {
10033 : tree _o3[2], _r3;
10034 : _o3[0] = swap_p ? captures[4] : captures[2];
10035 : _o3[1] = wide_int_to_tree (sizetype, off);
10036 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10037 : _o2[0] = _r3;
10038 : }
10039 : _o2[1] = swap_p ? captures[2] : captures[4];
10040 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10041 : _o1[0] = _r2;
10042 : }
10043 : if (TREE_TYPE (_o1[0]) != sizetype)
10044 : {
10045 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10046 : }
10047 : else
10048 : _r1 = _o1[0];
10049 : res_op0 = _r1;
10050 : }
10051 : tree res_op1;
10052 : res_op1 = rhs_tree;
10053 : tree _r;
10054 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10055 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10056 : return _r;
10057 : }
10058 : next_after_fail1769:;
10059 : }
10060 : }
10061 : }
10062 : }
10063 : }
10064 : }
10065 : }
10066 : }
10067 : break;
10068 : }
10069 : default:;
10070 : }
10071 : }
10072 : break;
10073 : }
10074 : default:;
10075 : }
10076 : break;
10077 : }
10078 : default:;
10079 : }
10080 : break;
10081 : }
10082 : default:;
10083 : }
10084 : break;
10085 : }
10086 2030649 : case EQ_EXPR:
10087 2030649 : {
10088 2030649 : tree _q20 = TREE_OPERAND (_p0, 0);
10089 2030649 : tree _q21 = TREE_OPERAND (_p0, 1);
10090 2030649 : switch (TREE_CODE (_q20))
10091 : {
10092 56344 : case BIT_AND_EXPR:
10093 56344 : {
10094 56344 : tree _q30 = TREE_OPERAND (_q20, 0);
10095 56344 : tree _q31 = TREE_OPERAND (_q20, 1);
10096 56344 : switch (TREE_CODE (_q31))
10097 : {
10098 56344 : case INTEGER_CST:
10099 56344 : {
10100 56344 : if (integer_zerop (_q21))
10101 : {
10102 56325 : switch (TREE_CODE (_p1))
10103 : {
10104 0 : case LT_EXPR:
10105 0 : {
10106 0 : tree _q70 = TREE_OPERAND (_p1, 0);
10107 0 : tree _q71 = TREE_OPERAND (_p1, 1);
10108 0 : {
10109 0 : tree _q70_pops[1];
10110 0 : if (tree_nop_convert (_q70, _q70_pops))
10111 : {
10112 0 : tree _q80 = _q70_pops[0];
10113 0 : if ((_q80 == _q30 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q30, 0) && types_match (_q80, _q30)))
10114 : {
10115 0 : if (integer_zerop (_q71))
10116 : {
10117 0 : {
10118 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q70, _q30, _q31 };
10119 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
10120 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
10121 0 : && wi::eq_p (wi::to_wide (captures[2]),
10122 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
10123 : )
10124 : {
10125 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1770;
10126 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1770;
10127 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1770;
10128 0 : {
10129 0 : tree res_op0;
10130 0 : res_op0 = captures[0];
10131 0 : tree res_op1;
10132 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
10133 0 : tree _r;
10134 0 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
10135 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
10136 0 : return _r;
10137 : }
10138 0 : next_after_fail1770:;
10139 : }
10140 : }
10141 : }
10142 : }
10143 : }
10144 : }
10145 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
10146 : {
10147 0 : if (integer_zerop (_q71))
10148 : {
10149 0 : {
10150 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q70, _q30, _q31 };
10151 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
10152 0 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
10153 0 : && wi::eq_p (wi::to_wide (captures[2]),
10154 0 : wi::max_value (TYPE_PRECISION (TREE_TYPE (captures[1])), SIGNED))
10155 : )
10156 : {
10157 0 : if (TREE_SIDE_EFFECTS (_p0)) goto next_after_fail1771;
10158 0 : if (TREE_SIDE_EFFECTS (_p1)) goto next_after_fail1771;
10159 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1771;
10160 0 : {
10161 0 : tree res_op0;
10162 0 : res_op0 = captures[0];
10163 0 : tree res_op1;
10164 0 : res_op1 = build_zero_cst (TREE_TYPE (captures[0]));
10165 0 : tree _r;
10166 0 : _r = fold_build2_loc (loc, LE_EXPR, type, res_op0, res_op1);
10167 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 952, __FILE__, __LINE__, true);
10168 0 : return _r;
10169 : }
10170 0 : next_after_fail1771:;
10171 : }
10172 : }
10173 : }
10174 : }
10175 : break;
10176 : }
10177 : default:;
10178 : }
10179 : }
10180 : break;
10181 : }
10182 : default:;
10183 : }
10184 : break;
10185 : }
10186 : default:;
10187 : }
10188 : break;
10189 : }
10190 1339798 : case LE_EXPR:
10191 1339798 : {
10192 1339798 : tree _q20 = TREE_OPERAND (_p0, 0);
10193 1339798 : tree _q21 = TREE_OPERAND (_p0, 1);
10194 1339798 : switch (TREE_CODE (_q20))
10195 : {
10196 3930 : case POINTER_PLUS_EXPR:
10197 3930 : {
10198 3930 : tree _q30 = TREE_OPERAND (_q20, 0);
10199 3930 : tree _q31 = TREE_OPERAND (_q20, 1);
10200 3930 : switch (TREE_CODE (_q31))
10201 : {
10202 3692 : case INTEGER_CST:
10203 3692 : {
10204 3692 : switch (TREE_CODE (_p1))
10205 : {
10206 1090 : case LE_EXPR:
10207 1090 : {
10208 1090 : tree _q70 = TREE_OPERAND (_p1, 0);
10209 1090 : tree _q71 = TREE_OPERAND (_p1, 1);
10210 1090 : switch (TREE_CODE (_q70))
10211 : {
10212 804 : case POINTER_PLUS_EXPR:
10213 804 : {
10214 804 : tree _q80 = TREE_OPERAND (_q70, 0);
10215 804 : tree _q81 = TREE_OPERAND (_q70, 1);
10216 804 : if ((_q80 == _q21 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q21, 0) && types_match (_q80, _q21)))
10217 : {
10218 518 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
10219 : {
10220 399 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
10221 : {
10222 399 : {
10223 399 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q70 };
10224 399 : const enum tree_code cmp = LE_EXPR;
10225 399 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10226 398 : && TYPE_OVERFLOW_WRAPS (sizetype)
10227 797 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10228 : )
10229 : {
10230 398 : {
10231 398 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10232 398 : offset_int rhs = off * 2;
10233 398 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10234 : )
10235 : {
10236 398 : {
10237 398 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10238 398 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10239 398 : if (cmp == LT_EXPR
10240 : )
10241 : {
10242 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1772;
10243 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1772;
10244 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1772;
10245 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1772;
10246 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1772;
10247 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1772;
10248 : {
10249 : tree res_op0;
10250 : {
10251 : tree _o1[1], _r1;
10252 : {
10253 : tree _o2[2], _r2;
10254 : _o2[0] = swap_p ? captures[6] : captures[1];
10255 : _o2[1] = swap_p ? captures[2] : captures[4];
10256 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10257 : _o1[0] = _r2;
10258 : }
10259 : if (TREE_TYPE (_o1[0]) != sizetype)
10260 : {
10261 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10262 : }
10263 : else
10264 : _r1 = _o1[0];
10265 : res_op0 = _r1;
10266 : }
10267 : tree res_op1;
10268 : res_op1 = rhs_tree;
10269 : tree _r;
10270 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10271 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10272 398 : return _r;
10273 : }
10274 : next_after_fail1772:;
10275 : }
10276 : else
10277 : {
10278 398 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1773;
10279 398 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1773;
10280 398 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1773;
10281 398 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1773;
10282 398 : {
10283 398 : tree res_op0;
10284 398 : {
10285 398 : tree _o1[1], _r1;
10286 398 : {
10287 398 : tree _o2[2], _r2;
10288 398 : {
10289 398 : tree _o3[2], _r3;
10290 398 : _o3[0] = swap_p ? captures[4] : captures[2];
10291 398 : _o3[1] = wide_int_to_tree (sizetype, off);
10292 398 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10293 398 : _o2[0] = _r3;
10294 : }
10295 398 : _o2[1] = swap_p ? captures[2] : captures[4];
10296 398 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10297 398 : _o1[0] = _r2;
10298 : }
10299 398 : if (TREE_TYPE (_o1[0]) != sizetype)
10300 : {
10301 398 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10302 : }
10303 : else
10304 : _r1 = _o1[0];
10305 398 : res_op0 = _r1;
10306 : }
10307 398 : tree res_op1;
10308 398 : res_op1 = rhs_tree;
10309 398 : tree _r;
10310 398 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10311 398 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10312 398 : return _r;
10313 : }
10314 0 : next_after_fail1773:;
10315 : }
10316 : }
10317 : }
10318 : }
10319 : }
10320 : }
10321 : }
10322 : }
10323 : }
10324 : break;
10325 : }
10326 : default:;
10327 : }
10328 : break;
10329 : }
10330 117 : case GE_EXPR:
10331 117 : {
10332 117 : tree _q70 = TREE_OPERAND (_p1, 0);
10333 117 : tree _q71 = TREE_OPERAND (_p1, 1);
10334 117 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
10335 : {
10336 18 : switch (TREE_CODE (_q71))
10337 : {
10338 18 : case POINTER_PLUS_EXPR:
10339 18 : {
10340 18 : tree _q90 = TREE_OPERAND (_q71, 0);
10341 18 : tree _q91 = TREE_OPERAND (_q71, 1);
10342 18 : if ((_q90 == _q21 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q21, 0) && types_match (_q90, _q21)))
10343 : {
10344 16 : if ((_q91 == _q31 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q31, 0) && types_match (_q91, _q31)))
10345 : {
10346 11 : {
10347 11 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q71 };
10348 11 : const enum tree_code cmp = LE_EXPR;
10349 11 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10350 11 : && TYPE_OVERFLOW_WRAPS (sizetype)
10351 22 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10352 : )
10353 : {
10354 11 : {
10355 11 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10356 11 : offset_int rhs = off * 2;
10357 11 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10358 : )
10359 : {
10360 11 : {
10361 11 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10362 11 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10363 11 : if (cmp == LT_EXPR
10364 : )
10365 : {
10366 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1774;
10367 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1774;
10368 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1774;
10369 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1774;
10370 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1774;
10371 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1774;
10372 : {
10373 : tree res_op0;
10374 : {
10375 : tree _o1[1], _r1;
10376 : {
10377 : tree _o2[2], _r2;
10378 : _o2[0] = swap_p ? captures[6] : captures[1];
10379 : _o2[1] = swap_p ? captures[2] : captures[4];
10380 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10381 : _o1[0] = _r2;
10382 : }
10383 : if (TREE_TYPE (_o1[0]) != sizetype)
10384 : {
10385 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10386 : }
10387 : else
10388 : _r1 = _o1[0];
10389 : res_op0 = _r1;
10390 : }
10391 : tree res_op1;
10392 : res_op1 = rhs_tree;
10393 : tree _r;
10394 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10395 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10396 11 : return _r;
10397 : }
10398 : next_after_fail1774:;
10399 : }
10400 : else
10401 : {
10402 11 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1775;
10403 11 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1775;
10404 11 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1775;
10405 11 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1775;
10406 11 : {
10407 11 : tree res_op0;
10408 11 : {
10409 11 : tree _o1[1], _r1;
10410 11 : {
10411 11 : tree _o2[2], _r2;
10412 11 : {
10413 11 : tree _o3[2], _r3;
10414 11 : _o3[0] = swap_p ? captures[4] : captures[2];
10415 11 : _o3[1] = wide_int_to_tree (sizetype, off);
10416 11 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10417 11 : _o2[0] = _r3;
10418 : }
10419 11 : _o2[1] = swap_p ? captures[2] : captures[4];
10420 11 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10421 11 : _o1[0] = _r2;
10422 : }
10423 11 : if (TREE_TYPE (_o1[0]) != sizetype)
10424 : {
10425 11 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10426 : }
10427 : else
10428 : _r1 = _o1[0];
10429 11 : res_op0 = _r1;
10430 : }
10431 11 : tree res_op1;
10432 11 : res_op1 = rhs_tree;
10433 11 : tree _r;
10434 11 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10435 11 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10436 11 : return _r;
10437 : }
10438 0 : next_after_fail1775:;
10439 : }
10440 : }
10441 : }
10442 : }
10443 : }
10444 : }
10445 : }
10446 : }
10447 : break;
10448 : }
10449 : default:;
10450 : }
10451 : }
10452 : break;
10453 : }
10454 : default:;
10455 : }
10456 : break;
10457 : }
10458 : default:;
10459 : }
10460 : break;
10461 : }
10462 : default:;
10463 : }
10464 : break;
10465 : }
10466 794229 : case GE_EXPR:
10467 794229 : {
10468 794229 : tree _q20 = TREE_OPERAND (_p0, 0);
10469 794229 : tree _q21 = TREE_OPERAND (_p0, 1);
10470 794229 : switch (TREE_CODE (_q21))
10471 : {
10472 56 : case POINTER_PLUS_EXPR:
10473 56 : {
10474 56 : tree _q40 = TREE_OPERAND (_q21, 0);
10475 56 : tree _q41 = TREE_OPERAND (_q21, 1);
10476 56 : switch (TREE_CODE (_q41))
10477 : {
10478 56 : case INTEGER_CST:
10479 56 : {
10480 56 : switch (TREE_CODE (_p1))
10481 : {
10482 54 : case LE_EXPR:
10483 54 : {
10484 54 : tree _q70 = TREE_OPERAND (_p1, 0);
10485 54 : tree _q71 = TREE_OPERAND (_p1, 1);
10486 54 : switch (TREE_CODE (_q70))
10487 : {
10488 44 : case POINTER_PLUS_EXPR:
10489 44 : {
10490 44 : tree _q80 = TREE_OPERAND (_q70, 0);
10491 44 : tree _q81 = TREE_OPERAND (_q70, 1);
10492 44 : if ((_q80 == _q20 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q20, 0) && types_match (_q80, _q20)))
10493 : {
10494 29 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
10495 : {
10496 3 : if ((_q71 == _q40 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q40, 0) && types_match (_q71, _q40)))
10497 : {
10498 3 : {
10499 3 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q70 };
10500 3 : const enum tree_code cmp = LE_EXPR;
10501 3 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10502 3 : && TYPE_OVERFLOW_WRAPS (sizetype)
10503 6 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10504 : )
10505 : {
10506 3 : {
10507 3 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10508 3 : offset_int rhs = off * 2;
10509 3 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10510 : )
10511 : {
10512 3 : {
10513 3 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10514 3 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10515 3 : if (cmp == LT_EXPR
10516 : )
10517 : {
10518 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1776;
10519 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1776;
10520 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1776;
10521 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1776;
10522 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1776;
10523 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1776;
10524 : {
10525 : tree res_op0;
10526 : {
10527 : tree _o1[1], _r1;
10528 : {
10529 : tree _o2[2], _r2;
10530 : _o2[0] = swap_p ? captures[6] : captures[1];
10531 : _o2[1] = swap_p ? captures[2] : captures[4];
10532 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10533 : _o1[0] = _r2;
10534 : }
10535 : if (TREE_TYPE (_o1[0]) != sizetype)
10536 : {
10537 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10538 : }
10539 : else
10540 : _r1 = _o1[0];
10541 : res_op0 = _r1;
10542 : }
10543 : tree res_op1;
10544 : res_op1 = rhs_tree;
10545 : tree _r;
10546 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10547 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10548 3 : return _r;
10549 : }
10550 : next_after_fail1776:;
10551 : }
10552 : else
10553 : {
10554 3 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1777;
10555 3 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1777;
10556 3 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1777;
10557 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1777;
10558 3 : {
10559 3 : tree res_op0;
10560 3 : {
10561 3 : tree _o1[1], _r1;
10562 3 : {
10563 3 : tree _o2[2], _r2;
10564 3 : {
10565 3 : tree _o3[2], _r3;
10566 3 : _o3[0] = swap_p ? captures[4] : captures[2];
10567 3 : _o3[1] = wide_int_to_tree (sizetype, off);
10568 3 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10569 3 : _o2[0] = _r3;
10570 : }
10571 3 : _o2[1] = swap_p ? captures[2] : captures[4];
10572 3 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10573 3 : _o1[0] = _r2;
10574 : }
10575 3 : if (TREE_TYPE (_o1[0]) != sizetype)
10576 : {
10577 3 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10578 : }
10579 : else
10580 : _r1 = _o1[0];
10581 3 : res_op0 = _r1;
10582 : }
10583 3 : tree res_op1;
10584 3 : res_op1 = rhs_tree;
10585 3 : tree _r;
10586 3 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10587 3 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10588 3 : return _r;
10589 : }
10590 0 : next_after_fail1777:;
10591 : }
10592 : }
10593 : }
10594 : }
10595 : }
10596 : }
10597 : }
10598 : }
10599 : }
10600 : break;
10601 : }
10602 : default:;
10603 : }
10604 : break;
10605 : }
10606 0 : case GE_EXPR:
10607 0 : {
10608 0 : tree _q70 = TREE_OPERAND (_p1, 0);
10609 0 : tree _q71 = TREE_OPERAND (_p1, 1);
10610 0 : if ((_q70 == _q40 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q40, 0) && types_match (_q70, _q40)))
10611 : {
10612 0 : switch (TREE_CODE (_q71))
10613 : {
10614 0 : case POINTER_PLUS_EXPR:
10615 0 : {
10616 0 : tree _q90 = TREE_OPERAND (_q71, 0);
10617 0 : tree _q91 = TREE_OPERAND (_q71, 1);
10618 0 : if ((_q90 == _q20 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q20, 0) && types_match (_q90, _q20)))
10619 : {
10620 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
10621 : {
10622 0 : {
10623 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q71 };
10624 0 : const enum tree_code cmp = LE_EXPR;
10625 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10626 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
10627 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10628 : )
10629 : {
10630 0 : {
10631 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10632 0 : offset_int rhs = off * 2;
10633 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10634 : )
10635 : {
10636 0 : {
10637 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10638 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10639 0 : if (cmp == LT_EXPR
10640 : )
10641 : {
10642 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1778;
10643 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1778;
10644 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1778;
10645 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1778;
10646 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1778;
10647 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1778;
10648 : {
10649 : tree res_op0;
10650 : {
10651 : tree _o1[1], _r1;
10652 : {
10653 : tree _o2[2], _r2;
10654 : _o2[0] = swap_p ? captures[6] : captures[1];
10655 : _o2[1] = swap_p ? captures[2] : captures[4];
10656 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10657 : _o1[0] = _r2;
10658 : }
10659 : if (TREE_TYPE (_o1[0]) != sizetype)
10660 : {
10661 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10662 : }
10663 : else
10664 : _r1 = _o1[0];
10665 : res_op0 = _r1;
10666 : }
10667 : tree res_op1;
10668 : res_op1 = rhs_tree;
10669 : tree _r;
10670 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10671 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10672 0 : return _r;
10673 : }
10674 : next_after_fail1778:;
10675 : }
10676 : else
10677 : {
10678 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1779;
10679 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1779;
10680 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1779;
10681 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1779;
10682 0 : {
10683 0 : tree res_op0;
10684 0 : {
10685 0 : tree _o1[1], _r1;
10686 0 : {
10687 0 : tree _o2[2], _r2;
10688 0 : {
10689 0 : tree _o3[2], _r3;
10690 0 : _o3[0] = swap_p ? captures[4] : captures[2];
10691 0 : _o3[1] = wide_int_to_tree (sizetype, off);
10692 0 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10693 0 : _o2[0] = _r3;
10694 : }
10695 0 : _o2[1] = swap_p ? captures[2] : captures[4];
10696 0 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10697 0 : _o1[0] = _r2;
10698 : }
10699 0 : if (TREE_TYPE (_o1[0]) != sizetype)
10700 : {
10701 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10702 : }
10703 : else
10704 : _r1 = _o1[0];
10705 0 : res_op0 = _r1;
10706 : }
10707 0 : tree res_op1;
10708 0 : res_op1 = rhs_tree;
10709 0 : tree _r;
10710 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10711 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10712 0 : return _r;
10713 : }
10714 0 : next_after_fail1779:;
10715 : }
10716 : }
10717 : }
10718 : }
10719 : }
10720 : }
10721 : }
10722 : }
10723 : break;
10724 : }
10725 : default:;
10726 : }
10727 : }
10728 : break;
10729 : }
10730 : default:;
10731 : }
10732 : break;
10733 : }
10734 : default:;
10735 : }
10736 : break;
10737 : }
10738 : default:;
10739 : }
10740 : break;
10741 : }
10742 1181853 : case GT_EXPR:
10743 1181853 : {
10744 1181853 : tree _q20 = TREE_OPERAND (_p0, 0);
10745 1181853 : tree _q21 = TREE_OPERAND (_p0, 1);
10746 1181853 : switch (TREE_CODE (_q21))
10747 : {
10748 46 : case POINTER_PLUS_EXPR:
10749 46 : {
10750 46 : tree _q40 = TREE_OPERAND (_q21, 0);
10751 46 : tree _q41 = TREE_OPERAND (_q21, 1);
10752 46 : switch (TREE_CODE (_q41))
10753 : {
10754 46 : case INTEGER_CST:
10755 46 : {
10756 46 : switch (TREE_CODE (_p1))
10757 : {
10758 0 : case LT_EXPR:
10759 0 : {
10760 0 : tree _q70 = TREE_OPERAND (_p1, 0);
10761 0 : tree _q71 = TREE_OPERAND (_p1, 1);
10762 0 : switch (TREE_CODE (_q70))
10763 : {
10764 0 : case POINTER_PLUS_EXPR:
10765 0 : {
10766 0 : tree _q80 = TREE_OPERAND (_q70, 0);
10767 0 : tree _q81 = TREE_OPERAND (_q70, 1);
10768 0 : if ((_q80 == _q20 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q20, 0) && types_match (_q80, _q20)))
10769 : {
10770 0 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
10771 : {
10772 0 : if ((_q71 == _q40 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q40, 0) && types_match (_q71, _q40)))
10773 : {
10774 0 : {
10775 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q70 };
10776 0 : const enum tree_code cmp = LT_EXPR;
10777 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10778 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
10779 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10780 : )
10781 : {
10782 0 : {
10783 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10784 0 : offset_int rhs = off * 2;
10785 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10786 : )
10787 : {
10788 0 : {
10789 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10790 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10791 0 : if (cmp == LT_EXPR
10792 : )
10793 : {
10794 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1780;
10795 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1780;
10796 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1780;
10797 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1780;
10798 0 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1780;
10799 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1780;
10800 0 : {
10801 0 : tree res_op0;
10802 0 : {
10803 0 : tree _o1[1], _r1;
10804 0 : {
10805 0 : tree _o2[2], _r2;
10806 0 : _o2[0] = swap_p ? captures[6] : captures[1];
10807 0 : _o2[1] = swap_p ? captures[2] : captures[4];
10808 0 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10809 0 : _o1[0] = _r2;
10810 : }
10811 0 : if (TREE_TYPE (_o1[0]) != sizetype)
10812 : {
10813 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10814 : }
10815 : else
10816 : _r1 = _o1[0];
10817 0 : res_op0 = _r1;
10818 : }
10819 0 : tree res_op1;
10820 0 : res_op1 = rhs_tree;
10821 0 : tree _r;
10822 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10823 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10824 0 : return _r;
10825 : }
10826 0 : next_after_fail1780:;
10827 : }
10828 : else
10829 : {
10830 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1781;
10831 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1781;
10832 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1781;
10833 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1781;
10834 : {
10835 : tree res_op0;
10836 : {
10837 : tree _o1[1], _r1;
10838 : {
10839 : tree _o2[2], _r2;
10840 : {
10841 : tree _o3[2], _r3;
10842 : _o3[0] = swap_p ? captures[4] : captures[2];
10843 : _o3[1] = wide_int_to_tree (sizetype, off);
10844 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10845 : _o2[0] = _r3;
10846 : }
10847 : _o2[1] = swap_p ? captures[2] : captures[4];
10848 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10849 : _o1[0] = _r2;
10850 : }
10851 : if (TREE_TYPE (_o1[0]) != sizetype)
10852 : {
10853 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10854 : }
10855 : else
10856 : _r1 = _o1[0];
10857 : res_op0 = _r1;
10858 : }
10859 : tree res_op1;
10860 : res_op1 = rhs_tree;
10861 : tree _r;
10862 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10863 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10864 : return _r;
10865 : }
10866 : next_after_fail1781:;
10867 : }
10868 : }
10869 : }
10870 : }
10871 : }
10872 : }
10873 : }
10874 : }
10875 : }
10876 : break;
10877 : }
10878 : default:;
10879 : }
10880 : break;
10881 : }
10882 18 : case GT_EXPR:
10883 18 : {
10884 18 : tree _q70 = TREE_OPERAND (_p1, 0);
10885 18 : tree _q71 = TREE_OPERAND (_p1, 1);
10886 18 : if ((_q70 == _q40 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q40, 0) && types_match (_q70, _q40)))
10887 : {
10888 0 : switch (TREE_CODE (_q71))
10889 : {
10890 0 : case POINTER_PLUS_EXPR:
10891 0 : {
10892 0 : tree _q90 = TREE_OPERAND (_q71, 0);
10893 0 : tree _q91 = TREE_OPERAND (_q71, 1);
10894 0 : if ((_q90 == _q20 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q20, 0) && types_match (_q90, _q20)))
10895 : {
10896 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
10897 : {
10898 0 : {
10899 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q71 };
10900 0 : const enum tree_code cmp = LT_EXPR;
10901 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
10902 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
10903 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
10904 : )
10905 : {
10906 0 : {
10907 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
10908 0 : offset_int rhs = off * 2;
10909 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
10910 : )
10911 : {
10912 0 : {
10913 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
10914 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
10915 0 : if (cmp == LT_EXPR
10916 : )
10917 : {
10918 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail1782;
10919 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1782;
10920 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1782;
10921 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1782;
10922 0 : if (TREE_SIDE_EFFECTS (captures[6])) goto next_after_fail1782;
10923 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1782;
10924 0 : {
10925 0 : tree res_op0;
10926 0 : {
10927 0 : tree _o1[1], _r1;
10928 0 : {
10929 0 : tree _o2[2], _r2;
10930 0 : _o2[0] = swap_p ? captures[6] : captures[1];
10931 0 : _o2[1] = swap_p ? captures[2] : captures[4];
10932 0 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10933 0 : _o1[0] = _r2;
10934 : }
10935 0 : if (TREE_TYPE (_o1[0]) != sizetype)
10936 : {
10937 0 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10938 : }
10939 : else
10940 : _r1 = _o1[0];
10941 0 : res_op0 = _r1;
10942 : }
10943 0 : tree res_op1;
10944 0 : res_op1 = rhs_tree;
10945 0 : tree _r;
10946 0 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10947 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 956, __FILE__, __LINE__, true);
10948 0 : return _r;
10949 : }
10950 0 : next_after_fail1782:;
10951 : }
10952 : else
10953 : {
10954 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail1783;
10955 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail1783;
10956 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail1783;
10957 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1783;
10958 : {
10959 : tree res_op0;
10960 : {
10961 : tree _o1[1], _r1;
10962 : {
10963 : tree _o2[2], _r2;
10964 : {
10965 : tree _o3[2], _r3;
10966 : _o3[0] = swap_p ? captures[4] : captures[2];
10967 : _o3[1] = wide_int_to_tree (sizetype, off);
10968 : _r3 = fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
10969 : _o2[0] = _r3;
10970 : }
10971 : _o2[1] = swap_p ? captures[2] : captures[4];
10972 : _r2 = fold_build2_loc (loc, POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
10973 : _o1[0] = _r2;
10974 : }
10975 : if (TREE_TYPE (_o1[0]) != sizetype)
10976 : {
10977 : _r1 = fold_build1_loc (loc, NOP_EXPR, sizetype, _o1[0]);
10978 : }
10979 : else
10980 : _r1 = _o1[0];
10981 : res_op0 = _r1;
10982 : }
10983 : tree res_op1;
10984 : res_op1 = rhs_tree;
10985 : tree _r;
10986 : _r = fold_build2_loc (loc, GT_EXPR, type, res_op0, res_op1);
10987 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 957, __FILE__, __LINE__, true);
10988 : return _r;
10989 : }
10990 : next_after_fail1783:;
10991 : }
10992 : }
10993 : }
10994 : }
10995 : }
10996 : }
10997 : }
10998 : }
10999 : break;
11000 : }
11001 : default:;
11002 : }
11003 : }
11004 : break;
11005 : }
11006 : default:;
11007 : }
11008 : break;
11009 : }
11010 : default:;
11011 : }
11012 : break;
11013 : }
11014 : default:;
11015 : }
11016 : break;
11017 : }
11018 : default:;
11019 : }
11020 : return NULL_TREE;
11021 : }
11022 :
11023 : tree
11024 650117806 : generic_simplify (location_t loc, enum tree_code code, const tree type ATTRIBUTE_UNUSED, tree _p0, tree _p1)
11025 : {
11026 650117806 : switch (code)
11027 : {
11028 1049770 : case BIT_XOR_EXPR:
11029 1049770 : return generic_simplify_BIT_XOR_EXPR (loc, code, type, _p0, _p1);
11030 98658411 : case PLUS_EXPR:
11031 98658411 : return generic_simplify_PLUS_EXPR (loc, code, type, _p0, _p1);
11032 80385896 : case POINTER_PLUS_EXPR:
11033 80385896 : return generic_simplify_POINTER_PLUS_EXPR (loc, code, type, _p0, _p1);
11034 33298618 : case MINUS_EXPR:
11035 33298618 : return generic_simplify_MINUS_EXPR (loc, code, type, _p0, _p1);
11036 1924389 : case BIT_IOR_EXPR:
11037 1924389 : return generic_simplify_BIT_IOR_EXPR (loc, code, type, _p0, _p1);
11038 3222036 : case POINTER_DIFF_EXPR:
11039 3222036 : return generic_simplify_POINTER_DIFF_EXPR (loc, code, type, _p0, _p1);
11040 72163133 : case MULT_EXPR:
11041 72163133 : return generic_simplify_MULT_EXPR (loc, code, type, _p0, _p1);
11042 27606290 : case EQ_EXPR:
11043 27606290 : return generic_simplify_EQ_EXPR (loc, code, type, _p0, _p1);
11044 38766056 : case NE_EXPR:
11045 38766056 : return generic_simplify_NE_EXPR (loc, code, type, _p0, _p1);
11046 2159310 : case TRUNC_DIV_EXPR:
11047 2159310 : return generic_simplify_TRUNC_DIV_EXPR (loc, code, type, _p0, _p1);
11048 7006 : case CEIL_DIV_EXPR:
11049 7006 : return generic_simplify_CEIL_DIV_EXPR (loc, code, type, _p0, _p1);
11050 2011906 : case FLOOR_DIV_EXPR:
11051 2011906 : return generic_simplify_FLOOR_DIV_EXPR (loc, code, type, _p0, _p1);
11052 0 : case ROUND_DIV_EXPR:
11053 0 : return generic_simplify_ROUND_DIV_EXPR (loc, code, type, _p0, _p1);
11054 3544629 : case EXACT_DIV_EXPR:
11055 3544629 : return generic_simplify_EXACT_DIV_EXPR (loc, code, type, _p0, _p1);
11056 864759 : case FLOOR_MOD_EXPR:
11057 864759 : return generic_simplify_FLOOR_MOD_EXPR (loc, code, type, _p0, _p1);
11058 6403219 : case RDIV_EXPR:
11059 6403219 : return generic_simplify_RDIV_EXPR (loc, code, type, _p0, _p1);
11060 17689815 : case LT_EXPR:
11061 17689815 : return generic_simplify_LT_EXPR (loc, code, type, _p0, _p1);
11062 9354494 : case LE_EXPR:
11063 9354494 : return generic_simplify_LE_EXPR (loc, code, type, _p0, _p1);
11064 20902378 : case GT_EXPR:
11065 20902378 : return generic_simplify_GT_EXPR (loc, code, type, _p0, _p1);
11066 6785850 : case GE_EXPR:
11067 6785850 : return generic_simplify_GE_EXPR (loc, code, type, _p0, _p1);
11068 4140 : case CEIL_MOD_EXPR:
11069 4140 : return generic_simplify_CEIL_MOD_EXPR (loc, code, type, _p0, _p1);
11070 0 : case ROUND_MOD_EXPR:
11071 0 : return generic_simplify_ROUND_MOD_EXPR (loc, code, type, _p0, _p1);
11072 2102651 : case TRUNC_MOD_EXPR:
11073 2102651 : return generic_simplify_TRUNC_MOD_EXPR (loc, code, type, _p0, _p1);
11074 1279568 : case LSHIFT_EXPR:
11075 1279568 : return generic_simplify_LSHIFT_EXPR (loc, code, type, _p0, _p1);
11076 1022620 : case RSHIFT_EXPR:
11077 1022620 : return generic_simplify_RSHIFT_EXPR (loc, code, type, _p0, _p1);
11078 7153053 : case BIT_AND_EXPR:
11079 7153053 : return generic_simplify_BIT_AND_EXPR (loc, code, type, _p0, _p1);
11080 10736008 : case TRUTH_AND_EXPR:
11081 10736008 : return generic_simplify_TRUTH_AND_EXPR (loc, code, type, _p0, _p1);
11082 9419877 : case TRUTH_OR_EXPR:
11083 9419877 : return generic_simplify_TRUTH_OR_EXPR (loc, code, type, _p0, _p1);
11084 82923 : case MIN_EXPR:
11085 82923 : return generic_simplify_MIN_EXPR (loc, code, type, _p0, _p1);
11086 389408 : case MAX_EXPR:
11087 389408 : return generic_simplify_MAX_EXPR (loc, code, type, _p0, _p1);
11088 1946 : case LROTATE_EXPR:
11089 1946 : return generic_simplify_LROTATE_EXPR (loc, code, type, _p0, _p1);
11090 2797 : case RROTATE_EXPR:
11091 2797 : return generic_simplify_RROTATE_EXPR (loc, code, type, _p0, _p1);
11092 664452 : case COMPLEX_EXPR:
11093 664452 : return generic_simplify_COMPLEX_EXPR (loc, code, type, _p0, _p1);
11094 786765 : case UNORDERED_EXPR:
11095 786765 : return generic_simplify_UNORDERED_EXPR (loc, code, type, _p0, _p1);
11096 203332 : case ORDERED_EXPR:
11097 203332 : return generic_simplify_ORDERED_EXPR (loc, code, type, _p0, _p1);
11098 751166 : case UNLT_EXPR:
11099 751166 : return generic_simplify_UNLT_EXPR (loc, code, type, _p0, _p1);
11100 1635495 : case UNLE_EXPR:
11101 1635495 : return generic_simplify_UNLE_EXPR (loc, code, type, _p0, _p1);
11102 1554077 : case UNGT_EXPR:
11103 1554077 : return generic_simplify_UNGT_EXPR (loc, code, type, _p0, _p1);
11104 431181 : case UNGE_EXPR:
11105 431181 : return generic_simplify_UNGE_EXPR (loc, code, type, _p0, _p1);
11106 373827 : case UNEQ_EXPR:
11107 373827 : return generic_simplify_UNEQ_EXPR (loc, code, type, _p0, _p1);
11108 79 : case LTGT_EXPR:
11109 79 : return generic_simplify_LTGT_EXPR (loc, code, type, _p0, _p1);
11110 3479176 : case TRUTH_ORIF_EXPR:
11111 3479176 : return generic_simplify_TRUTH_ORIF_EXPR (loc, code, type, _p0, _p1);
11112 : default:;
11113 : }
11114 : return NULL_TREE;
11115 : }
11116 :
11117 : tree
11118 16035 : generic_simplify_BIT_INSERT_EXPR (location_t ARG_UNUSED (loc), enum tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type), tree _p0, tree _p1, tree _p2)
11119 : {
11120 16035 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
11121 16035 : switch (TREE_CODE (_p1))
11122 : {
11123 0 : case BIT_FIELD_REF:
11124 0 : {
11125 0 : tree _q30 = TREE_OPERAND (_p1, 0);
11126 0 : tree _q31 = TREE_OPERAND (_p1, 1);
11127 0 : tree _q32 = TREE_OPERAND (_p1, 2);
11128 0 : {
11129 0 : tree captures[6] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32, _p2 };
11130 0 : if (VECTOR_TYPE_P (type)
11131 0 : && (VECTOR_MODE_P (TYPE_MODE (type))
11132 : || optimize_vectors_before_lowering_p ())
11133 0 : && operand_equal_p (TYPE_SIZE (TREE_TYPE (captures[0])),
11134 0 : TYPE_SIZE (TREE_TYPE (captures[2])), 0)
11135 0 : && types_match (TREE_TYPE (TREE_TYPE (captures[0])), TREE_TYPE (captures[1]))
11136 0 : && TYPE_VECTOR_SUBPARTS (type).is_constant ()
11137 0 : && multiple_p (wi::to_poly_offset (captures[4]),
11138 0 : wi::to_poly_offset (TYPE_SIZE (TREE_TYPE (type))))
11139 : )
11140 : {
11141 0 : {
11142 0 : unsigned HOST_WIDE_INT elsz
11143 0 : = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (TREE_TYPE (captures[0]))));
11144 0 : poly_uint64 relt = exact_div (tree_to_poly_uint64 (captures[4]), elsz);
11145 0 : poly_uint64 ielt = exact_div (tree_to_poly_uint64 (captures[5]), elsz);
11146 0 : unsigned nunits = TYPE_VECTOR_SUBPARTS (type).to_constant ();
11147 0 : vec_perm_builder builder;
11148 0 : builder.new_vector (nunits, nunits, 1);
11149 0 : for (unsigned i = 0; i < nunits; ++i)
11150 0 : builder.quick_push (known_eq (ielt, i) ? nunits + relt : i);
11151 0 : vec_perm_indices sel (builder, 2, nunits);
11152 0 : if (!VECTOR_MODE_P (TYPE_MODE (type))
11153 0 : || can_vec_perm_const_p (TYPE_MODE (type),
11154 0 : TYPE_MODE (type), sel, false)
11155 : )
11156 : {
11157 0 : if (TREE_SIDE_EFFECTS (captures[4])) goto next_after_fail2020;
11158 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail2020;
11159 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2020;
11160 0 : {
11161 0 : tree res_op0;
11162 0 : res_op0 = captures[0];
11163 0 : tree res_op1;
11164 0 : {
11165 0 : tree _o1[1], _r1;
11166 0 : _o1[0] = captures[2];
11167 0 : if (TREE_TYPE (_o1[0]) != type)
11168 : {
11169 0 : _r1 = fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, _o1[0]);
11170 : }
11171 : else
11172 : _r1 = _o1[0];
11173 0 : res_op1 = _r1;
11174 : }
11175 0 : tree res_op2;
11176 0 : res_op2 = vec_perm_indices_to_tree (build_vector_type (ssizetype, nunits),
11177 : sel);
11178 0 : tree _r;
11179 0 : _r = fold_build3_loc (loc, VEC_PERM_EXPR, type, res_op0, res_op1, res_op2);
11180 0 : if (TREE_SIDE_EFFECTS (captures[3]))
11181 0 : _r = build2_loc (loc, COMPOUND_EXPR, type, fold_ignored_result (captures[3]), _r);
11182 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1112, __FILE__, __LINE__, true);
11183 0 : return _r;
11184 : }
11185 0 : next_after_fail2020:;
11186 : }
11187 0 : }
11188 : }
11189 : }
11190 0 : break;
11191 : }
11192 16035 : default:;
11193 : }
11194 16035 : switch (TREE_CODE (_p0))
11195 : {
11196 0 : case VEC_PERM_EXPR:
11197 0 : {
11198 0 : tree _q20 = TREE_OPERAND (_p0, 0);
11199 0 : tree _q21 = TREE_OPERAND (_p0, 1);
11200 0 : tree _q22 = TREE_OPERAND (_p0, 2);
11201 0 : switch (TREE_CODE (_q22))
11202 : {
11203 0 : case VECTOR_CST:
11204 0 : {
11205 0 : switch (TREE_CODE (_p2))
11206 : {
11207 0 : case INTEGER_CST:
11208 0 : {
11209 0 : {
11210 0 : tree captures[6] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _p2 };
11211 0 : {
11212 0 : bool from0 = false;
11213 0 : bool from1 = false;
11214 0 : tree single_op = NULL_TREE;
11215 0 : unsigned elt_size = vector_element_bits (type);
11216 0 : unsigned HOST_WIDE_INT nelts;
11217 0 : unsigned ins_lane_idx;
11218 0 : vec_perm_indices sel;
11219 0 : if (TYPE_VECTOR_SUBPARTS (type).is_constant (&nelts)
11220 0 : && captures[1] != captures[2]
11221 0 : && tree_to_vec_perm_indices (&sel, captures[1], captures[2], captures[3])
11222 0 : && tree_to_uhwi (TYPE_SIZE (TREE_TYPE (captures[4]))) == elt_size
11223 0 : && multiple_p (tree_to_uhwi (captures[5]), elt_size, &ins_lane_idx))
11224 : {
11225 0 : for (unsigned i = 0; i < nelts; i++)
11226 : {
11227 0 : if (i == ins_lane_idx)
11228 0 : continue;
11229 0 : unsigned HOST_WIDE_INT elt = sel[i].to_constant ();
11230 0 : if (elt < nelts)
11231 : from0 = true;
11232 : else
11233 0 : from1 = true;
11234 : }
11235 0 : if (from0 ^ from1)
11236 : {
11237 0 : single_op = from0 ? captures[1] : captures[2];
11238 0 : vec_perm_indices new_sel;
11239 0 : if (!tree_to_vec_perm_indices (&new_sel, single_op, single_op, captures[3])
11240 0 : || !can_vec_perm_const_p (TYPE_MODE (type),
11241 0 : TYPE_MODE (TREE_TYPE (single_op)),
11242 : new_sel,
11243 : false))
11244 : single_op = NULL_TREE;
11245 0 : }
11246 : }
11247 0 : if (single_op != NULL_TREE
11248 : )
11249 : {
11250 0 : if (TREE_SIDE_EFFECTS (captures[1])) goto next_after_fail2021;
11251 0 : if (TREE_SIDE_EFFECTS (captures[2])) goto next_after_fail2021;
11252 0 : if (TREE_SIDE_EFFECTS (captures[3])) goto next_after_fail2021;
11253 0 : if (TREE_SIDE_EFFECTS (captures[5])) goto next_after_fail2021;
11254 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2021;
11255 0 : {
11256 0 : tree res_op0;
11257 0 : {
11258 0 : tree _o1[3], _r1;
11259 0 : _o1[0] = single_op;
11260 0 : _o1[1] = single_op;
11261 0 : _o1[2] = captures[3];
11262 0 : _r1 = fold_build3_loc (loc, VEC_PERM_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1], _o1[2]);
11263 0 : res_op0 = _r1;
11264 : }
11265 0 : tree res_op1;
11266 0 : res_op1 = captures[4];
11267 0 : tree res_op2;
11268 0 : res_op2 = captures[5];
11269 0 : tree _r;
11270 0 : _r = fold_build3_loc (loc, BIT_INSERT_EXPR, type, res_op0, res_op1, res_op2);
11271 0 : if (UNLIKELY (debug_dump)) generic_dump_logs ("match.pd", 1113, __FILE__, __LINE__, true);
11272 0 : return _r;
11273 : }
11274 0 : next_after_fail2021:;
11275 : }
11276 0 : }
11277 : }
11278 0 : break;
11279 : }
11280 : default:;
11281 : }
11282 : break;
11283 : }
11284 : default:;
11285 : }
11286 : break;
11287 : }
11288 : default:;
11289 : }
11290 : return NULL_TREE;
11291 : }
11292 : #pragma GCC diagnostic pop
|