aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-02-04 21:28:49 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-02-04 20:28:49 +0000
commit0b986c6ac777aa4ecbfa29549148ef8ab95595e1 (patch)
tree47e63aafd9dc2bb56b66e8efb608e43a446ccad6 /gcc/gimple.c
parentd303ff9764d326120bfd05eb75e82e66fd12ade3 (diff)
downloadgcc-0b986c6ac777aa4ecbfa29549148ef8ab95595e1.zip
gcc-0b986c6ac777aa4ecbfa29549148ef8ab95595e1.tar.gz
gcc-0b986c6ac777aa4ecbfa29549148ef8ab95595e1.tar.bz2
re PR middle-end/64922 (runtime error: member call on misaligned address for type 'struct _Rep')
PR middle-end/64922 * gimple.c: Include gimple-ssa.h. (maybe_remove_unused_call_args): New function. * gimple.h (maybe_remove_unused_call_args): Declare. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Use it. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * gimple-fold.c (gimple_fold_call): Likewise. From-SVN: r220417
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index caa1cbd..a5c1192 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-ref.h"
#include "lto-streamer.h"
#include "cgraph.h"
+#include "gimple-ssa.h"
/* All the tuples have their operand vector (if present) at the very bottom
@@ -2950,3 +2951,20 @@ gimple_seq_discard (gimple_seq seq)
ggc_free (stmt);
}
}
+
+/* See if STMT now calls function that takes no parameters and if so, drop
+ call arguments. This is used when devirtualization machinery redirects
+ to __builtiln_unreacahble or __cxa_pure_virutal. */
+
+void
+maybe_remove_unused_call_args (struct function *fn, gimple stmt)
+{
+ tree decl = gimple_call_fndecl (stmt);
+ if (TYPE_ARG_TYPES (TREE_TYPE (decl))
+ && TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))) == void_type_node
+ && gimple_call_num_args (stmt))
+ {
+ gimple_set_num_ops (stmt, 3);
+ update_stmt_fn (fn, stmt);
+ }
+}