summaryrefslogtreecommitdiff
path: root/gcc/ipa-str-reorg-dead-field-eliminate.c
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-02-04 19:20:09 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-14 14:45:31 +0200
commitba5e4d9cfe15de0716d32cdcedbb00b224ec08b6 (patch)
tree6e0030918af8fff203b5aa2292aab40267871966 /gcc/ipa-str-reorg-dead-field-eliminate.c
parent7a53b0e12485576c2f6252ae60ed974b37b10b0e (diff)
fixing arguments
Diffstat (limited to 'gcc/ipa-str-reorg-dead-field-eliminate.c')
-rw-r--r--gcc/ipa-str-reorg-dead-field-eliminate.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ipa-str-reorg-dead-field-eliminate.c b/gcc/ipa-str-reorg-dead-field-eliminate.c
index 85ef8a06081..b9ddcd5aafc 100644
--- a/gcc/ipa-str-reorg-dead-field-eliminate.c
+++ b/gcc/ipa-str-reorg-dead-field-eliminate.c
@@ -1519,10 +1519,15 @@ rewrite_call_rhs(gimple *stmt, gimple_stmt_iterator &gsi, hash_map<const_tree, c
test_log("what is the return type %s", 0, get_type_name(return_type));
//TODO: What happens with void?
gcc_assert(return_type);
-
- const_tree *new_type = type_map.get(return_type);
- if (!new_type) return;
+ // We need to modify the types of the variables that are passed here...
+ unsigned args = gimple_call_num_args(stmt);
+ for (unsigned i = 0; i < args; i++)
+ {
+ tree arg = gimple_call_arg(stmt, i);
+ rewrite_expr(arg, type_map, 0);
+ }
+
/*
* This is not the way to do it.
TREE_TYPE(fn) = (tree) *new_type;
@@ -1653,6 +1658,7 @@ static void
rewrite_function_parms(cgraph_node *cnode, hash_map<const_tree, const_tree> &type_map)
{
//TODO: Do we need to do get_untransformed_body here?
+ //TODO: Do we need to somehow relayout the whole function itself?
for (tree parm = DECL_ARGUMENTS(cnode->decl); parm; parm = DECL_CHAIN(parm))
{
tree parm_type = TREE_TYPE(parm);
@@ -1706,6 +1712,7 @@ rewrite_function(cgraph_node *cnode, hash_map<const_tree, const_tree> &type_map,
rewrite_function_return_type(cnode, type_map);
rewrite_function_body(cnode, type_map, inverse);
rewrite_local_decls(cnode, type_map);
+
}
static void