Mercurial > hg > CbC > CbC_gcc
comparison gcc/lto-streamer-in.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Read the GIMPLE representation from a file stream. | 1 /* Read the GIMPLE representation from a file stream. |
2 | 2 |
3 Copyright (C) 2009-2017 Free Software Foundation, Inc. | 3 Copyright (C) 2009-2018 Free Software Foundation, Inc. |
4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> | 4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> |
5 Re-implemented by Diego Novillo <dnovillo@google.com> | 5 Re-implemented by Diego Novillo <dnovillo@google.com> |
6 | 6 |
7 This file is part of GCC. | 7 This file is part of GCC. |
8 | 8 |
823 if (loop->any_estimate) | 823 if (loop->any_estimate) |
824 loop->nb_iterations_estimate = streamer_read_widest_int (ib); | 824 loop->nb_iterations_estimate = streamer_read_widest_int (ib); |
825 | 825 |
826 /* Read OMP SIMD related info. */ | 826 /* Read OMP SIMD related info. */ |
827 loop->safelen = streamer_read_hwi (ib); | 827 loop->safelen = streamer_read_hwi (ib); |
828 loop->unroll = streamer_read_hwi (ib); | |
828 loop->dont_vectorize = streamer_read_hwi (ib); | 829 loop->dont_vectorize = streamer_read_hwi (ib); |
829 loop->force_vectorize = streamer_read_hwi (ib); | 830 loop->force_vectorize = streamer_read_hwi (ib); |
830 loop->simduid = stream_read_tree (ib, data_in); | 831 loop->simduid = stream_read_tree (ib, data_in); |
831 | 832 |
832 place_new_loop (fn, loop); | 833 place_new_loop (fn, loop); |
1010 fn->last_clique = bp_unpack_value (&bp, sizeof (short) * 8); | 1011 fn->last_clique = bp_unpack_value (&bp, sizeof (short) * 8); |
1011 | 1012 |
1012 /* Input the function start and end loci. */ | 1013 /* Input the function start and end loci. */ |
1013 fn->function_start_locus = stream_input_location_now (&bp, data_in); | 1014 fn->function_start_locus = stream_input_location_now (&bp, data_in); |
1014 fn->function_end_locus = stream_input_location_now (&bp, data_in); | 1015 fn->function_end_locus = stream_input_location_now (&bp, data_in); |
1016 | |
1017 /* Restore the instance discriminators if present. */ | |
1018 int instance_number = bp_unpack_value (&bp, 1); | |
1019 if (instance_number) | |
1020 { | |
1021 instance_number = bp_unpack_value (&bp, sizeof (int) * CHAR_BIT); | |
1022 maybe_create_decl_to_instance_map ()->put (fn->decl, instance_number); | |
1023 } | |
1015 } | 1024 } |
1016 | 1025 |
1017 | 1026 |
1018 /* Read the body of function FN_DECL from DATA_IN using input block IB. */ | 1027 /* Read the body of function FN_DECL from DATA_IN using input block IB. */ |
1019 | 1028 |
1123 mismatches in fixups, but we can do it at this point, as | 1132 mismatches in fixups, but we can do it at this point, as |
1124 long as debug stmts don't require fixups. | 1133 long as debug stmts don't require fixups. |
1125 Similarly remove all IFN_*SAN_* internal calls */ | 1134 Similarly remove all IFN_*SAN_* internal calls */ |
1126 if (!flag_wpa) | 1135 if (!flag_wpa) |
1127 { | 1136 { |
1128 if (!MAY_HAVE_DEBUG_STMTS && is_gimple_debug (stmt)) | 1137 if (is_gimple_debug (stmt) |
1138 && (gimple_debug_nonbind_marker_p (stmt) | |
1139 ? !MAY_HAVE_DEBUG_MARKER_STMTS | |
1140 : !MAY_HAVE_DEBUG_BIND_STMTS)) | |
1129 remove = true; | 1141 remove = true; |
1130 if (is_gimple_call (stmt) | 1142 if (is_gimple_call (stmt) |
1131 && gimple_call_internal_p (stmt)) | 1143 && gimple_call_internal_p (stmt)) |
1132 { | 1144 { |
1145 bool replace = false; | |
1133 switch (gimple_call_internal_fn (stmt)) | 1146 switch (gimple_call_internal_fn (stmt)) |
1134 { | 1147 { |
1135 case IFN_UBSAN_NULL: | 1148 case IFN_UBSAN_NULL: |
1136 if ((flag_sanitize | 1149 if ((flag_sanitize |
1137 & (SANITIZE_NULL | SANITIZE_ALIGNMENT)) == 0) | 1150 & (SANITIZE_NULL | SANITIZE_ALIGNMENT)) == 0) |
1138 remove = true; | 1151 replace = true; |
1139 break; | 1152 break; |
1140 case IFN_UBSAN_BOUNDS: | 1153 case IFN_UBSAN_BOUNDS: |
1141 if ((flag_sanitize & SANITIZE_BOUNDS) == 0) | 1154 if ((flag_sanitize & SANITIZE_BOUNDS) == 0) |
1142 remove = true; | 1155 replace = true; |
1143 break; | 1156 break; |
1144 case IFN_UBSAN_VPTR: | 1157 case IFN_UBSAN_VPTR: |
1145 if ((flag_sanitize & SANITIZE_VPTR) == 0) | 1158 if ((flag_sanitize & SANITIZE_VPTR) == 0) |
1146 remove = true; | 1159 replace = true; |
1147 break; | 1160 break; |
1148 case IFN_UBSAN_OBJECT_SIZE: | 1161 case IFN_UBSAN_OBJECT_SIZE: |
1149 if ((flag_sanitize & SANITIZE_OBJECT_SIZE) == 0) | 1162 if ((flag_sanitize & SANITIZE_OBJECT_SIZE) == 0) |
1150 remove = true; | 1163 replace = true; |
1151 break; | 1164 break; |
1152 case IFN_UBSAN_PTR: | 1165 case IFN_UBSAN_PTR: |
1153 if ((flag_sanitize & SANITIZE_POINTER_OVERFLOW) == 0) | 1166 if ((flag_sanitize & SANITIZE_POINTER_OVERFLOW) == 0) |
1154 remove = true; | 1167 replace = true; |
1155 break; | 1168 break; |
1156 case IFN_ASAN_MARK: | 1169 case IFN_ASAN_MARK: |
1157 if ((flag_sanitize & SANITIZE_ADDRESS) == 0) | 1170 if ((flag_sanitize & SANITIZE_ADDRESS) == 0) |
1158 remove = true; | 1171 replace = true; |
1159 break; | 1172 break; |
1160 case IFN_TSAN_FUNC_EXIT: | 1173 case IFN_TSAN_FUNC_EXIT: |
1161 if ((flag_sanitize & SANITIZE_THREAD) == 0) | 1174 if ((flag_sanitize & SANITIZE_THREAD) == 0) |
1162 remove = true; | 1175 replace = true; |
1163 break; | 1176 break; |
1164 default: | 1177 default: |
1165 break; | 1178 break; |
1166 } | 1179 } |
1167 gcc_assert (!remove || gimple_call_lhs (stmt) == NULL_TREE); | 1180 if (replace) |
1181 { | |
1182 gimple_call_set_internal_fn (as_a <gcall *> (stmt), | |
1183 IFN_NOP); | |
1184 update_stmt (stmt); | |
1185 } | |
1168 } | 1186 } |
1169 } | 1187 } |
1170 if (remove) | 1188 if (remove) |
1171 { | 1189 { |
1172 gimple_stmt_iterator gsi = bsi; | 1190 gimple_stmt_iterator gsi = bsi; |
1177 } | 1195 } |
1178 else | 1196 else |
1179 { | 1197 { |
1180 gsi_next (&bsi); | 1198 gsi_next (&bsi); |
1181 stmts[gimple_uid (stmt)] = stmt; | 1199 stmts[gimple_uid (stmt)] = stmt; |
1200 | |
1201 /* Remember that the input function has begin stmt | |
1202 markers, so that we know to expect them when emitting | |
1203 debug info. */ | |
1204 if (!cfun->debug_nonbind_markers | |
1205 && gimple_debug_nonbind_marker_p (stmt)) | |
1206 cfun->debug_nonbind_markers = true; | |
1182 } | 1207 } |
1183 } | 1208 } |
1184 } | 1209 } |
1185 | 1210 |
1186 /* Set the gimple body to the statement sequence in the entry | 1211 /* Set the gimple body to the statement sequence in the entry |
1190 { | 1215 { |
1191 edge_iterator ei = ei_start (ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs); | 1216 edge_iterator ei = ei_start (ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs); |
1192 gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest)); | 1217 gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest)); |
1193 } | 1218 } |
1194 | 1219 |
1220 update_max_bb_count (); | |
1195 fixup_call_stmt_edges (node, stmts); | 1221 fixup_call_stmt_edges (node, stmts); |
1196 execute_all_ipa_stmt_fixups (node, stmts); | 1222 execute_all_ipa_stmt_fixups (node, stmts); |
1197 | 1223 |
1198 update_ssa (TODO_update_ssa_only_virtuals); | 1224 update_ssa (TODO_update_ssa_only_virtuals); |
1199 free_dominance_info (CDI_DOMINATORS); | 1225 free_dominance_info (CDI_DOMINATORS); |
1597 unsigned int m; | 1623 unsigned int m; |
1598 while ((m = bp_unpack_value (&bp, 8)) != VOIDmode) | 1624 while ((m = bp_unpack_value (&bp, 8)) != VOIDmode) |
1599 { | 1625 { |
1600 enum mode_class mclass | 1626 enum mode_class mclass |
1601 = bp_unpack_enum (&bp, mode_class, MAX_MODE_CLASS); | 1627 = bp_unpack_enum (&bp, mode_class, MAX_MODE_CLASS); |
1602 unsigned int size = bp_unpack_value (&bp, 8); | 1628 poly_uint16 size = bp_unpack_poly_value (&bp, 16); |
1603 unsigned int prec = bp_unpack_value (&bp, 16); | 1629 poly_uint16 prec = bp_unpack_poly_value (&bp, 16); |
1604 machine_mode inner = (machine_mode) bp_unpack_value (&bp, 8); | 1630 machine_mode inner = (machine_mode) bp_unpack_value (&bp, 8); |
1605 unsigned int nunits = bp_unpack_value (&bp, 8); | 1631 poly_uint16 nunits = bp_unpack_poly_value (&bp, 16); |
1606 unsigned int ibit = 0, fbit = 0; | 1632 unsigned int ibit = 0, fbit = 0; |
1607 unsigned int real_fmt_len = 0; | 1633 unsigned int real_fmt_len = 0; |
1608 const char *real_fmt_name = NULL; | 1634 const char *real_fmt_name = NULL; |
1609 switch (mclass) | 1635 switch (mclass) |
1610 { | 1636 { |
1631 : GET_CLASS_NARROWEST_MODE (mclass); | 1657 : GET_CLASS_NARROWEST_MODE (mclass); |
1632 pass ? mr < MAX_MACHINE_MODE : mr != VOIDmode; | 1658 pass ? mr < MAX_MACHINE_MODE : mr != VOIDmode; |
1633 pass ? mr = (machine_mode) (mr + 1) | 1659 pass ? mr = (machine_mode) (mr + 1) |
1634 : mr = GET_MODE_WIDER_MODE (mr).else_void ()) | 1660 : mr = GET_MODE_WIDER_MODE (mr).else_void ()) |
1635 if (GET_MODE_CLASS (mr) != mclass | 1661 if (GET_MODE_CLASS (mr) != mclass |
1636 || GET_MODE_SIZE (mr) != size | 1662 || maybe_ne (GET_MODE_SIZE (mr), size) |
1637 || GET_MODE_PRECISION (mr) != prec | 1663 || maybe_ne (GET_MODE_PRECISION (mr), prec) |
1638 || (inner == m | 1664 || (inner == m |
1639 ? GET_MODE_INNER (mr) != mr | 1665 ? GET_MODE_INNER (mr) != mr |
1640 : GET_MODE_INNER (mr) != table[(int) inner]) | 1666 : GET_MODE_INNER (mr) != table[(int) inner]) |
1641 || GET_MODE_IBIT (mr) != ibit | 1667 || GET_MODE_IBIT (mr) != ibit |
1642 || GET_MODE_FBIT (mr) != fbit | 1668 || GET_MODE_FBIT (mr) != fbit |
1643 || GET_MODE_NUNITS (mr) != nunits) | 1669 || maybe_ne (GET_MODE_NUNITS (mr), nunits)) |
1644 continue; | 1670 continue; |
1645 else if ((mclass == MODE_FLOAT || mclass == MODE_DECIMAL_FLOAT) | 1671 else if ((mclass == MODE_FLOAT || mclass == MODE_DECIMAL_FLOAT) |
1646 && strcmp (REAL_MODE_FORMAT (mr)->name, real_fmt_name) != 0) | 1672 && strcmp (REAL_MODE_FORMAT (mr)->name, real_fmt_name) != 0) |
1647 continue; | 1673 continue; |
1648 else | 1674 else |
1655 const char *mname = bp_unpack_indexed_string (data_in, &bp, &mname_len); | 1681 const char *mname = bp_unpack_indexed_string (data_in, &bp, &mname_len); |
1656 if (pass == 2) | 1682 if (pass == 2) |
1657 { | 1683 { |
1658 switch (mclass) | 1684 switch (mclass) |
1659 { | 1685 { |
1686 case MODE_VECTOR_BOOL: | |
1660 case MODE_VECTOR_INT: | 1687 case MODE_VECTOR_INT: |
1661 case MODE_VECTOR_FLOAT: | 1688 case MODE_VECTOR_FLOAT: |
1662 case MODE_VECTOR_FRACT: | 1689 case MODE_VECTOR_FRACT: |
1663 case MODE_VECTOR_UFRACT: | 1690 case MODE_VECTOR_UFRACT: |
1664 case MODE_VECTOR_ACCUM: | 1691 case MODE_VECTOR_ACCUM: |