summaryrefslogtreecommitdiff
path: root/gcc/gimple-escaper.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-escaper.c')
-rw-r--r--gcc/gimple-escaper.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/gimple-escaper.c b/gcc/gimple-escaper.c
index 3f80d6cd868..fef93bffdbb 100644
--- a/gcc/gimple-escaper.c
+++ b/gcc/gimple-escaper.c
@@ -99,6 +99,7 @@ GimpleEscaper::filter_known_function(cgraph_node *node)
const char *_realloc = "realloc";
const char *_calloc = "calloc";
const char *_memset = "memset";
+ const char *_specqsort= "spec_qsort";
const char *name = node->name();
gcc_assert(name);
filter |= strcmp(_free, name) == 0;
@@ -106,6 +107,7 @@ GimpleEscaper::filter_known_function(cgraph_node *node)
filter |= strcmp(_realloc, name) == 0;
filter |= strcmp(_memset, name) == 0;
filter |= strcmp(_calloc, name) == 0;
+ filter |= strcmp(_specqsort, name) == 0;
return filter;
}
@@ -176,9 +178,18 @@ void
GimpleEscaper::_walk_pre(gcall *s)
{
const_tree fn = gimple_call_fndecl(s);
- cgraph_node *node = cgraph_node::get(fn);
- const bool _is_function_escaping = is_function_escaping(node);
- const bool is_undefined = undefined.find(fn) != undefined.end();
+ // gcc_assert(fn);
+ // The above will not always be true
+ if (!fn)
+ {
+ log("TODO: we have a gimple_call_fndecl(s) == NULL in GimpleEscaper\n");
+ }
+ cgraph_node *node = fn ? cgraph_node::get(fn) : NULL;
+ // TODO:
+ // This is not safe... But we need to have false.
+ // Which functions do not have a declaration?
+ const bool _is_function_escaping = node ? is_function_escaping(node) : false;
+ const bool is_undefined = node ? undefined.find(fn) != undefined.end() : false;
const bool _is_escaping = is_undefined || _is_function_escaping;
Reason function_type_reason;
function_type_reason.is_escaping = _is_escaping;