diff options
Diffstat (limited to 'gcc/ipa-type-escape-analysis.c')
-rw-r--r-- | gcc/ipa-type-escape-analysis.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index d5f03794fdd6..a23d1810929e 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -170,6 +170,10 @@ along with GCC; see the file COPYING3. If not see #include "ipa-type-escape-analysis.h" #include "ipa-dfe.h" +#define ABORT_IF_NOT_C true + +bool detected_incompatible_syntax = false; + // Main function that drives dfe. static unsigned int lto_dfe_execute (); @@ -256,13 +260,14 @@ static void lto_dead_field_elimination () { // Analysis. + detected_incompatible_syntax = false; tpartitions_t escaping_nonescaping_sets = partition_types_into_escaping_nonescaping (); record_field_map_t record_field_map = find_fields_accessed (); record_field_offset_map_t record_field_offset_map = obtain_nonescaping_unaccessed_fields (escaping_nonescaping_sets, record_field_map, OPT_Wdfa); - if (record_field_offset_map.empty ()) + if (detected_incompatible_syntax || record_field_offset_map.empty ()) return; // Prepare for transformation. @@ -669,7 +674,11 @@ TypeWalker::_walk (const_tree type) default: { log ("missing %s\n", get_tree_code_name (code)); +#ifdef ABORT_IF_NOT_C + detected_incompatible_syntax = true; +#else gcc_unreachable (); +#endif } break; } @@ -936,7 +945,11 @@ ExprWalker::_walk (const_tree e) default: { log ("missing %s\n", get_tree_code_name (code)); +#ifdef ABORT_IF_NOT_C + detected_incompatible_syntax = true; +#else gcc_unreachable (); +#endif } break; } @@ -1415,7 +1428,11 @@ GimpleWalker::_walk_gimple (gimple *stmt) // Break if something is unexpected. const char *name = gimple_code_name[code]; log ("gimple code name %s\n", name); +#ifdef ABORT_IF_NOT_C + detected_incompatible_syntax = true; +#else gcc_unreachable (); +#endif } void @@ -3216,7 +3233,12 @@ TypeStructuralEquality::_equal (const_tree l, const_tree r) TSE_CASE (FUNCTION_TYPE); TSE_CASE (METHOD_TYPE); default: - gcc_unreachable (); +#ifdef ABORT_IF_NOT_C + detected_incompatible_syntax = true; + return false; +#else + gcc_unreachable (); +#endif break; } @@ -3415,3 +3437,4 @@ make_pass_ipa_type_escape_analysis (gcc::context *ctx) { return new pass_ipa_type_escape_analysis (ctx); } + |