comparison gcc/tree-ssa-scopedtables.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* Header file for SSA dominator optimizations. 1 /* Header file for SSA dominator optimizations.
2 Copyright (C) 2013-2017 Free Software Foundation, Inc. 2 Copyright (C) 2013-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
180 case MAX_EXPR: 180 case MAX_EXPR:
181 case BIT_IOR_EXPR: 181 case BIT_IOR_EXPR:
182 case BIT_AND_EXPR: 182 case BIT_AND_EXPR:
183 return gimple_assign_rhs1 (stmt); 183 return gimple_assign_rhs1 (stmt);
184 184
185 case MINUS_EXPR:
186 /* This is unsafe for certain floats even in non-IEEE
187 formats. In IEEE, it is unsafe because it does
188 wrong for NaNs. */
189 if (FLOAT_TYPE_P (result_type)
190 && HONOR_NANS (result_type))
191 break;
192 /* FALLTHRU */
185 case BIT_XOR_EXPR: 193 case BIT_XOR_EXPR:
186 case MINUS_EXPR:
187 case TRUNC_MOD_EXPR: 194 case TRUNC_MOD_EXPR:
188 case CEIL_MOD_EXPR: 195 case CEIL_MOD_EXPR:
189 case FLOOR_MOD_EXPR: 196 case FLOOR_MOD_EXPR:
190 case ROUND_MOD_EXPR: 197 case ROUND_MOD_EXPR:
191 return build_zero_cst (result_type); 198 return build_zero_cst (result_type);
193 case TRUNC_DIV_EXPR: 200 case TRUNC_DIV_EXPR:
194 case CEIL_DIV_EXPR: 201 case CEIL_DIV_EXPR:
195 case FLOOR_DIV_EXPR: 202 case FLOOR_DIV_EXPR:
196 case ROUND_DIV_EXPR: 203 case ROUND_DIV_EXPR:
197 case EXACT_DIV_EXPR: 204 case EXACT_DIV_EXPR:
205 /* Avoid _Fract types where we can't build 1. */
206 if (ALL_FRACT_MODE_P (TYPE_MODE (result_type)))
207 break;
198 return build_one_cst (result_type); 208 return build_one_cst (result_type);
199 209
200 default: 210 default:
201 gcc_unreachable (); 211 gcc_unreachable ();
202 } 212 }
203 } 213 }
204 break; 214 break;
205 } 215 }
206 216
207 default: 217 default:
208 break; 218 break;
209 } 219 }
210 } 220 }
211 } 221 }
212 return NULL_TREE; 222 return NULL_TREE;
213 } 223 }
478 { 488 {
479 /* Make equivalent statements of both these kinds hash together. 489 /* Make equivalent statements of both these kinds hash together.
480 Dealing with both MEM_REF and ARRAY_REF allows us not to care 490 Dealing with both MEM_REF and ARRAY_REF allows us not to care
481 about equivalence with other statements not considered here. */ 491 about equivalence with other statements not considered here. */
482 bool reverse; 492 bool reverse;
483 HOST_WIDE_INT offset, size, max_size; 493 poly_int64 offset, size, max_size;
484 tree base = get_ref_base_and_extent (t, &offset, &size, &max_size, 494 tree base = get_ref_base_and_extent (t, &offset, &size, &max_size,
485 &reverse); 495 &reverse);
486 /* Strictly, we could try to normalize variable-sized accesses too, 496 /* Strictly, we could try to normalize variable-sized accesses too,
487 but here we just deal with the common case. */ 497 but here we just deal with the common case. */
488 if (size != -1 498 if (known_size_p (max_size)
489 && size == max_size) 499 && known_eq (size, max_size))
490 { 500 {
491 enum tree_code code = MEM_REF; 501 enum tree_code code = MEM_REF;
492 hstate.add_object (code); 502 hstate.add_object (code);
493 inchash::add_expr (base, hstate); 503 inchash::add_expr (base, hstate);
494 hstate.add_object (offset); 504 hstate.add_object (offset);
518 return false; 528 return false;
519 529
520 if (!types_compatible_p (TREE_TYPE (t0), TREE_TYPE (t1))) 530 if (!types_compatible_p (TREE_TYPE (t0), TREE_TYPE (t1)))
521 return false; 531 return false;
522 bool rev0; 532 bool rev0;
523 HOST_WIDE_INT off0, sz0, max0; 533 poly_int64 off0, sz0, max0;
524 tree base0 = get_ref_base_and_extent (t0, &off0, &sz0, &max0, &rev0); 534 tree base0 = get_ref_base_and_extent (t0, &off0, &sz0, &max0, &rev0);
525 if (sz0 == -1 535 if (!known_size_p (max0)
526 || sz0 != max0) 536 || maybe_ne (sz0, max0))
527 return false; 537 return false;
528 538
529 bool rev1; 539 bool rev1;
530 HOST_WIDE_INT off1, sz1, max1; 540 poly_int64 off1, sz1, max1;
531 tree base1 = get_ref_base_and_extent (t1, &off1, &sz1, &max1, &rev1); 541 tree base1 = get_ref_base_and_extent (t1, &off1, &sz1, &max1, &rev1);
532 if (sz1 == -1 542 if (!known_size_p (max1)
533 || sz1 != max1) 543 || maybe_ne (sz1, max1))
534 return false; 544 return false;
535 545
536 if (rev0 != rev1) 546 if (rev0 != rev1)
537 return false; 547 return false;
538 548
539 /* Types were compatible, so this is a sanity check. */ 549 /* Types were compatible, so this is a sanity check. */
540 gcc_assert (sz0 == sz1); 550 gcc_assert (known_eq (sz0, sz1));
541 551
542 return (off0 == off1) && operand_equal_p (base0, base1, 0); 552 return known_eq (off0, off1) && operand_equal_p (base0, base1, 0);
543 } 553 }
544 554
545 /* Compare two hashable_expr structures for equivalence. They are 555 /* Compare two hashable_expr structures for equivalence. They are
546 considered equivalent when the expressions they denote must 556 considered equivalent when the expressions they denote must
547 necessarily be equal. The logic is intended to follow that of 557 necessarily be equal. The logic is intended to follow that of
654 for (i = 0; i < expr0->ops.call.nargs; i++) 664 for (i = 0; i < expr0->ops.call.nargs; i++)
655 if (! operand_equal_p (expr0->ops.call.args[i], 665 if (! operand_equal_p (expr0->ops.call.args[i],
656 expr1->ops.call.args[i], 0)) 666 expr1->ops.call.args[i], 0))
657 return false; 667 return false;
658 668
659 if (stmt_could_throw_p (expr0->ops.call.fn_from)) 669 if (stmt_could_throw_p (cfun, expr0->ops.call.fn_from))
660 { 670 {
661 int lp0 = lookup_stmt_eh_lp (expr0->ops.call.fn_from); 671 int lp0 = lookup_stmt_eh_lp (expr0->ops.call.fn_from);
662 int lp1 = lookup_stmt_eh_lp (expr1->ops.call.fn_from); 672 int lp1 = lookup_stmt_eh_lp (expr1->ops.call.fn_from);
663 if ((lp0 > 0 || lp1 > 0) && lp0 != lp1) 673 if ((lp0 > 0 || lp1 > 0) && lp0 != lp1)
664 return false; 674 return false;
894 size_t nargs = m_expr.ops.call.nargs; 904 size_t nargs = m_expr.ops.call.nargs;
895 gcall *fn_from; 905 gcall *fn_from;
896 906
897 fn_from = m_expr.ops.call.fn_from; 907 fn_from = m_expr.ops.call.fn_from;
898 if (gimple_call_internal_p (fn_from)) 908 if (gimple_call_internal_p (fn_from))
899 fputs (internal_fn_name (gimple_call_internal_fn (fn_from)), 909 fprintf (stream, ".%s",
900 stream); 910 internal_fn_name (gimple_call_internal_fn (fn_from)));
901 else 911 else
902 print_generic_expr (stream, gimple_call_fn (fn_from)); 912 print_generic_expr (stream, gimple_call_fn (fn_from));
903 fprintf (stream, " ("); 913 fprintf (stream, " (");
904 for (i = 0; i < nargs; i++) 914 for (i = 0; i < nargs; i++)
905 { 915 {