public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/arm-struct-reorg-wip)] Abort if unknown syntax is encountered
@ 2020-08-30 8:25 Erick Ochoa Lopez
0 siblings, 0 replies; only message in thread
From: Erick Ochoa Lopez @ 2020-08-30 8:25 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:9048cc889bcfa93f91b7f417dd040be5162229dd
commit 9048cc889bcfa93f91b7f417dd040be5162229dd
Author: Erick Ochoa <erick.ochoa@theobroma-systems.com>
Date: Sun Aug 30 10:21:35 2020 +0200
Abort if unknown syntax is encountered
Diff:
---
gcc/ipa-field-reorder.c | 3 ++-
gcc/ipa-type-escape-analysis.c | 27 +++++++++++++++++++++++++--
gcc/ipa-type-escape-analysis.h | 2 ++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/gcc/ipa-field-reorder.c b/gcc/ipa-field-reorder.c
index f67928f012f..2f4b7942966 100644
--- a/gcc/ipa-field-reorder.c
+++ b/gcc/ipa-field-reorder.c
@@ -587,6 +587,7 @@ lto_fr_execute ()
{
log ("here in field reordering \n");
// 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 ();
@@ -594,7 +595,7 @@ lto_fr_execute ()
= obtain_nonescaping_unaccessed_fields (escaping_nonescaping_sets,
record_field_map, 0);
- if (record_field_offset_map.empty ())
+ if (detected_incompatible_syntax || record_field_offset_map.empty ())
return 0;
// Prepare for transformation.
diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c
index d5f03794fdd..a23d1810929 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);
}
+
diff --git a/gcc/ipa-type-escape-analysis.h b/gcc/ipa-type-escape-analysis.h
index 5faa723a6a6..8b9911ace1e 100644
--- a/gcc/ipa-type-escape-analysis.h
+++ b/gcc/ipa-type-escape-analysis.h
@@ -1165,4 +1165,6 @@ obtain_nonescaping_unaccessed_fields (tpartitions_t casting,
record_field_map_t record_field_map,
int warning);
+extern bool detected_incompatible_syntax;
+
#endif /* GCC_IPA_TYPE_ESCAPE_ANALYSIS_H */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-30 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-30 8:25 [gcc(refs/vendors/ARM/heads/arm-struct-reorg-wip)] Abort if unknown syntax is encountered Erick Ochoa Lopez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).